Need Help on Setting Up Hardware Passthrough on Ubuntu 3930K

Not currently on my Arch machine. I'm out of town at the moment.

Let me see if I can get antergos installed in a VM or something so I can build the package and send you the binaries.

1 Like

@SgtAwesomesauce how about now :smiley:

Just got back today. Quality trip. I'll get on that as soon as I finish a couple things around the house

1 Like

@SgtAwesomesauce Just got back from the hospital. broke my leg. guess that's more time for hardwarepassthrough and guitar then x)

Oh wow. That's why I recommend against leaving the house. :smiley:

EDIT: I'm compiling the binaries right now. Don't really have an ETA, but should have them by the end of the day.

1 Like

Uploaded,

https://mega.nz/#F!RSxWSTaa!OtBw0cV40-cqnbhzPzBw9A

Hope this helps.

1 Like

it does! and yeah, in the end, nothing's safer to do in life than linux xD

1 Like

Until the thought police come and kick in your door for blaspheming against the church of Microsoft.

1 Like

exactly!

1 Like

I ran across this thread, albeit a little late.

About the 3930K: It supports IOMMU since stepping 2, that is since around March 2012. I've been doing VGA passthrough on this platform since August 2012, first using Xen, now KVM.

It has excellent ACS separation, unlike the consumer-level CPUs.

I've been doing VGA passthrough on Linux Mint, an Ubuntu derivative. I'm now on Linux Mint 18.2 which is based on Ubuntu 16.04. I really see no reason to switch to anything else.

