Skip to content

msl 0.3.0

Choose a tag to compare

@onexay onexay released this 01 Oct 12:43

Changed

  • msl reads and writes a session's input and output itself, straight to the VM: msld only starts the process and passes msl the session's vsock connections (#57). Output through a pipe is about twice as fast (4 GiB in 4.8 s, was 8.2 s), input slightly faster (4.9 s, was 5.7 s), msld uses no CPU for it, and one slow or stuck session can no longer stall the others: the VM dials these connections, which a stalled reader can't freeze (#36). msld also ignores SIGPIPE now; a write to a client that had gone away could kill it, and the VM with it. --import, --export and --install move the tar stream the same way, and VS Code's managed pipes (remote server connections, forwarded ports) are each an msl --connect process, so a stuck pipe affects only itself.
  • Localhost forwarding is relayed by a separate process, msl-portd (in libexec/msl), as WSL's wslrelay.exe does: msld sets up each forwarded port and connection but no longer copies their bytes, and msl-portd has no entitlements. It runs only while a port is forwarded. In the same way, a separate process, msl-fileviewd, relays the ~/.msl/distros view and checks its NFS calls, so msld no longer carries file data either (it used about 4.6 s of CPU per GiB read).
  • A distribution's disk is attached to the VM as virtio-blk when the VM boots, served by Virtualization.framework like data.img, instead of through msld's NBD disk slots. msld no longer serves disk I/O, and fsync inside a distribution reaches the SSD again. virtio-blk can't be hot-plugged: a disk added while the VM runs (an install, an import, a --move to another volume, a --resize) makes msld restart the VM if no distribution is running, which takes about 1.5 s. If one is, the new disk is mounted through a loop device over the Mac share until the VM next restarts; that path is slower, and it's flushed to the SSD when the disk is detached and at shutdown. Up to 19 distribution disks are attached at boot, and the rest use the loop device. A distribution's disk is no longer limited to 4 TB.
  • An idle MSL wakes the Mac far less. msld no longer polls: its idle timers sleep until the next deadline instead of ticking every second, and its copy and accept loops block instead of waking every 100–200 ms (context switches while idle: about 1030 per 30 s before, 5–8 after). In the VM, the process reaper sleeps until a child exits instead of checking 20 times a second when there's none, and the localhost-forwarding port watcher is woken by the kernel (a sock_ops BPF program) when a port opens or closes instead of scanning every 500 ms. Idle, the VM's process now uses about 0.5% CPU, down from 2.5–3.5%.
  • The bundled VS Code extension is 0.2.0: each managed pipe is an msl --connect process.

Fixed

  • msl --export <distro> - | head (or any reader that stops early) no longer aborts msl with an uncaught "Broken pipe" exception; it exits with an error.

Removed

  • Compatibility between different versions of msl, msld and the VS Code extension: they're updated together. msld's connect socket (connect.sock) and msl-bridge are gone, and the extension needs msl --connect. From this version on, msl --update also updates the extension in every IDE that has it; after updating to this version, run msl --manage-ide --install once.
  • The NBD disk slots and MSL_DISK_SLOTS.

Install: sh install.sh (or sh install.sh --version 0.3.0). Update an existing install with msl --update.

Kernel Linux 6.18.15-msl-a1a22bd, release kernel-6.18.15-msl-a1a22bd
VS Code extension release vscode-0.2.0, installed by msl --manage-ide
Commit 3038879
Requires Apple silicon, macOS 26 or later
GPL sources BusyBox and e2fsprogs: the attached Debian source packages busybox_* and e2fsprogs_*. Kernel: attached to kernel-6.18.15-msl-a1a22bd.
Built by CI run 36862363559, Xcode 26.6
Signing ad-hoc (not notarised); checksum not PGP-signed

msl-0.3.0-macos-arm64.tar.gz SHA-256: 066f21286ef9b43647fd4c4c9f23a3d816c1b04786eac9f8d4772d35c263e504