Add native support for directly running Linux AppImages under elfuse.
AppImages are self-contained Linux application bundles distributed as executable files. A Type-2 AppImage is an ELF runtime with an embedded SquashFS filesystem appended after the runtime. That embedded filesystem is the application’s AppDir and contains the AppRun entry point, desktop metadata, icons, shared libraries, resources, and application payload files.
When an AppImage is launched, its runtime normally mounts the embedded filesystem with FUSE, exposes the AppDir at a temporary mountpoint, then executes AppRun. elfuse already integrates and supports FUSE internally, so AppImages should be directly invokable under elfuse without requiring host macFUSE, FUSE-T, external squashfuse, or manual --appimage-extract.
Technical background:
- Type-2 AppImages are not plain SquashFS files; the SquashFS superblock appears at a non-zero file offset after the ELF runtime.
- The executable should first be treated as an ELF file, then probed for an embedded SquashFS payload.
- The embedded filesystem should be exposed as a read-only AppDir inside the emulated Linux environment.
- AppDir paths need to behave like normal Linux filesystem paths for
openat, newfstatat, getdents64, readlinkat, mmap, and execve.
- Electron AppImages are a useful compatibility target because Electron Builder AppImages use SquashFS internally and exercise dynamic loading, subprocess spawning, shared resources, Chromium sandbox setup, IPC, and large read-only application trees.
- The host should not need kernel FUSE support because elfuse can provide the AppDir view internally.
Expected behavior:
- Detect Type-2 AppImages by probing the executable for an embedded SquashFS payload.
- Locate and validate the SquashFS image at its non-zero offset after the ELF runtime.
- Expose the embedded filesystem as a read-only AppDir through elfuse’s internal FUSE/AppDir support.
- Support directory traversal, path lookup, stat, open, read, mmap-compatible file access, directory listing, and symlink resolution.
- Execute
AppRun from the embedded AppDir through the normal elfuse exec path.
- Preserve expected argv/env behavior closely enough that existing AppImage launch scripts work.
- Allow common AppImages, including Electron-based AppImages, to be launched directly.
Out of scope for the first pass:
- Writable AppImages.
- Full AppImage desktop integration.
- Host FUSE mounting.
- xattr support unless a real application requires it.
- Sparse-file optimization.
- Support for every SquashFS compression backend.
Validation:
- Add or generate a small Type-2 AppImage-style fixture with an ELF stub plus a gzip SquashFS payload.
- Verify AppImage probing finds the correct SquashFS offset and size.
- Verify AppDir directory listing via
getdents64.
- Verify
AppRun stat/read/exec behavior.
- Verify regular file reads and mmap-backed access.
- Verify symlink reads and relative symlink normalization.
- Verify unsupported compression fails with a useful error.
- Run at least one real Electron AppImage smoke test once the minimal bridge works.
Add native support for directly running Linux AppImages under elfuse.
AppImages are self-contained Linux application bundles distributed as executable files. A Type-2 AppImage is an ELF runtime with an embedded SquashFS filesystem appended after the runtime. That embedded filesystem is the application’s AppDir and contains the
AppRunentry point, desktop metadata, icons, shared libraries, resources, and application payload files.When an AppImage is launched, its runtime normally mounts the embedded filesystem with FUSE, exposes the AppDir at a temporary mountpoint, then executes
AppRun. elfuse already integrates and supports FUSE internally, so AppImages should be directly invokable under elfuse without requiring host macFUSE, FUSE-T, externalsquashfuse, or manual--appimage-extract.Technical background:
openat,newfstatat,getdents64,readlinkat,mmap, andexecve.Expected behavior:
AppRunfrom the embedded AppDir through the normal elfuse exec path.Out of scope for the first pass:
Validation:
getdents64.AppRunstat/read/exec behavior.