Here is my how-to: HOW-TO make dual-boot obsolete using kvm VGA passthrough. The latest version can be found here (I'm starting to host my own blog and hopefully forum on virtualization): https://heiko-sieger.info/running-windows-10-on-linux-using-kvm-with-vga-passthrough/.

Hope you managed to get it working. It's a stellar platform that I've been using for the past 5 years and I can't find a single reason to "upgrade". Good luck!

2 Likes

@powerhouse @SgtAwesomesauce

sorry for the looooooooooooooooooong hiatus. I had a lot of … to deal with with my leg.

I’m back at it now!

thanks sgtawesome for the binaries and thanks powerhouse for the uplifting words and the guide.
since I was halfway into sgtawesome’s guide i’ll get as far as I can there before switching to yours.

I’ve added the binaries in /usr/share/ovmf

and edited /etc/libvirt/qemu.conf
to include :
nvram = [
"/usr/share/ovmf/ovmf_x64.bin:/usr/share/ovmf/ovmf_vars_x64.bin"
]

the ouput of systemctl status libvirtd is better (green light) but still includes an error message

t@tsu:~$ systemctl status libvirtd
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-07-27 22:24:25 CEST; 13h ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 2660 (libvirtd)
    Tasks: 18
   CGroup: /system.slice/libvirtd.service
           ├─2660 /usr/sbin/libvirtd
           ├─3777 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
           └─3778 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper

juil. 27 22:24:28 tsu libvirtd[2660]: Failed to probe capabilities for /usr/bin/qemu-system-xtensaeb: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has n
juil. 27 22:24:30 tsu dnsmasq[3777]: started, version 2.76 cachesize 150
juil. 27 22:24:30 tsu dnsmasq[3777]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
juil. 27 22:24:30 tsu dnsmasq-dhcp[3777]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
juil. 27 22:24:30 tsu dnsmasq-dhcp[3777]: DHCP, sockets bound exclusively to interface virbr0
juil. 27 22:24:30 tsu dnsmasq[3777]: reading /etc/resolv.conf
juil. 27 22:24:30 tsu dnsmasq[3777]: using nameserver 127.0.0.53#53
juil. 27 22:24:30 tsu dnsmasq[3777]: read /etc/hosts - 7 addresses
juil. 27 22:24:30 tsu dnsmasq[3777]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
juil. 27 22:24:30 tsu dnsmasq-dhcp[3777]: read /var/lib/libvirt/dnsmasq/default.hostsfile
1 Like

Welcome back, I hope you’re healing up well.

The error line appears to be cut off, can you rerun the status command with the -l (lowercase L) flag? That will prevent systemd from truncating lines.

sounds like you may be missing a binary related to cpu capabilities.

This bit is particularly interesting: unable to execute QEMU command 'query-cpu-definitions'

Means libvirt is trying to access a feature of QEMU that’s not available for some reason.

Can you please verify that all your packages are up to date? (if not, go ahead and upgrade them)

This is a really poorly documented problem, but I’m seeing a few related redhat bugs, some of which have been patched. Let’s start with seeing the rest of the error line and upgrading packages.

1 Like
t@tsu:~$ systemctl status libvirtd -l
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2017-07-28 12:23:25 CEST; 7h ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 28193 (libvirtd)
    Tasks: 18
   CGroup: /system.slice/libvirtd.service
           ├─ 3777 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
           ├─ 3778 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
           └─28193 /usr/sbin/libvirtd

juil. 28 12:23:32 tsu libvirtd[28193]: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not been found
juil. 28 12:23:32 tsu libvirtd[28193]: Failed to probe capabilities for /usr/bin/qemu-system-sparc: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not
juil. 28 12:23:32 tsu libvirtd[28193]: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not been found
juil. 28 12:23:32 tsu libvirtd[28193]: Failed to probe capabilities for /usr/bin/qemu-system-sparc64: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has n
juil. 28 12:23:32 tsu libvirtd[28193]: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not been found
juil. 28 12:23:32 tsu libvirtd[28193]: Failed to probe capabilities for /usr/bin/qemu-system-unicore32: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has
juil. 28 12:23:32 tsu libvirtd[28193]: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not been found
juil. 28 12:23:32 tsu libvirtd[28193]: Failed to probe capabilities for /usr/bin/qemu-system-xtensa: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has no
juil. 28 12:23:33 tsu libvirtd[28193]: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not been found
juil. 28 12:23:33 tsu libvirtd[28193]: Failed to probe capabilities for /usr/bin/qemu-system-xtensaeb: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has 
lines 7-22/22 (END)

or i should rename them to “ovmf-x86_64-vars.bin” instead of “ovmf_vars_x64.bin”

No, that’s not the problem here. This is internal QEMU stuff, probably related to detecting cpu capabilities, should have clarified that earlier.

Can you paste in the xml for the vm configuration? It should be in /etc/libvirt/qemu/<whatever you named the vm>.xml

I’m curious about how the virtual CPU is configured there.

1 Like
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit generic
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>generic</name>
  <uuid>4e150212-3b62-471d-9d17-1da57fbdd9cb</uuid>
  <memory unit='KiB'>9216000</memory>
  <currentMemory unit='KiB'>9216000</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-zesty'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>SandyBridge</model>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/generic.qcow2'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:93:ef:68'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' autoport='yes'>
      <listen type='address'/>
      <image compression='off'/>
    </graphics>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>
1 Like

I see a number of things that could be causing issues, but are unlikely to cause this exact issue.

I’ll address them in the edit below:


First thing’s first: When we do passthrough, we use Q35 for the machine type. The safest way to do this is to rebuild the VM. When you go through the “new vm” wizard, on the last page, check the box that says “Customize configuration before install” like below, then click finish. On the Overview page, you want to set Chipset: Q35

Screenshot from 2017-07-28 11-14-59

Once that’s done, set up your passthrough again and share the XML again. Sorry to make it so complicated, but Q35 has features we need.

EDIT! Don’t forget to choose EFI firmware. Hope this isn’t too late!

1 Like

image

Unable to complete install: 'unsupported configuration: IDE controllers are unsupported for this QEMU binary or machine type'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 90, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 2277, in _do_async_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 501, in start_install
    noboot)
  File "/usr/share/virt-manager/virtinst/guest.py", line 416, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3491, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: unsupported configuration: IDE controllers are unsupported for this QEMU binary or machine type

Oh, right. make sure none of your drives are IDE. If they are, switch the CD drives to SATA and the hard drives to VIRTIO.

hmm you lost me there.

also I don’t know what’s up with my zfs fiiesystem at /dev/zvol/pool

how do i point vitual manager to it ?

I’ll need to do that eventually for the above i’d just created a .qcow2 file in a random place but I’m supposed to use the whole directory no?