TryNix Runs Linux Desktop Apps Inside a Browser Tab
A browser tab can now open a shell, install a historical Linux package, and display that package’s graphical windows. trynix makes this possible without running the application on a remote server. The page downloads a package’s Nix store closure and runs a Linux guest on the visitor’s machine. Its recent switch to unkernel makes the result much more responsive, and adds windows, graphics, sound, and a network path.
This is a remarkable demonstration because the browser is doing several jobs usually assigned to an operating system and a package manager. It must identify an exact package build, authenticate and fetch its dependencies, execute Linux binaries of the right architecture, show their output, and translate device access into browser APIs. Each boundary matters. Understanding them explains both why the demo works and why it still has limits.
Pick a build from years of Nix history
The starting point is nixpkgs-multiverse, an index of historical Nix package builds. Instead of asking a current Linux installation to provide whatever version happens to be installed, trynix can resolve a package name and version to a particular Nix store path. The author says its catalog covers more than 300,000 distinct package versions. A link can specify a package such as python3@3.10.*, and multiple selections can coexist even if they came from different points in nixpkgs history.
The store path is only a root. A program needs libraries, interpreters, data files, and sometimes other programs. trynix walks the closure of referenced store paths, retrieves package metadata and archives from binary caches such as cache.nixos.org, and checks signatures against configured public keys. The browser builds a file share containing those paths and presents the selected programs on the guest shell’s PATH. That is the critical distinction between downloading a binary and recreating enough of its runtime to execute it.
The URL carries the selection. This makes a runnable environment easy to share, including a specific store path or a binary cache and its public key. It does not mean that a package is bundled into the link. The browser still needs access to the cache, enough memory, and a guest engine that can execute the package’s architecture.
The original engine emulated the whole computer
trynix initially used qemu-wasm: QEMU compiled to WebAssembly, emulating an x86_64 machine in the browser. A Linux guest ran inside that emulated machine. The design even resumed from a prebuilt migration snapshot so the tab could skip much of a cold boot. QEMU mounted the fetched Nix store through a 9p share. That architecture could run unmodified x86_64 builds, which is a strong compatibility story, but every kernel operation also passed through CPU emulation.
Starting an unfamiliar program is particularly costly. The guest must load executable pages, resolve libraries, create a process, map memory, and handle filesystem operations. For a first run, much of that work is in the kernel rather than in the application. Emulating the kernel along with the application therefore spent time in the wrong place. The original project was impressive, but the wait could make it feel like a novelty.
unkernel moves Linux itself onto WebAssembly
The new default engine changes which part of the machine is emulated. unkernel compiles the Linux kernel to WebAssembly. Its syscalls, scheduler, memory management, page cache, and device handling run as compiled Wasm code. An embedded emulator executes unmodified aarch64 user programs. When an application makes a system call, control returns to the Linux kernel running in Wasm. The project implements an MMU path and can suspend and resume kernel execution with JSPI.
This arrangement preserves the behavior of a real Linux kernel for the guest program while avoiding full-machine emulation of kernel work. It does not make an aarch64 binary run natively on an x86 desktop CPU; its user instructions are still interpreted or compiled by unkernel’s emulator. That is why CPU-heavy applications can remain slow even as process startup and file operations improve.
The project’s controlled comparison gives a useful sense of scale. On one EPYC machine, a cold jj --version fell from 1.98 seconds under QEMU to 0.20 seconds under unkernel; a cold Python print fell from 3.46 to 0.66 seconds. A larger opencode --version improved from 116.5 to 56 seconds. The project’s browser benchmark reports 3.02 to 0.35 seconds for a cold jj --version on a different clock setting. Those are measurements of specific builds and hardware, not a universal “32 times faster” guarantee. The two engines also use different architecture builds, which can affect direct comparisons.
QEMU remains part of trynix. unkernel currently runs aarch64 user binaries; it cannot execute an x86_64 Nix store path. trynix selects QEMU for x86_64 paths, for older links that name such paths, and for browsers without the required JSPI support. Package-name links can be resolved against the index for whichever guest architecture was selected. That fallback is necessary because an exact store path identifies one architecture-specific build, while a package name can resolve to different builds.
A desktop window needs more than a fast shell
A graphical Linux program expects a display protocol, input, fonts, graphics drivers, and often audio. trynix uses wland, a Wayland compositor that presents application surfaces as windows in the web page. The Linux program still speaks to a Wayland environment; the page handles the visible window and browser input. For OpenGL ES applications, the guest has a small Mesa setup with a virgl path compiled to WebAssembly, while the browser’s WebGL2 does the final rendering. ALSA audio from the guest reaches the browser’s audio output.
This is an integration of several systems, not a claim that any desktop application will instantly feel native. A program must have a compatible aarch64 package build and a working closure. Its display and graphics needs must fit the guest’s supported device path. Large programs may need more memory and time than a small command-line tool. The author demonstrates Solitaire, GL gears, xeyes, speech, and Firefox, but these examples cover different degrees of complexity.
The most playful example is Firefox inside trynix, loading trynix, which launches Firefox again. It demonstrates that the browser-hosted guest can run a substantial graphical browser and networked page. The author also reports that the nested demonstration took more than four hours and required special adjustments: JIT was disabled in the innermost Firefox, the middle browser ran without GL, and the outer page used a relay on the author’s laptop. It is an existence proof, not a practical recursive browsing workflow.
Downloads now happen when files are opened
A fast kernel does not eliminate download time. Some graphical packages have large closures containing tools they will never use in a particular session. The engine notes give a concrete example: the Solitaire package’s closure has 168 paths and about 297 MiB compressed, including a large compiler that the game never opens. Firefox’s closure is even larger.
For unkernel, trynix now downloads the selected package first and starts the shell while leaving much of the rest of the closure on demand. It obtains file listings for store paths so the guest can answer ordinary directory and metadata lookups without downloading every archive. Opening a file in an absent path waits for that archive to arrive. The browser checks the archive hash and reconciles a listing against the real archive when it is fetched. This shortens the initial wait while moving some delay to the first operation that needs a missing file.
The QEMU engine still fetches the full closure before the guest starts, because its file share cannot pause synchronously for a browser download. The distinction is a reminder that a faster CPU path and a faster experience are not identical. Package selection, network speed, decompression, first-use file faults, and UI readiness all contribute to the user’s wait.
Networking crosses a relay
The unkernel guest has a virtual network interface and a small network stack on the page. Each TCP connection travels over a WebSocket to a Wisp relay, which opens the connection outside the tab. This lets tools such as curl, git clone, and pip install work. It also changes the privacy and trust picture: the relay can see destination hosts and any traffic that is not encrypted end to end. trynix lets the user disable networking or choose another relay. The documented guest has no inbound connections, no general UDP beyond local DHCP and DNS handling, and no IPv6. QEMU’s guest currently has no network device in trynix.
The Nix package archives themselves are fetched by the browser from configured caches. That is separate from a guest application’s outbound TCP connection. Keeping these paths separate makes the architecture easier to reason about: one path supplies signed, content-addressed program files; another supplies live network access through a relay.
What the browser has become
trynix is a package explorer, a Linux guest, and a desktop bridge packaged as a shareable page. Its shift to unkernel shows where the old performance cost lived: emulating a whole kernel for every first-use filesystem and process operation. Compiling Linux to Wasm leaves only user programs in the emulator and makes small commands much quicker to start.
The remaining limits are just as instructive. Exact store paths tie a package to an architecture. A tab has finite memory. A large closure may still take substantial time to fetch. Network access depends on a relay, and graphical programs depend on a deliberately narrow display and graphics stack. The browser can host a surprisingly complete Linux experience, but each feature is supplied by a specific bridge rather than by magic.