Skip to content

Instantly share code, notes, and snippets.

@noushi

noushi/vm.sh

Forked from julian-klode/vm.sh
Created Apr 27, 2020
Embed
What would you like to do?
#!/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