Add developer VM script for faster testing iteration#4470
Open
Softer wants to merge 1 commit intoarchlinux:masterfrom
Open
Add developer VM script for faster testing iteration#4470Softer wants to merge 1 commit intoarchlinux:masterfrom
Softer wants to merge 1 commit intoarchlinux:masterfrom
Conversation
Introduces dev_vm.sh, a QEMU launcher paired with a minimal archiso-built dev ISO. The project source is shared read-only into the guest over 9p, so host edits appear live inside the VM without rebuilding the ISO on every change. The guest auto-mounts the share at /root/archinstall-dev and aliases `archinstall` to `python -m archinstall` from that path. The runtime package list is derived at build time from pyproject.toml so the script stays in sync with upstream dependencies automatically. OVMF paths are probed across Arch, Debian/Ubuntu, and Fedora layouts, and an Arch-based host is verified via /etc/os-release before pacman. .gitignore: whitelist dev_vm.sh under the existing **/**.sh blanket and ignore the .dev-iso/ and .dev-configs/ artifact folders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Sharing a small helper I've been using locally to iterate on archinstall changes inside a VM. It saved me enough time that I figured other contributors might want it too.
The pain
When I change something in archinstall and want to test it end-to-end (run the installer in a VM, walk the menus, let it actually partition and install), the current options all share the same shape.
build_iso.shrebuilds the full ISO on every source change, carrying gcc/pip/uv/wheel build each time. The README "Testing" section and the wiki "Building and Testing" describe the same loop manually: bootvanilla Arch ISO,
pacman -S git python-pip gcc pkgconf, clone repo, runpython -m archinstall. Both work, but both rebuild the world on every change.What I wanted was: edit a
.pyon the host, relaunch the VM, runarchinstall, see the change. No wheel build. No ISO rebuild. Just a hot-reload dev loop.What this PR adds
dev_vm.shat the repo root, sibling ofbuild_iso.sh. Two independent pieces:archisothat carries only archinstall's runtime deps - no gcc, no pip, no wheel build. The dep list is derived at build time frompyproject.toml's[project.dependencies](PEP 503 normalized, mapped to the Arch
python-<name>convention, which holds for every current dep), so adding or removing a runtime dep upstream does not require touching the script. The ISO is tiny andonly needs rebuilding when the runtime dep list actually changes.
/root/archinstall-dev, the shellcd-sinto it, and
archinstallis aliased topython -m archinstallfrom the shared source. A 9p mount failure prints a clear error, so a broken virtfs setup does not silently turn into "No module namedarchinstall".
So the inner loop becomes: edit code on host,
./dev_vm.sh k, typearchinstallinside the guest. No rebuild, no reinstall.Modes
./dev_vm.sh- build ISO if missing, fresh disk, boot./dev_vm.sh rebuild | r- force ISO rebuild, fresh disk, boot./dev_vm.sh keep | k- reuse disk, boot ISO./dev_vm.sh boot | b- boot from installed disk (no ISO)./dev_vm.sh clean | c- remove disk, NVRAM, ISO./dev_vm.sh -h- helpHost artifacts (all git-ignored)
.dev-iso/- generated dev ISO.dev-disk.qcow2- VM disk.dev-ovmf-vars.fd- persistent UEFI NVRAM.dev-configs/- optional, user-created, shared rw to guest at/root/cfg(handy for keeping testuser_configuration.json/user_credentials.jsonbetween runs)Host requirements
Arch-based host (Arch, Manjaro, EndeavourOS, ...) because
mkarchisois Arch-only. The script reads/etc/os-releaseand fails fast with a clear message on non-Arch hosts, before ever touching pacman.Runtime deps:
qemu-base,edk2-ovmf,sudo,python(for parsingpyproject.toml). OVMF paths are probed across the common layouts (Archedk2-ovmf, Debian/Ubuntuovmf, Fedoraedk2-ovmf) so the samescript works across Arch-based distros with different OVMF packaging. 9p
mapped-xattrmode needs xattr support on the filesystem holding the repo (ext4/btrfs work out of the box; ZFS needsxattr=sa).Changes in this PR
dev_vm.sh- new file.gitignore- three lines:!dev_vm.shas an exception under the existing**/**.shblanket, plus/.dev-iso/and/.dev-configs/for the artifact foldersOpen to feedback on placement (repo root vs a
scripts/folder), naming, and scope. I kept artifact names dot-prefixed to hide them fromlsand group them under one visual namespace.Note: the CI ISO artifact attached to this PR is the regular
build_iso.shoutput, unaffected bydev_vm.sh(which is a separate dev-only tool and does not touch the CI build path).