Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEMU command line #11

Open
dav1app opened this issue Aug 5, 2020 · 0 comments
Open

QEMU command line #11

dav1app opened this issue Aug 5, 2020 · 0 comments

Comments

@dav1app
Copy link

dav1app commented Aug 5, 2020

In case anyone is wondering what is the command line executed from the libvirt inside qemu-system-x86_64, this might help:

Those lines were exported by virsh domxml-to-native qemu-argv libvirt.xml

qemu-system-x86_64 
-name guest=Catalina,debug-threads=on -object secret,id=masterKey0,format=raw,file=$HOME/.config/libvirt/qemu/lib/domain--1-Catalina/master-key.aes 
-blockdev '{"driver":"file","filename":"/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' 
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' 
-blockdev '{"driver":"file","filename":"/etc/libvirt/qemu/nvram/4450a55c-1669-da0e-d0bd-3ab45fef0398_VARS-pure-efi.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' 
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' 
-machine pc-q35-4.2,accel=kvm,usb=off,dump-guest-core=off,mem-merge=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format 
-m 8192 
-overcommit mem-lock=off 
-smp 1,maxcpus=8,sockets=8,cores=1,threads=1 
-object iothread,id=iothread1 
-uuid 4450a55c-1669-da0e-d0bd-3ab45fef0398 
-display none 
-no-user-config 
-nodefaults 
-chardev socket,id=charmonitor,path=$HOME/.config/libvirt/qemu/lib/domain--1-Catalina/monitor.sock,server,nowait 
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew 
-global kvm-pit.lost_tick_policy=delay 
-no-hpet 
-no-shutdown 
-boot strict=on 
-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1 
-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 
-device pcie-root-port,port=0xa,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 
-device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 
-device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 
-device pcie-root-port,port=0xd,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 
-device pcie-root-port,port=0xe,chassis=7,id=pci.7,bus=pcie.0,addr=0x1.0x6 
-device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x7.0x7 
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,addr=0x7 
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x7.0x1 
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x7.0x2 
-device virtio-serial-pci,id=virtio-serial0,bus=pci.2,addr=0x0 
-blockdev '{"driver":"file","filename":"/mnt/user/domains/Catalina/opencore.beta.qcow2","aio":"threads","node-name":"libvirt-2-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' 
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage","backing":null}' 
-device ide-hd,bus=ide.4,drive=libvirt-2-format,id=sata0-0-4,bootindex=1,write-cache=on -blockdev '{"driver":"file","filename":"/mnt/user/domains/Catalina/system.beta.qcow2","aio":"threads","node-name":"libvirt-1-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' 
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage","backing":null}' 
-device ide-hd,bus=ide.0,drive=libvirt-1-format,id=sata0-0-0,write-cache=on -chardev pty,id=charserial0 
-device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,path=$HOME/.config/libvirt/qemu/channel/target/domain--1-Catalina/org.qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 
-device usb-tablet,id=input0,bus=usb.0,port=1 
-device usb-kbd,id=input2,bus=usb.0,port=3 
-cpu Penryn,vendor=GenuineIntel,+hypervisor,+invtsc,kvm=on,+fma,+avx,+avx2,+aes,+ssse3,+sse4_2,+popcnt,+sse4a,+bmi1,+bmi2 
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny 
-msg timestamp=on

I've just changed 4 things:

  • Removed the internet passtrough below. Somehow, transforming a XML to qemu-args tries to execute the command as well. So trying to run it without sudo retrieves error: Unable to create tap device vnet%d: Operation not permitted
    <interface type='bridge'>
      <mac address='52:54:00:3e:21:a2'/>
      <source bridge='br0.100'/>
      <model type='e1000-82545em'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </interface>
  • Remove the CPU topology . It was giving me error: unsupported configuration: CPU topology doesn't match maximum vcpu count.
  <vcpu placement='static' current='6'>8</vcpu>
  <iothreads>1</iothreads>
  <vcpus>
    <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
    <vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/>
    <vcpu id='2' enabled='yes' hotpluggable='yes' order='3'/>
    <vcpu id='3' enabled='yes' hotpluggable='yes' order='4'/>
    <vcpu id='4' enabled='yes' hotpluggable='yes' order='5'/>
    <vcpu id='5' enabled='yes' hotpluggable='yes' order='6'/>
    <!-- If you wanna passthrough all 8-cores, enable 6/7 two vcpus -->
    <vcpu id='6' enabled='no' hotpluggable='yes' order='7'/>
    <vcpu id='7' enabled='no' hotpluggable='yes' order='8'/>
  </vcpus>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='6'/>
    <vcpupin vcpu='2' cpuset='1'/>
    <vcpupin vcpu='3' cpuset='7'/>
    <vcpupin vcpu='4' cpuset='2'/>
    <vcpupin vcpu='5' cpuset='8'/>
    <iothreadpin iothread='1' cpuset='3,9'/>
  </cputune>
  • Removed the direct path to the emulator (since I can assume that the user is going to execute this on the right qemu-system-x86_64.
<emulator>/usr/local/sbin/qemu</emulator>
  • Changed my path that was exported with the command to $HOME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant