Portable VM dev environment #
Declarative, immutable, rebuildable VM image for development. Built on ucore-hci (Fedora CoreOS + libvirt/KVM/ZFS/cockpit/podman) with KDE Plasma layered on top via a custom Containerfile.
Architecture #
ucore-hci (immutable, rpm-ostree, Fedora CoreOS base)
+ KDE Plasma, SDDM (baked into custom image)
+ system dev packages (baked into custom image)
+ ghostty RPM via scottames/ghostty COPR (baked into custom image)
+ mise (baked, /usr/local/bin)
+ user account (baked)
|
+ mise toolchains (first-login, ~/. local/share/mise/)
+ dotfiles (first-login, ~/.config/)
+ librewolf RPM via LibreWolf repo (baked into custom image)
+ secrets (manual, gh auth login / SSH keys)
Two artifacts define the entire environment:
- Custom container image (
Containerfile+ TypeScript orchestration insrc/build-and-import.ts): OS layer, rarely changes - First-login provisioner (file-enforcer config in this monorepo): user layer, changes often
Decisions made #
- Base image:
ghcr.io/ublue-os/ucore-hci:stable: well-documented, has its own GitHub repo, includes HCI stack (libvirt, KVM, ZFS, cockpit, podman) - Not Bazzite: too much gaming bloat for a dev VM
- Not Fedora Kinoite: poor documentation, no dedicated repo, includes unwanted defaults
- Not openSUSE Kalpa: alpha status, single maintainer, officially unmaintained
- Not Alpine:
no transactional package management (
apk addmutates root directly) - Not mutable distro: immutability provides defense-in-depth against config drift, even on short-lived VMs
- KDE layered on server base: add only what we need rather than subtract what we don't
- Custom image (not rpm-ostree layering at boot): faster VM startup, reproducible, KDE is part of the base not a fragile layer
- Dotfiles baked into image:
package/config/dotfiles/package with subdirectories (ghostty, mise). COPYed into~/.config/at image build time via widened build context. Only two configs needed; a separate repo and provisioner step are overkill. - KDE config not portable: let KDE regenerate defaults on each VM, machine-specific state (display IDs, GPU paths, monitor geometry) causes more breakage than it prevents
- No cloud-init: everything is baked into the image or handled by the first-login provisioner
- Secrets stay manual:
gh auth loginand SSH key setup after provisioning, no encrypted vaults or automation for secrets - Provisioner lives in this monorepo:
versioned alongside the rest of the dev tooling,
uses file-enforcer primitives (
exec,overwrite,cat) - Provisioner triggered manually:
run
setup-devonce after first login, no systemd user services or.bash_profilehacks - Host-level FDE only:
rely on host OS full-disk encryption (BitLocker on Windows,
LUKS on Linux host) rather than per-image encryption.
ZFS native encryption is not supported at any layer (osbuild,
bootc,
bootc-image-builder).
btrfs-on-LUKS2 through bootc-image-builder is blocked (blueprint schema doesn't expose LUKS;
bootc's
tpm2-lukshas an open deadlock bug bootc-dev/bootc#2089). QEMU LUKS-encrypted qcow2 works but VHDX has no format-level encryption equivalent (MS-VHDX spec has zero cipher/key fields), breaking vmsync cross-platform parity. - plasma-workspace meta-package: full KDE desktop set rather than minimal plasma-desktop, since ucore-hci is a server base with no desktop components
- Provisioner in vm-builder:
no
src/provision.tsor:provisiontask exists yet. Dotfiles are baked into the image byContainerfile; a future first-login provisioner still needs to be created if flatpak or user-layer setup remains required. - Nvim deprecated by editord: no nvim config clone needed in the provisioner
- Skip Ignition/Butane: everything is baked into the image or handled by the provisioner; Ignition adds no value beyond what the Containerfile already provides
- Cosign key for future use: set up cosign even though builds are local-only, in case images need to be pushed to GHCR later
Phase 1: custom container image #
Containerfile #
Based on ublue-os/image-template pattern.
Uses ghcr.io/ublue-os/ucore-hci:stable as base.
Lives at package/dev-script/vm-builder/ in this monorepo.
Run via:
mise run //package/dev-script/vm-builder:run
System packages to bake in (Containerfile) #
All packages below are installed and verified in the Containerfile.
KDE Plasma desktop (full plasma-workspace meta-package):
Browser + password manager:
Terminal:
Dev tools (system-level, mise handles the rest):
Infrastructure:
Build and convert #
Implementation notes discovered during build:
- qcow2 must be copied to
/var/lib/libvirt/images/for SELinuxvirt_image_tcontext (files in$HOMEhaveuser_home_twhich QEMU'ssvirt_tdomain cannot read) getenforcereturns "Disabled" inside the Claude Code sandbox but SELinux is actually enforcing on the host- Flatpak virt-manager needs
org.virt_manager.virt_manager.Extension.Qemuforqemu:///session - UEFI domains require
--nvramflag when undefining viavirsh undefine - LibreWolf repo URL changed:
rpm.librewolf.net->repo.librewolf.net(2026) findUp('package.json')returns relative paths when the file is in cwd; wrap withresolve()
Full-disk encryption; decided: host-level FDE #
**Decision: ** rely on host OS full-disk encryption instead of per-image encryption.
Research findings (March 2026):
-
ZFS native encryption: not supported at any layer. osbuild has zero ZFS stages (
mkfsstages: ext4, xfs, btrfs, fat only). bootc'sFilesystemenum has three variants: Xfs, Ext4, Btrfs. ucore-hci excludes ZFS from the initramfs; ZFS is runtime-only for/varmounts. Open issue bootc-dev/bootc#1240 documents the failure. -
btrfs-on-LUKS2: osbuild has
org.osbuild.luks2.formatstages internally, but the blueprintconfig.tomlschema does not expose LUKS as a partition type. bootc's--block-setup tpm2-lukshas a semaphore deadlock bug (bootc-dev/bootc#2089). -
QEMU LUKS-encrypted qcow2: works (supported since QEMU 2.10, XTS-AES-256), but VHDX has no format-level encryption (MS-VHDX spec rev 8.0 has zero cipher fields). Microsoft's Shielded VMs use guest-side BitLocker, not VHDX encryption. This breaks vmsync's cross-platform sync parity.
Ignition/Butane config; decided: skip #
Ignition adds no value beyond what the Containerfile already provides. The user account is baked in, and SSH keys are handled manually post-boot.
Phase 2: first-login provisioner #
No src/provision.ts or :provision mise task exists yet.
Dotfiles are baked into the
image by Containerfile,
and image-time mise installs only the global tools declared in
package/config/dotfiles/mise/config.toml.
A future first-login provisioner still needs
to be created if flatpak or user-layer setup remains required.
Dotfiles package #
Lives at package/config/dotfiles/ in this monorepo.
Only two configs needed:
ghostty and mise.
-
ghostty/configmise/config.toml(global mise config)
Provisioner script tasks #
Runs as user after first login. Idempotent (safe to re-run).
Provisioner trigger sequence #
# 1. Manual secrets setup
gh auth login
ssh-keygen -t ed25519 # or copy key from USB
# 2. Clone monorepo
gh repo clone Aquaticat/Monochromatic ~/Monochromatic
# 3. Install dev toolchains (mise is pre-installed in image)
cd ~/Monochromatic
mise trust && mise install
# 4. Future, not implemented yet: run first-login provisioner if one is added
# mise run //package/dev-script/vm-builder:provision
Phase 3: verification #
Phase 4: iteration workflow #
Once the base image is stable, day-to-day changes fall into two categories:
OS-level changes (rare): edit Containerfile or TypeScript build orchestration, rebuild image, convert to qcow2. Examples: new system package, display manager config, kernel module.
User-level changes (frequent): edit provisioner or dotfiles, re-run provisioner. Examples: new mise tool, editor config change, new dotfile. No image rebuild needed: just re-run the provisioner in the existing VM.