Tweak qemu parameters
This commit is contained in:
parent
01730a5957
commit
38fdbbb048
1 changed files with 15 additions and 4 deletions
19
flake.nix
19
flake.nix
|
@ -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 \
|
||||
"$@"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue