docs/Security/Sandboxes/KVM/AsahiFedora/README.md
Fedora Asahi Remix on Apple Silicon can use ARM64 KVM guests when /dev/kvm is
available. A dedicated virtual machine is the preferred boundary for running the
complete WeKan and FerretDB test stacks because Docker, the browsers, databases,
source trees and development credentials can all remain inside the guest.
This is a stronger boundary than Toolbox, Distrobox, a development container, or
VSCodium Flatpak with flatpak-spawn --host. Those approaches deliberately share
parts of the host. The VM created here shares no host directory, SSH agent, Docker
socket, clipboard channel, USB device, or bridged network.
/dev/kvm.aarch64) Server or Workstation installation ISO.Check KVM before installing anything:
uname -m
test -r /dev/kvm && echo "KVM is available"
The architecture must be aarch64. Do not use an x86-64 ISO: QEMU would have
to emulate that CPU instead of using KVM acceleration.
Download a current Fedora ARM64 ISO from Fedora, verify its published checksum,
and pass its local path to install.sh:
cd /home/user/repos/wekan/docs/Security/Sandboxes/KVM/AsahiFedora
./install.sh /path/to/Fedora-Server-dvd-aarch64.iso
The script installs the Fedora virtualization packages on the host, enables
libvirt, creates the default isolated NAT network when necessary, and defines
wekan-asahi-test with these defaults:
| Resource | Default |
|---|---|
| CPUs | 6 KVM-backed ARM64 vCPUs, host CPU model |
| Memory | 12 GiB |
| Disk | 100 GiB sparse qcow2 under /var/lib/libvirt/images/ |
| Firmware | ARM64 UEFI |
| Network | libvirt's NAT-only default network |
| Display | local-only SPICE console |
| Host integration | no shared directory, agent, Docker socket, USB or clipboard channel |
Override sizing before installation when the host is smaller or larger:
VM_CPUS=4 VM_MEMORY_MIB=8192 VM_DISK_GIB=80 \
./install.sh /path/to/Fedora-Server-dvd-aarch64.iso
The Fedora installer opens in virt-manager. During installation, create a
normal non-root user and enable disk encryption if unattended VM restarts are
not required. The VM powers off when installation finishes. Remove the virtual
installation media if the Fedora installer does not do so automatically.
The installer refuses to overwrite an existing VM or disk. Remove or rename an old VM deliberately before trying to create another one.
Start the installed VM and open its local console:
./start.sh
Ask the guest operating system to shut down cleanly:
./stop.sh
stop.sh waits up to 120 seconds. It does not use virsh destroy, because that
is equivalent to pulling the power and can corrupt a database or filesystem. If
the guest does not stop, inspect it with virt-manager and decide manually
whether a forced power-off is justified.
Set VM_NAME for all three scripts to manage a differently named VM:
VM_NAME=wekan-test-2 ./start.sh
Keep all test dependencies inside the VM:
Do not forward the host's SSH_AUTH_SOCK, GPG agent, Docker socket, home
directory or source checkout. If the guest needs GitHub access, use a separate,
limited credential in the guest. Prefer committing in the guest and pushing
manually from a trusted host checkout.
See Fedora's virtualization getting-started guide and Docker's rootless-mode documentation for the underlying host and container facilities.