Skip to content

Instantly share code, notes, and snippets.

@julian-klode
Created March 20, 2020 09:50
Show Gist options
  • Save julian-klode/a53e64dbee7c8787bba3560846a3001b to your computer and use it in GitHub Desktop.
Save julian-klode/a53e64dbee7c8787bba3560846a3001b to your computer and use it in GitHub Desktop.
#!/bin/bash
[ -e $XDG_RUNTIME_DIR/OVMF_VARS.fd ] || cp /usr/share/OVMF/OVMF_VARS.ms.fd $XDG_RUNTIME_DIR/OVMF_VARS.fd
kvm -smp 2 \
-m 4096 \
-cpu host \
-M q35 \
-drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$XDG_RUNTIME_DIR/OVMF_VARS.fd \
-object rng-random,filename=/dev/urandom,id=rng0 \
-device virtio-rng-pci,rng=rng0,id=rng-device0 \
-device virtio-scsi-pci,id=scsi \
-device scsi-hd,drive=hd \
-drive if=none,id=hd,file=$hd,format=raw \
-vga virtio -display gtk,gl=on \
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment