mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 16:27:33 -10:00
Linux's 9p client loses data with Lima's default cache=mmap for a writable share: a stat() during an extending write() takes the host's stale size and writeback drops the data, so files reach the host empty or cut to 4096 bytes even after fsync (Claude Code's Edit sets it off); and on devvm's Ubuntu 26.04 guest kernel, a lock after a write makes the next read return zeros, which breaks SQLite in any journal mode and Gradle's daemon. macOS's vz VMs use virtiofs and aren't affected. - New VMs on a Linux host record cache mode none in a new mount section of vm.json, and their project folder is made and started with it, as is the folder devvm clone off mounts. VMs whose state has no mode (0.1.0's, and every VM made before this) keep Lima's mmap untouched, with no limactl edit, and each launch warns (mount_cache_unchosen) until devvm mount-cache none. - devvm mount-cache [none], with --json: none is the only mode devvm sets, so any other value is a usage error (mount_cache_invalid); a stopped VM gets it in its next start's one edit, a running one after the restart devvm offers. macOS refuses (backend_lacks), and so does a Linux VM whose folder isn't a 9p mount (mount_cache_no_choice). No -g or config.toml key: every new VM gets none. - The start that changes the mode mounts the folder again in the guest, as cloud-init rewrites fstab only after systemd has mounted it, through the logged runner with a minute's limit (output pipes closed a second after), then checks it with mountpoint and findmnt, reading 4 KiB at most and only the last line: a folder left unmounted stops the VM and fails the start before its shell (mount_cache_unmounted), and so does a check that gets no answer (mount_cache_unchecked); one still mounted with the old mode is warned of (mount_cache_remount_failed), any mode but none or mmap named unknown. An interrupt meanwhile, on any tier, leaves a cleanup that stops the VM, the one stop then. A launch into a running VM asks the guest, in words, whether its folder is a mount point, and refuses one that isn't (project_unmounted) or whose check fails or gives no answer (project_unchecked). A stored mmap, from a build before none alone, reads as none chosen, and devvm clone off records none for its new mount; any other mode is refused naming vm.json. - backend: FeatureMountCache (native on Linux, none on macOS, built on project-mount), Want.ProjectCache, Instance.ProjectCache, CacheModes. - lima: mount rewrites keep only the sshfs and 9p settings devvm knows where they differ from Lima's defaults, and drop the rest for Lima to fill in, so lima.yaml never freezes a default; same() compares the cache where devvm sets one. Build VMs' writable output folders (tools, --from) get none. - tools: an EROFS tool image that ends before its superblock does, or is shorter than its superblock says, as a build under mmap could leave one, counts as not built, so the next build makes it again; a build's short output is refused. The fakes' tool images are a page (backendtest.ToolImage). - The limactl stub lists QEMU's vmType, fills in 9p cache defaults on Linux, and answers the remount's check. - Docs: backends/lima (the project folder's cache, when it changes, programs that map files for writing, SQLite), using/limits, using/clone, commands, internals/lima, internals/backends, the design note (both mmap bugs, why none alone, the remount, tool images, the e2e findings), the CLI reference and the cli skill. - Tests: TestProjectCache, TestMountRoundTrip, TestStartSetsProjectCacheOnce (the remount's outcomes), TestCutShort, TestBuiltCutShort, TestGuestMountOptions, TestFilledMounts, TestUpCacheMode, TestWarnMountCache, TestCacheAtNextStart, TestSwitchCache, TestSetMountCache, TestCheckStateCache, the mount_cache CLI test, clone_switch and the 0.1.0 fixture on Linux, and e2e's projectMountCache (findmnt, a stat-while-write loop, SQLite's journals, a shared writable mmap refused, the opt-in switch of an unchosen VM, what mmap does reported, macOS unchanged). Co-Authored-By: Claude Opus 5.5 <[email protected]>
6.5 KiB
Generated
6.5 KiB
Generated
title, explainer
| title | explainer |
|---|---|
| devvm | Open a shell in this folder's VM, creating it first |
Open a shell in this folder's VM, creating it first
Synopsis
Open a shell in this folder's VM, at the same path, and create the VM first when the folder has none. devvm shows what a new VM gets, and in a terminal you can customize its toolchains, coding agents, layers, tier, ports and size, which --tools, --agents, --layers, --network, --ports, --cpus, --memory and --disk choose without asking. The VM mounts only this folder read-write, and with --clone it gets its own clone of the repo instead.
devvm [flags]
Examples
devvm # open this folder's VM, choosing what a new one gets
devvm --agents claude # create the VM with Claude Code and the toolchains the folder needs
devvm --tools node --agents none --layers docker # create the VM with node and the docker layer alone
devvm --clone # create the VM with its own clone of this repo
devvm ls # list every VM
Options
--agents LIST the LIST of coding agents a new VM gets, such as claude,codex, or none (default: devvm setup's)
--clone create the VM with its own clone of this repo, or of each repo in this folder, instead of mounting the folder
--cpus N the N CPUs the VM gets (default: devvm size -g, else the image's)
--disk GiB the VM's disk in GiB, at least the image's (default: devvm size -g, else the image's)
--from IMAGE the container IMAGE base starts from, such as node:24, instead of Ubuntu's cloud image (default: $DEVVM_FROM)
-h, --help help for devvm
--here use this folder's own VM, never that of a folder it's inside
--layers LIST the LIST of layers a new VM's image gets, bottom first, such as docker,mine, or none (default: devvm setup's)
--memory GiB the VM's memory in GiB, such as 16 or 16G (default: devvm size -g, else the image's)
--network TIER the network TIER a new VM gets: open, internet, allowlist or none, or learn for internet while it learns the hosts it needs (default: devvm network -g's, else allowlist)
--no-devcontainer create the VM without reading the folder's devcontainer.json
--no-git-protect create the VM without .git protection
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--ports PORTS the PORTS the VM forwards: all, none or a list like 5173,8000-8010 (default: devvm ports -g, else all)
--repos LIST the repos a --clone VM of a folder of repos gets: all, none or a LIST of their paths, such as frontend,backend (default: a picker in a terminal)
--ssh-agent create the VM with your SSH agent forwarded, so anything in it can use your keys while you're connected
--ssh-config add devvm's Include line to ~/.ssh/config without asking
--tools LIST the LIST of toolchains a new VM gets, such as node,python, or none (default: those the folder's files call for)
--unsafe-folder mount a folder devvm refuses, such as your home folder
-v, --verbose show the output of the commands devvm runs instead of a status line
--version print devvm's version
Docs
The docs page for devvm explains it in full.
See also
- devvm adopt: Give this folder the VM made for an earlier folder or path
- devvm agent: Fill devvm's store of the agents' settings and logins that every VM gets
- devvm build: Build an image and the images under it, unless they're built
- devvm clone: Show or change whether this folder's VM has its own clone of the repo
- devvm code: Open this folder's VM in VS Code over Remote-SSH
- devvm completion: Print the shell completion script for bash, zsh or fish
- devvm desktop: Open this folder's VM's desktop in a VNC viewer
- devvm doctor: Check what devvm needs on this machine
- devvm gc: Delete stale images, unused tools, old files and the Nix cache over its cap
- devvm git-protect: Show or change .git protection for this folder's VM
- devvm group: Show the group this folder's VM is in
- devvm history: List the saved exports of agents' history
- devvm host: Get this folder's VM ready for ssh and editors, and show its host name
- devvm images: List the images and the shared tools
- devvm layer: Make image layers of your own, or change this folder's VM's layers
- devvm limactl: Run Lima's limactl for debugging, which starts VMs unconfined, whatever their tier
- devvm link: List this folder's VM's links to your other VMs
- devvm ls: List the project VMs
- devvm mount-cache: Show or change how this folder's VM caches its project folder
- devvm network: Show or change the network tier of this folder's VM
- devvm ports: Show or change which ports this folder's VM forwards
- devvm rebuild: Build an image again, and delete the old one
- devvm restart: Restart this folder's VM and open a shell in it
- devvm retention: Show or change what devvm deletes on its own
- devvm rm: Delete this folder's VM, or a VM whose folder is gone
- devvm secret: List the secrets kept on this machine, for VMs to use
- devvm setup: Choose base's features, and new VMs' size, network tier, coding agents and layers
- devvm size: Show or change this folder's VM's size
- devvm space: Show what devvm keeps on this machine and the space it takes
- devvm ssh-agent: Show or change SSH agent forwarding for this folder's VM
- devvm stop: Stop this folder's VM
- devvm tools: Show or choose this folder's VM's shared tools
- devvm update: Bring this folder's VM up to date, then open a shell in it
- devvm upgrade: Install devvm's newest release