fix(vm): use profile-specific MAC addresses and document qcow2 pre-creation
- commit
- 7030359b7f924e44cd6855da8fffecf87781a3ae
- author
- brice · · 2026-02-27 04:52 UTC
- parent
- 63b18be
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +8 -1
M test/vm/README.md +2 -0
| @@ -106,3 +106,5 @@ ip link | |||
| 106 | 106 | ||
| 107 | 107 | - Secure Boot mode copies OVMF_VARS to a temp file each run; keys must be enrolled manually via UEFI shell on first boot. | |
| 108 | 108 | - `check-luks.sh` defaults to `/dev/nvme0n1p2`. For old virtio-disk images use `--disk /dev/vda2`. | |
| 109 | + | - `arch-test.qcow2` must exist before launching any VM (run `./create-vm-img.sh` first). The ISO launcher also requires it as the install target disk. | |
| 110 | + | - Desktop and laptop profiles use different MAC addresses (`52:54:00:12:34:01` / `:02`) so both VMs can run concurrently on the same host. | |
| @@ -106,3 +106,5 @@ ip link | |||||
| 106 | 106 | ||||
| 107 | - Secure Boot mode copies OVMF_VARS to a temp file each run; keys must be enrolled manually via UEFI shell on first boot. | 107 | - Secure Boot mode copies OVMF_VARS to a temp file each run; keys must be enrolled manually via UEFI shell on first boot. | ||
| 108 | - `check-luks.sh` defaults to `/dev/nvme0n1p2`. For old virtio-disk images use `--disk /dev/vda2`. | 108 | - `check-luks.sh` defaults to `/dev/nvme0n1p2`. For old virtio-disk images use `--disk /dev/vda2`. | ||
| 109 | + | - `arch-test.qcow2` must exist before launching any VM (run `./create-vm-img.sh` first). The ISO launcher also requires it as the install target disk. | |||
| 110 | + | - Desktop and laptop profiles use different MAC addresses (`52:54:00:12:34:01` / `:02`) so both VMs can run concurrently on the same host. | |||
M test/vm/lib/qemu-profile.sh +6 -1
| @@ -81,8 +81,13 @@ build_qemu_args() { | |||
| 81 | 81 | QEMU_ARGS+=(-device "nvme,drive=nvme0,serial=${nvme_serial}") | |
| 82 | 82 | ||
| 83 | 83 | # ── Network ────────────────────────────────────────────────────────────────── | |
| 84 | + | local nic_mac | |
| 85 | + | case "$profile" in | |
| 86 | + | desktop) nic_mac="52:54:00:12:34:01" ;; | |
| 87 | + | laptop) nic_mac="52:54:00:12:34:02" ;; | |
| 88 | + | esac | |
| 84 | 89 | QEMU_ARGS+=(-netdev "user,id=net0,hostfwd=tcp::${ssh_port}-:22") | |
| 85 | - | QEMU_ARGS+=(-device "e1000e,netdev=net0,mac=52:54:00:12:34:56") | |
| 90 | + | QEMU_ARGS+=(-device "e1000e,netdev=net0,mac=${nic_mac}") | |
| 86 | 91 | ||
| 87 | 92 | # ── USB Controller + Input ─────────────────────────────────────────────────── | |
| 88 | 93 | QEMU_ARGS+=(-device qemu-xhci) | |
| @@ -81,8 +81,13 @@ build_qemu_args() { | |||||
| 81 | QEMU_ARGS+=(-device "nvme,drive=nvme0,serial=${nvme_serial}") | 81 | QEMU_ARGS+=(-device "nvme,drive=nvme0,serial=${nvme_serial}") | ||
| 82 | 82 | ||||
| 83 | # ── Network ────────────────────────────────────────────────────────────────── | 83 | # ── Network ────────────────────────────────────────────────────────────────── | ||
| 84 | + | local nic_mac | |||
| 85 | + | case "$profile" in | |||
| 86 | + | desktop) nic_mac="52:54:00:12:34:01" ;; | |||
| 87 | + | laptop) nic_mac="52:54:00:12:34:02" ;; | |||
| 88 | + | esac | |||
| 84 | QEMU_ARGS+=(-netdev "user,id=net0,hostfwd=tcp::${ssh_port}-:22") | 89 | QEMU_ARGS+=(-netdev "user,id=net0,hostfwd=tcp::${ssh_port}-:22") | ||
| 85 | - | QEMU_ARGS+=(-device "e1000e,netdev=net0,mac=52:54:00:12:34:56") | 90 | + | QEMU_ARGS+=(-device "e1000e,netdev=net0,mac=${nic_mac}") |
| 86 | 91 | ||||
| 87 | # ── USB Controller + Input ─────────────────────────────────────────────────── | 92 | # ── USB Controller + Input ─────────────────────────────────────────────────── | ||
| 88 | QEMU_ARGS+=(-device qemu-xhci) | 93 | QEMU_ARGS+=(-device qemu-xhci) | ||