#! /bin/sh #qemu=/usr/bin/qemu-system-x86_64 #qemu=/home/yurib/src/qemu/build/qemu-system-x86_64 #qemu=qemu-kvm #qemu=/home/yurib/src/qemu/temp/build/qemu-system-x86_64 qemu=/home/yurib/src/qemu/upstream/build/qemu-system-x86_64 image=/images/vms/win2019-64-virtio-scsi.qcow2 #image=/images/vms/win2022-64-virtio-scsi.qcow2 #image=/images/vms/none.qcow2 #iso1=/media/shared/public/OS/en_windows_server_2019_updated_may_2020_x64_dvd_5651846f.iso #iso1=/media/shared/public/OS/Ubuntu/ubuntu-21.04-desktop-amd64.iso iso1=/images/iso/virtio-win/virtio-win-prewhql-0.1-210.iso #enlight=,hv-vendor-id=KVMKVMKVM,hv_stimer,hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_frequencies,hv_runtime,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,hv_ipi,+kvm_pv_unhalt #enlight=,hv_stimer,hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_frequencies,hv_runtime,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,hv_ipi,+kvm_pv_unhalt #enlight=,+kvm_pv_unhalt,hv_spinlocks=0x1fff,hv_relaxed,hv_vapic,hv_time #enlight=,+kvm_pv_unhalt,hv_time,hv_vapic,hv_tlbflush,hv_vpindex,hv_spinlocks=0x1fff,hv_ipi,hv_stimer,hv_synic #cpu_model='Skylake-Client-noTSX-IBRS' cpu_model=host #cpu_model='Cascadelake-Server-noTSX' #cpu_model=qemu64,+x2apic,+fsgsbase,model=13 enlight=,hv-vendor-id=KVMKVMKVM,hv_stimer,hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_frequencies,hv_runtime,hv_stimer_direct,+kvm_pv_unhalt #cpu_model=SandyBridge queues=1 vhost=off dbgnet="-netdev tap,id=e1000,script=/home/yurib/br0-ifup,ifname=w19_d -device e1000e,netdev=e1000,bus=pcie_extra0,addr=0x0,mac=9a:f1:19:01:00:01" sandbox=off iommu=off if [ $iommu == on ]; then iommucmd="-device intel-iommu" else iommucmd= fi diskmodel=scsi-hd #diskmodel=ide-hd netadapter=virtio-net-pci,mq=off,vectors=10,rss=off,iommu_platform=$iommu,ats=$iommu #netadapter=virtio-net-pci,mq=off,vectors=10,mrg_rxbuf=off,indirect_desc=off,iommu_platform=$iommuflag,ats=$iommuflag sudo $qemu -S \ -name $image \ -sandbox $sandbox \ -machine q35,memory-backend=mem-machine_mem,accel=kvm,vmport=off,smm=on,hpet=off,kernel-irqchip=split \ -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \ -device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0 \ -nodefaults \ -device VGA,bus=pcie.0,addr=0x2 \ -m 8192 \ -object memory-backend-ram,size=8192M,id=mem-machine_mem \ -smp 4,maxcpus=4,cores=2,threads=1,dies=1,sockets=2 \ -cpu $cpu_model$enlight \ -monitor stdio \ -device pvpanic,ioport=0x505,id=idrn1RhZ \ -device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \ -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \ -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \ -device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,chassis=3 \ -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-2,addr=0x0,iommu_platform=$iommu,ats=$iommu \ -blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=$image,cache.direct=on,cache.no-flush=off \ -blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \ -device $diskmodel,id=image1,drive=drive_image1,write-cache=on,serial=SYSTEM_DISK0 \ -device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,chassis=4 \ -device $netadapter,id=vionet,netdev=viotap,bus=pcie-root-port-3,addr=0x0,mac=9a:f1:19:00:00:01 \ -netdev tap,id=viotap,script=/home/yurib/virbr0-ifup,ifname=w19_1,queues=$queues,vhost=$vhost \ -vnc :1 \ -rtc base=localtime,clock=host,driftfix=slew \ -boot menu=off,order=cdn,strict=off \ -device pcie-root-port,id=pcie_extra0,multifunction=on,bus=pcie.0,addr=0x3,chassis=5 \ -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pcie_extra0,addr=0x2,iommu_platform=$iommu,ats=$iommu -chardev spicevmc,name=vdagent,id=vdagent \ -device virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0 \ $dbgnet $iommucmd #-blockdev node-name=file_cd1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=$iso1,cache.direct=on,cache.no-flush=off \ #-blockdev node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_cd1 \ #-device ide-cd,id=cd1,drive=drive_cd1,write-cache=on,bus=ide.0,unit=0 \