#!/usr/bin/env bash # connect with: # spicy -h 127.0.0.1 -p 5930 & disown spicy; # spice-gtk qemu-system-x86_64 \ -enable-kvm `# enable KVM optimiations` \ -L `guix build ovmf`/share/firmware/ `# dir with bios.bin` \ --bios ovmf_x64.bin `# bios.bin itself` \ -m 6G `# provide reasonable amount of ram` \ -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time `# match the CPU type exactly` \ -machine type=pc,accel=kvm \ -smp $(nproc) \ -virtfs local,path=$HOME/Public,mount_tag=Public,security_model=none \ -usb \ -daemonize `# don't start monitor, we connect using RDP` \ -vga qxl \ -spice port=5930,disable-ticketing=on \ -device virtio-serial \ -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \ -chardev spicevmc,id=spicechannel0,name=vdagent \ -drive file=/dev/nvme0n1,format=raw,media=disk `# load raw HDD`