Skip to content

v0.2.0-261122-4e58555

Choose a tag to compare

@github-actions github-actions released this 22 Nov 23:54
· 53 commits to main since this release

Linux in the browser now has a GPU and a desktop: unmodified Wayland and GL apps (Firefox, Chromium, SuperTuxKart) run as windows on the page.

Highlights

Guest GPU: /dev/dri with accelerated GL

  • The guest has a virtio-gpu device with the stock virtio_gpu driver. Its GL commands run on the page's WebGL2 context through a wasm build of virglrenderer, and frames are shown without readback.
  • Guest GL is on by default for Debian on the page, and the renderer loads only when a guest program first uses GL (?gpu=0 turns the device off).
  • kmscube, glmark2, X with glamor, Chromium's GPU path (ANGLE, and WebGL inside the guest) and SuperTuxKart run. Checked in Chrome, Safari and Firefox.
  • Multisampling, display resizes that reach the guest's DRM mode, and recovery from a lost WebGL context without a page reload.
  • SDK: createKernel({ gpu, gl }), --gpu in the CLI, vm.gl.gpu.texture() and vm.gl.gpu.image().

Wayland desktop

  • Unmodified Wayland apps in the guest (foot, Firefox, Chromium, GTK and libadwaita apps, SDL games, GL clients) show as windows on the page through wland.
  • GL windows are shown straight from the GPU without readback, the clipboard is shared, and toolkits default to a dark theme.
  • The relay starts at boot, so GUI apps need no prefix.

The page is a desktop

  • The page is now a desktop with Display, Settings and app windows.

WebSockets in the guest preview

  • A dev server in the guest, such as Vite with HMR, works in the page's preview: the preview's WebSockets reach the guest's ports.

Performance

  • Faster boot: no RAM disks (about 130 ms saved per boot), DHCP in the background so the shell starts before the lease, and an uncompressed initrd. The guest tools are one static binary, kwbox.
  • Distro images on slow links: the image's warm set is fetched in the background, and sequential reads are read ahead. With 100 ms of added latency, apt-cache show bash takes 1.0 s instead of 8.1 s.
  • JIT: 21% less compile time during boot, and Node, Bun and Claude Code run 2–9% faster.
  • Worker mode: guest shared memory is read in place, and host-to-guest messages take about 0.6 ms instead of up to 20 ms.

Memory, snapshots and disks

  • Default memory is now 2 GiB on desktops and Node, and 512 MiB on phones.
  • Snapshots of 2–4 GiB machines work: a 2 GiB machine suspends and resumes in Chrome, and 4 GiB snapshots cross the worker boundary. Restores no longer use host memory for zero pages, and SnapshotOptions.dropCaches drops the guest's caches first.
  • The data disk can grow past 4 GiB: the page's Disk size setting, or openDataDisk({ size }) in the SDK (#12).

Fixes

  • Firefox: no more "too many continuation stacks" errors after a while on 2 CPUs.
  • Firefox and Safari: errors from another CPU are logged with their name and message.
  • Debian boots stay off systemd even when a desktop package pulls in systemd-sysv.
  • Audio threads in terminal sessions can be reniced, for steadier playback.
  • Virtqueues placed at or above 2 GiB of shared memory work.

Full Changelog: v0.2.0-261121-8988cfd...v0.2.0-261122-4e58555