Created
May 16, 2023 15:30
-
-
Save gottaeat/6bda51f4b2d883f9c782712c79bccacb to your computer and use it in GitHub Desktop.
final qemu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
q_name="arch linux baremetal test vm" | |
q_proc="archQEMUbare" | |
q_cpuarg="host,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff," | |
q_cpuarg="${q_cpuarg}hv-time,hv_vapic,hv_vendor_id=0xDEADBEEFFF" | |
q_cpucfg="sockets=1,cores=2,threads=2" | |
q_memcfg="size=8G,slots=0,maxmem=8G" | |
q_efifw="./fw/arch-edk2-x86_64-code.fd" | |
q_efi="-drive if=pflash,format=raw,file=${q_efifw}" | |
q_disk="./disks/arch.qcow2" | |
q_drive="-drive file=${q_disk},format=qcow2,index=0,media=disk,if=virtio" | |
q_iso="../iso/archlinux-2023.05.03-x86_64.iso" | |
q_cdrom="-drive file=${q_iso},index=2,media=cdrom" | |
q_mac="00:60:2F:8A:4A:0A" | |
q_ether="-netdev tap,ifname=tap0,script=no,downscript=no,id=mynet0" | |
q_ether="${q_ether} -device virtio-net-pci,netdev=mynet0,mac=${q_mac}" | |
q_video="-device virtio-vga-gl -display gtk,show-cursor=on,gl=on" | |
# q_video="-device VGA,vgamem_mb=128 -display gtk,show-cursor=on,gl=off" | |
q_pulse="/var/run/pulse/native" | |
q_audio="-audiodev pa,id=snd0,server=unix:${q_pulse}" | |
q_audio="${q_audio} -device ich9-intel-hda" | |
q_audio="${q_audio} -device hda-output,audiodev=snd0" | |
q_audio="${q_audio} -global ICH9-LPC.disable_s3=1" | |
qemu-system-x86_64 -enable-kvm \ | |
-name "${q_name}",process="${q_proc}" \ | |
-k en-us \ | |
\ | |
-cpu "${q_cpuarg}" \ | |
-smp "${q_cpucfg}" \ | |
-m "${q_memcfg}" \ | |
-machine type=q35,accel=kvm,usb=on \ | |
-rtc clock=host,base=localtime \ | |
-boot menu=on,reboot-timeout=5000 \ | |
\ | |
-monitor vc \ | |
-serial none \ | |
-parallel none \ | |
\ | |
-device qemu-xhci \ | |
-device virtio-keyboard-pci \ | |
-device virtio-mouse-pci \ | |
-device virtio-rng-pci \ | |
-device virtio-serial-pci \ | |
-device virtio-tablet-pci \ | |
\ | |
${q_efi} \ | |
${q_drive} \ | |
${q_cdrom} \ | |
${q_ether} \ | |
${q_video} \ | |
${q_audio} \ | |
\ | |
"${@}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment