Tweak qemu parameters

This commit is contained in:
Daniel Lundin 2024-11-10 14:19:29 +01:00
parent 01730a5957
commit 38fdbbb048
Signed by: dln
SSH key fingerprint: SHA256:dQy1Xj3UiqJYpKR5ggQ2bxgz4jCH8IF+k3AB8o0kmdI

View file

@ -98,14 +98,25 @@
runtimeInputs = [ pkgs.qemu_kvm ];
# -snapshot \
text = ''
set -ex
state="/tmp/qemu-$USER"
mkdir -p "$state"
chmod 700 "$state"
qemu-system-x86_64 \
-smp 4 -m 4096 -machine q35,accel=kvm \
-bios ${pkgs.OVMF.fd}/FV/OVMF.fd \
-cpu host \
-machine q35,accel=kvm \
-m 4G \
-smp 8 \
-display none \
-serial stdio "$@"
-chardev "stdio,id=char0,mux=on,logfile=$state/serial.log,signal=off" \
-serial chardev:char0 \
-mon chardev=char0 \
-drive "if=pflash,format=raw,unit=0,readonly=on,file=${pkgs.OVMF.firmware}" \
-drive "if=pflash,format=raw,unit=1,readonly=on,file=${pkgs.OVMF.variables}" \
-netdev id=net00,type=user,hostfwd=tcp::2222-:22 \
-device virtio-net-pci,netdev=net00 \
"$@"
'';
};
};