How do I translate between qemu-system arguments and virt-install arguments so I can unify partially working commands?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am in the process of setting up VFIO with KVM. I have the VFIO itself working, in that the VFIO'd GPU displays the UEFI shell screen when I start the VM. I am also able to create a working Windows VM with VNC for graphics. My problem is that I create the VM with passthrough using qemu-system, and the one that fully boots I create using virt-install.



What I would like to do is use virt-install, but with the same PCI device as I passthrough with qemu-create, so I need to figure out how to translate the qemu-system argument to virt-install options (or virsh edit xml)



-device vfio-pci,host=42:00.0,multifunction=on 
-device vfio-pci,host=42:00.1


into virt-install arguments. However, the instructions I using for virt-install do not use the PCI ID, but rather domain, bus and slot, which are not shown in lspci and I am not sure how to check.
So either I need to get that info and use it in a virt-install command, or find a way to use the PCI ID with virt-install.



Here are my two commands:



qemu system:



sudo qemu-system-x86_64 
-name $vmname,process=$vmname
-machine type=q35,accel=kvm
-cpu EPYC,kvm=off
-smp 4,sockets=1,cores=2,threads=2
-m 16G
-balloon none
-rtc clock=host,base=localtime
-vga none
-nographic
-serial none
-parallel none
-device vfio-pci,host=42:00.0,multifunction=on
-device vfio-pci,host=42:00.1
-drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd
-drive if=pflash,format=raw,file=/usr/share/OVMF/OVMF_VARS.fd
-boot order=dc
#-drive id=disk0,if=virtio,cache=none,format=raw,file=/dev/nvme-tank/ntfs-zvol-part1
-drive file=/media/big-tank-8TB/OSISOS/Windows/WindowsOct2018.iso,index=1,media=cdrom
-drive file=/media/big-tank-8TB/OSISOS/Windows/virtio-win-0.1.160.iso,index=2,media=cdrom


virt-install



virt-install 
--name myWINVM1
--ram 4096
--disk path=/dev/nvme-tank/ntfs-zvol-part1
--cpu core2duo
--vcpus 4
--os-type windows
--os-variant win10
--network bridge=virbr0
--graphics vnc
--console pty,target_type=serial
--disk /media/big-tank-8TB/OSISOS/Windows/WindowsOct2018.iso,device=cdrom,bus=ide
--disk /media/big-tank-8TB/OSISOS/Windows/virtio-win-0.1.160.iso,device=cdrom,bus=ide


It would also be OK to figure out how to make the qemu-system boot properly, but I like virt-install better because it makes a handy XML file that I can look at later.









