cdrom install version
grabbed the latest arch linux iso and saved it as arch.iso
created a new qcow2 image: qemu-img create -f qcow2 drive0.qcow2 20G
used the start script (dont forget to chmod +x startscript
#!/bin/bash
vmname="a_test"
macaddr="aa:aa:aa:aa:00:01"
qemu-system-x86_64 \
-name $vmname,process=$vmname \
-enable-kvm \
-machine type=q35,accel=kvm,kernel_irqchip=on,hpet=off \
-cpu host,kvm=off,hv_vendor_id=nullzilla,hv_relaxed,hv_vpindex,hv_time,hv_synic,hv_stimer,hv_spinlocks=0x1fff \
-smp 2,sockets=1,cores=1,threads=2 \
-m 4G -mem-prealloc \
-usb -device usb-tablet \
-vga qxl \
-vnc :1 \
-nographic \
-drive format=qcow2,file=drive0.qcow2,if=virtio \
-drive file=arch.iso,index=2,media=cdrom \
-net nic,macaddr=$macaddr -net bridge,br=br_qemus \
-boot menu=on
It immediately loads into selection screen.
cli looks like:
vnc looks like:
After the selection screen the cli terminal stops working (as expected)
After the selection screen the vnc client needed to reconnect.
It ran archinstall
I haven't used archinstall before (it's relatively a new thing). But I think this is as far as you were looking.
side note:
-I usually use a lot more options (don't forget vnc in this example is not protected)
-I use spice in a lot of my machines. especially gui. audio, usb passthrough from client, etc...
-I like using remmina as the client. It supports spice, rdp, vnc, etc... nicely.
-I found it annoying to use \ in the start scripts a LOOONG time ago as its extra steps to add/remove lines. Doing it this way you can just comment out what you don't want and add/remove as you wish
I do it like:
#!/bin/bash
vmname="a_test"
macaddr="aa:aa:aa:aa:00:01"
port_vnc=1
OPTS=""
OPTS="$OPTS -name $vmname,process=$vmname"
OPTS="$OPTS -enable-kvm"
OPTS="$OPTS -machine type=q35,accel=kvm,kernel_irqchip=on,hpet=off"
OPTS="$OPTS -cpu host,kvm=off,hv_vendor_id=nullzilla,hv_relaxed,hv_vpindex,hv_time,hv_synic,hv_stimer,hv_spinlocks=0x1fff"
OPTS="$OPTS -smp 2,sockets=1,cores=1,threads=2"
OPTS="$OPTS -m 4G -mem-prealloc"
OPTS="$OPTS -usb -device usb-tablet"
OPTS="$OPTS -vga qxl"
OPTS="$OPTS -vnc :$port_vnc"
OPTS="$OPTS -nographic"
OPTS="$OPTS -drive format=qcow2,file=drive0.qcow2,if=virtio"
OPTS="$OPTS -drive file=arch.iso,index=2,media=cdrom"
OPTS="$OPTS -net nic,macaddr=$macaddr -net bridge,br=br_qemus"
OPTS="$OPTS -boot menu=on"
echo qemu-system-x86_64 $OPTS
echo ========================
echo
qemu-system-x86_64 $OPTS