Skip to content

Instantly share code, notes, and snippets.

@cccheng
Last active August 28, 2023 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cccheng/e44b0961cc9bf6c53f8ed0bf9b670ea8 to your computer and use it in GitHub Desktop.
Save cccheng/e44b0961cc9bf6c53f8ed0bf9b670ea8 to your computer and use it in GitHub Desktop.
qemu-system-x86_64
qemu-system-x86_64 \
-nographic -enable-kvm -m size=4G \
-cpu host -smp cpus=4,sockets=1,dies=1,cores=4,threads=1 \
-machine type=q35,usb=off,dump-guest-core=off,hpet=off,accel=kvm \
-device virtio-net,netdev=vmnic -netdev bridge,br=virbr0,id=vmnic \
-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4 \
-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c \
-object rng-random,id=objrng0,filename=/dev/urandom \
-append "console=ttyS0 root=/dev/vda earlyprintk=serial net.ifnames=0" \
-kernel "$img_kernel" \
-drive if=virtio,format=raw,aio=io_uring,cache=writeback,discard=on,detect-zeroes=on,file="$img_disk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment