summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-07-21 14:19:26 +0200
committerxengineering <me@xengineering.eu>2024-07-21 14:19:26 +0200
commit2e59b2390e27df6f5be576db8a56e2f14f269bcc (patch)
tree0b46a9f909fdfbbd390792bc82baacb3d5d5143b /README.md
parentf90cd583331d4637eecec76b464298aee5f15270 (diff)
downloadcraft-2e59b2390e27df6f5be576db8a56e2f14f269bcc.tar
craft-2e59b2390e27df6f5be576db8a56e2f14f269bcc.tar.zst
craft-2e59b2390e27df6f5be576db8a56e2f14f269bcc.zip
Document how to run the VM for builds
This includes: - read-only / snapshot mode - port forwarding guest 22 to host 9999 - internet access - no visual display, serial only
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.md b/README.md
index 9b11592..683169a 100644
--- a/README.md
+++ b/README.md
@@ -106,3 +106,27 @@ sed -i 's|root=/dev/sda3 rw|root=/dev/vda2 rw console=ttyS0|g' /boot/syslinux/sy
exit
poweroff
```
+
+## Start Arch Linux virtual machine for automated builds
+
+The following command starts the Arch Linux QEMU virtual machine in a read-only
+mode (`snapshot=on`) to prevent altering the original image file.
+
+Furthermore the local port 22 of the VM is forwarded to the localhost port 9999
+of the host. Thus clients on the host can use SSH to connect to the VM.
+
+Again no graphical display is used and only output of the serial console is
+shown in the terminal. Since the `console=ttyS0` kernel parameter was set in
+the bootloader configuration of the VM, no manual editing of kernel parameters
+during runtime is needed (in contrast to the current Arch Linux installation
+image).
+
+```
+qemu-system-x86_64 \
+ -enable-kvm \
+ -m 4G \
+ -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:9999-:22 \
+ -drive file=vms/archlinux.qcow2,media=disk,snapshot=on,if=virtio \
+ -smp cpus=4 \
+ -nographic
+```