Create an Artix VM with QEMUs
Create Artix VM with QEMU
Sources:
- QEMU Archwiki
- Virtual machines from the command line with QEMU
- Real full disk encryption using GRUB on Artix Linux for BIOS and UEFI
Prepare disk image and start installation
Create the hard disk image with the following command:
$ qemu-img create -f qcow2 rtx.qcow 8G
Boot the installation image (CD-ROM) with disk for system installation:
$ qemu-system-x86_64 -m 4G -enable-kvm \
-cdrom artix-base-runit-20220713-x86_64.iso \
-drive file=rtx.qcow,format=qcow2 \
-boot order=d
Open the VNCviewer in another console window:
$ vncviewer localhost
And continue the installation as any other over bare metal.
Run the VM
Run the virtual machine with the following command:
$ qemu-system-x86_64 -m 4G -smp 2 -enable-kvm \
> -nic user,hostfwd=tcp::60022-:22 \
> rtx.qcow
If you want to hide the graphical display:
$ qemu-system-x86_64 -m 4G -smp 2 -enable-kvm \
> -display none \
> -nic user,hostfwd=tcp::60022-:22 \
> rtx.qcow
where:
- -display none : hides the graphical display
- -smp 2 : tell qemu to use 2 cpu’s
- -nic user,… : makes port 60022 on the host point to port 22 (ssh) on the guest. This allows to ssh on the machine with ssh localhost -p 60022, is sshd is running on the guest.
Conclusion
Enjoy motherfucker! :D