share

























    up vote
    0
    down vote

    favorite












    I am in the process of setting up VFIO with KVM. I have the VFIO itself working, in that the VFIO'd GPU displays the UEFI shell screen when I start the VM. I am also able to create a working Windows VM with VNC for graphics. My problem is that I create the VM with passthrough using qemu-system, and the one that fully boots I create using virt-install.



    What I would like to do is use virt-install, but with the same PCI device as I passthrough with qemu-create, so I need to figure out how to translate the qemu-system argument to virt-install options (or virsh edit xml)



    -device vfio-pci,host=42:00.0,multifunction=on 
    -device vfio-pci,host=42:00.1


    into virt-install arguments. However, the instructions I using for virt-install do not use the PCI ID, but rather domain, bus and slot, which are not shown in lspci and I am not sure how to check.
    So either I need to get that info and use it in a virt-install command, or find a way to use the PCI ID with virt-install.



    Here are my two commands:



    qemu system:



    sudo qemu-system-x86_64 
    -name $vmname,process=$vmname
    -machine type=q35,accel=kvm
    -cpu EPYC,kvm=off
    -smp 4,sockets=1,cores=2,threads=2
    -m 16G
    -balloon none
    -rtc clock=host,base=localtime
    -vga none
    -nographic
    -serial none
    -parallel none
    -device vfio-pci,host=42:00.0,multifunction=on
    -device vfio-pci,host=42:00.1
    -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd
    -drive if=pflash,format=raw,file=/usr/share/OVMF/OVMF_VARS.fd
    -boot order=dc
    #-drive id=disk0,if=virtio,cache=none,format=raw,file=/dev/nvme-tank/ntfs-zvol-part1
    -drive file=/media/big-tank-8TB/OSISOS/Windows/WindowsOct2018.iso,index=1,media=cdrom
    -drive file=/media/big-tank-8TB/OSISOS/Windows/virtio-win-0.1.160.iso,index=2,media=cdrom


    virt-install



    virt-install 
    --name myWINVM1
    --ram 4096
    --disk path=/dev/nvme-tank/ntfs-zvol-part1
    --cpu core2duo
    --vcpus 4
    --os-type windows
    --os-variant win10
    --network bridge=virbr0
    --graphics vnc
    --console pty,target_type=serial
    --disk /media/big-tank-8TB/OSISOS/Windows/WindowsOct2018.iso,device=cdrom,bus=ide
    --disk /media/big-tank-8TB/OSISOS/Windows/virtio-win-0.1.160.iso,device=cdrom,bus=ide


    It would also be OK to figure out how to make the qemu-system boot properly, but I like virt-install better because it makes a handy XML file that I can look at later.









    share























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am in the process of setting up VFIO with KVM. I have the VFIO itself working, in that the VFIO'd GPU displays the UEFI shell screen when I start the VM. I am also able to create a working Windows VM with VNC for graphics. My problem is that I create the VM with passthrough using qemu-system, and the one that fully boots I create using virt-install.



      What I would like to do is use virt-install, but with the same PCI device as I passthrough with qemu-create, so I need to figure out how to translate the qemu-system argument to virt-install options (or virsh edit xml)



      -device vfio-pci,host=42:00.0,multifunction=on 
      -device vfio-pci,host=42:00.1


      into virt-install arguments. However, the instructions I using for virt-install do not use the PCI ID, but rather domain, bus and slot, which are not shown in lspci and I am not sure how to check.
      So either I need to get that info and use it in a virt-install command, or find a way to use the PCI ID with virt-install.



      Here are my two commands:



      qemu system:



      sudo qemu-system-x86_64 
      -name $vmname,process=$vmname
      -machine type=q35,accel=kvm
      -cpu EPYC,kvm=off
      -smp 4,sockets=1,cores=2,threads=2
      -m 16G
      -balloon none
      -rtc clock=host,base=localtime
      -vga none
      -nographic
      -serial none
      -parallel none
      -device vfio-pci,host=42:00.0,multifunction=on
      -device vfio-pci,host=42:00.1
      -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd
      -drive if=pflash,format=raw,file=/usr/share/OVMF/OVMF_VARS.fd
      -boot order=dc
      #-drive id=disk0,if=virtio,cache=none,format=raw,file=/dev/nvme-tank/ntfs-zvol-part1
      -drive file=/media/big-tank-8TB/OSISOS/Windows/WindowsOct2018.iso,index=1,media=cdrom
      -drive file=/media/big-tank-8TB/OSISOS/Windows/virtio-win-0.1.160.iso,index=2,media=cdrom


      virt-install



      virt-install 
      --name myWINVM1
      --ram 4096
      --disk path=/dev/nvme-tank/ntfs-zvol-part1
      --cpu core2duo
      --vcpus 4
      --os-type windows
      --os-variant win10
      --network bridge=virbr0
      --graphics vnc
      --console pty,target_type=serial
      --disk /media/big-tank-8TB/OSISOS/Windows/WindowsOct2018.iso,device=cdrom,bus=ide
      --disk /media/big-tank-8TB/OSISOS/Windows/virtio-win-0.1.160.iso,device=cdrom,bus=ide


      It would also be OK to figure out how to make the qemu-system boot properly, but I like virt-install better because it makes a handy XML file that I can look at later.









      share













      I am in the process of setting up VFIO with KVM. I have the VFIO itself working, in that the VFIO'd GPU displays the UEFI shell screen when I start the VM. I am also able to create a working Windows VM with VNC for graphics. My problem is that I create the VM with passthrough using qemu-system, and the one that fully boots I create using virt-install.



      What I would like to do is use virt-install, but with the same PCI device as I passthrough with qemu-create, so I need to figure out how to translate the qemu-system argument to virt-install options (or virsh edit xml)



      -device vfio-pci,host=42:00.0,multifunction=on 
      -device vfio-pci,host=42:00.1


      into virt-install arguments. However, the instructions I using for virt-install do not use the PCI ID, but rather domain, bus and slot, which are not shown in lspci and I am not sure how to check.
      So either I need to get that info and use it in a virt-install command, or find a way to use the PCI ID with virt-install.



      Here are my two commands:



      qemu system:



      sudo qemu-system-x86_64 
      -name $vmname,process=$vmname
      -machine type=q35,accel=kvm
      -cpu EPYC,kvm=off
      -smp 4,sockets=1,cores=2,threads=2
      -m 16G
      -balloon none
      -rtc clock=host,base=localtime
      -vga none
      -nographic
      -serial none
      -parallel none
      -device vfio-pci,host=42:00.0,multifunction=on
      -device vfio-pci,host=42:00.1
      -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd
      -drive if=pflash,format=raw,file=/usr/share/OVMF/OVMF_VARS.fd
      -boot order=dc
      #-drive id=disk0,if=virtio,cache=none,format=raw,file=/dev/nvme-tank/ntfs-zvol-part1
      -drive file=/media/big-tank-8TB/OSISOS/Windows/WindowsOct2018.iso,index=1,media=cdrom
      -drive file=/media/big-tank-8TB/OSISOS/Windows/virtio-win-0.1.160.iso,index=2,media=cdrom


      virt-install



      virt-install 
      --name myWINVM1
      --ram 4096
      --disk path=/dev/nvme-tank/ntfs-zvol-part1
      --cpu core2duo
      --vcpus 4
      --os-type windows
      --os-variant win10
      --network bridge=virbr0
      --graphics vnc
      --console pty,target_type=serial
      --disk /media/big-tank-8TB/OSISOS/Windows/WindowsOct2018.iso,device=cdrom,bus=ide
      --disk /media/big-tank-8TB/OSISOS/Windows/virtio-win-0.1.160.iso,device=cdrom,bus=ide


      It would also be OK to figure out how to make the qemu-system boot properly, but I like virt-install better because it makes a handy XML file that I can look at later.







      kvm qemu pci pci-passthrough iommu





      share












      share










      share



      share










      asked 5 mins ago









      Thoughtcraft

      1085




      1085

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477847%2fhow-do-i-translate-between-qemu-system-arguments-and-virt-install-arguments-so-i%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477847%2fhow-do-i-translate-between-qemu-system-arguments-and-virt-install-arguments-so-i%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?