You are not logged in.

#5026 2015-05-06 22:42:06

Fira
Member
Registered: 2011-09-24
Posts: 8

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

So, after lots of testing and much annoying of the EDK2 developpers, i realized that my DreamSpark Win8.1 and Win7 ISO are in UDF Format - which is currently not supported by EDK2/OVMF. I'm still not sure to understand why in 200 pages, there's been only one other occurence of the problem reported, I can only assume the majority of the Win8 ISOs are in fact no UDF...

After trying to convert the image to FAT32 and ISO9660 i got bootable images on the EFI side, only to get hit by a crash on the Windows Bootloader.
I just realized I could work around this whole mess by making ... a bootable USB key and ... passing it through to the VM... Yeah.
Leaving this here in case the experiment goes wrong. I'll report on wether it worked or not if I'm still alive by then.

Offline

#5027 2015-05-06 22:46:01

PureTryOut
Member
Registered: 2014-09-23
Posts: 64

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

So I recently switched to i3 for everyday use, and I noticed my virtual machine has no sound anymore.
Pulseaudio seems to be running, I can correctly change volumes and outputs with pavucontrol, and every other applications plays  sound normally.

However when I switch to a full-on DE, Mate in my case, I do have sound in the vm. I'm not sure what's up here.

My launch script:

QEMU_AUDIO_DRV=all qemu-system-x86_64 -L . -enable-kvm -m 8096 -cpu host,kvm=off -smp 6,sockets=1,cores=6,threads=1 -vga none \
 -device vfio-pci,host=02:00.0,x-vga=on -device vfio-pci,host=02:00.1 -device vfio-pci,host=00:19.0 -device vfio-pci,host=04:00.0 \
 -device virtio-scsi-pci,id=scsi1 -drive file=/dev/sdb,id=ssddisk,format=raw,if=none -device scsi-hd,drive=ssddisk \
 -device virtio-scsi-pci,id=scsi2 -drive file=/dev/sdd,id=hdddisk,format=raw,if=none -device scsi-hd,drive=hdddisk \
 -usb -usbdevice host:0738:2215 -usbdevice host:0738:a215 -usbdevice host:13d3:3404 -usbdevice host:2516:0011 -usbdevice host:1532:0033 \
 -usbdevice host:054c:0268 -soundhw hda

Offline

#5028 2015-05-06 22:58:56

Duelist
Member
Registered: 2014-09-22
Posts: 358

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Fira wrote:

I'm still not sure to understand why in 200 pages, there's been only one other occurence of the problem reported, I can only assume the majority of the Win8 ISOs are in fact no UDF...

...because this thread isn't related to "installing windowns into QEMU virtual machine"?

And why do i have the habit of tearing apart windowns' install media and actually understanding how it's supposed to boot?..
You can tear that darn install media into two partitions on two separate disks, and it'll still work, if you put enough duct tape everywhere. Actually, that's how it works when using the USB thumb drive method.


The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.

Offline

#5029 2015-05-06 23:30:27

Fira
Member
Registered: 2011-09-24
Posts: 8

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Duelist wrote:
Fira wrote:

I'm still not sure to understand why in 200 pages, there's been only one other occurence of the problem reported, I can only assume the majority of the Win8 ISOs are in fact no UDF...

...because this thread isn't related to "installing windowns into QEMU virtual machine"?

I'm not sure what your problem is or why you're even saying this. 
Am just reporting that there are potential, although uncommon, issues with Windows 7/8 installation on OVMF due to unusual ISOs, which is pretty much a requirement for effective VGA passthrough ?

Duelist wrote:

And why do i have the habit of tearing apart windowns' install media and actually understanding how it's supposed to boot?..

I'm terribly sorry, i thought this was a Community Forum, I clearly didn't realize this was your personal mailbox.

Edit: If anyone even cares about the whole UDF mess,
- Microsoft's USB Creator won't take the ISO because it's non-standard
- LiLi USB Creator is not UDF aware and just prints out a README
- Rufus seems to actually do the job, up to the moment you try to boot it and it doesn't work

Last edited by Fira (2015-05-06 23:39:49)

Offline

#5030 2015-05-07 02:06:16

Duelist
Member
Registered: 2014-09-22
Posts: 358

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Fira wrote:

Edit: If anyone even cares about the whole UDF mess,
- Microsoft's USB Creator won't take the ISO because it's non-standard
- LiLi USB Creator is not UDF aware and just prints out a README
- Rufus seems to actually do the job, up to the moment you try to boot it and it doesn't work

Where did you even get this image? DreamSpark you say?.. Isn't that Microsoft's Live File System images, intended for something like live, bootable images? I mean, technically you can add files to the burned disc, that would be somewhat useful for a live system or some weird updates of the install media.
Can you just extract all the files from that image, and make ESP(containing /BOOT/BOOTX64.EFI or how was that file should be named) and data partition manually? That should be somewhat simpler to do than dealing with various usb creating software.

If you have dreamspark access, why you didn't go straight to MSDN? MSDN is known to supply normal, ISO9660 images. God damn microsoft, subscription is paid-only.

UPD:Looking at the images, there's Server2012R2 with ISO9660 and UDF1.02 available on dreamspark. That looks weird.
Seems like the only way around is to tear them up manually.

Fira wrote:

Windows 7/8 installation on OVMF due to unusual ISOs, which is pretty much a requirement for effective VGA passthrough

Why, you could always install linux into your VM, it'd just be another usecase of this tech. For example, i need to provide a remote workplace for some 3D-guy working in blender and i don't like buying citrix xenapp or vsphere or whatever... ... darn, i should definitely try doing that to see the bandwidth issues.

Last edited by Duelist (2015-05-07 10:25:36)


The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.

Offline

#5031 2015-05-07 11:06:03

deniv
Member
Registered: 2013-10-16
Posts: 27

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Duelist wrote:
deniv wrote:

I've seen some people here have GT610 with EFI support. Can anybody share the rom? My card comes only with VGA and I can't contact the vendor's support to get a newer rom from them.

Using envytools' nvagetbios -s prom, here's my GT610's VBIOS. It's a Gigabyte Gigabyte(sic!) GT610.
After 90 days the file will be automagically deleted, sorry about that.

Thanks a bunch! It works with my https://www.asus.com/us/Graphics_Cards/GT610SL1GD3L/ So, yet another working win7 efi setup.

A pity rebooting doesn't work (I think I have the same problem as you). Perhaps it's somehow related to the VBIOS. Anybody else mind sharing their VBIOS for gt610?

P.S. Wish QXL wouldn't stop working when a passed card is active. It works in win 8.1! I get two screens one on a physical card and one on a qxl card. Why win 7 can't do it? :x

Offline

#5032 2015-05-07 16:55:10

Schlunze
Member
Registered: 2013-10-03
Posts: 53

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hello,

ist it only possible to passthrough whole iommu groups?
VGA passthrough works like charm for two months now.
Recently i´ve experimenting to get dual boot to work with a native installed Win7 on /dev/sdg.
So i have to passthrough ASM1602 SATA controller.
The problem is sde and sdf shoud be accessible on host.

ls -l /sys/block/ | grep sd.
lrwxrwxrwx  1 root root 0  7. Mai 16:53 sda -> ../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda
lrwxrwxrwx  1 root root 0  7. Mai 16:53 sdb -> ../devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb
lrwxrwxrwx  1 root root 0  7. Mai 16:53 sdc -> ../devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/block/sdc
lrwxrwxrwx  1 root root 0  7. Mai 16:53 sdd -> ../devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/block/sdd
lrwxrwxrwx  1 root root 0  7. Mai 16:53 sde -> ../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/0000:05:03.0/0000:07:00.0/ata7/host6/target6:0:0/6:0:0:0/block/sde
lrwxrwxrwx  1 root root 0  7. Mai 16:53 sdf -> ../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/0000:05:03.0/0000:07:00.0/ata8/host7/target7:0:0/7:0:0:0/block/sdf
lrwxrwxrwx  1 root root 0  7. Mai 16:53 sdg -> ../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/0000:05:07.0/0000:09:00.0/ata9/host8/target8:0:0/8:0:0:0/block/sdg
lrwxrwxrwx  1 root root 0  7. Mai 17:43 sdh -> ../devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5:1.0/host10/target10:0:0/10:0:0:0/block/sdh

This is the big Z97 group

### Group 9 ###
    00:1c.0 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 1 (rev d0)
    00:1c.2 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 3 (rev d0)
    00:1c.3 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 4 (rev d0)
    00:1c.6 PCI bridge: Intel Corporation 9 Series Chipset Family PCI Express Root Port 7 (rev d0)
    03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 11)
    04:00.0 PCI bridge: ASMedia Technology Inc. Device 1184
    05:01.0 PCI bridge: ASMedia Technology Inc. Device 1184
    05:03.0 PCI bridge: ASMedia Technology Inc. Device 1184
    05:05.0 PCI bridge: ASMedia Technology Inc. Device 1184
    05:07.0 PCI bridge: ASMedia Technology Inc. Device 1184
    07:00.0 SATA controller: ASMedia Technology Inc. ASM1062 Serial ATA Controller (rev 02)
    09:00.0 SATA controller: ASMedia Technology Inc. ASM1062 Serial ATA Controller (rev 02)
    0a:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller

Is it somehow possible to passthrough only 09:00.0?

Thank you in advance

Offline

#5033 2015-05-07 17:01:56

aw
Member
Registered: 2013-10-04
Posts: 921
Website

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

9-series PCH root port quirks will probably go in for kernel 4.2


http://vfio.blogspot.com
Looking for a more open forum to discuss vfio related uses?  Try https://www.redhat.com/mailman/listinfo/vfio-users

Offline

#5034 2015-05-07 17:50:29

Duelist
Member
Registered: 2014-09-22
Posts: 358

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

deniv wrote:
Duelist wrote:
deniv wrote:

I've seen some people here have GT610 with EFI support. Can anybody share the rom? My card comes only with VGA and I can't contact the vendor's support to get a newer rom from them.

Using envytools' nvagetbios -s prom, here's my GT610's VBIOS. It's a Gigabyte Gigabyte(sic!) GT610.
After 90 days the file will be automagically deleted, sorry about that.

Thanks a bunch! It works with my https://www.asus.com/us/Graphics_Cards/GT610SL1GD3L/ So, yet another working win7 efi setup.

A pity rebooting doesn't work (I think I have the same problem as you). Perhaps it's somehow related to the VBIOS. Anybody else mind sharing their VBIOS for gt610?

P.S. Wish QXL wouldn't stop working when a passed card is active. It works in win 8.1! I get two screens one on a physical card and one on a qxl card. Why win 7 can't do it? :x

Rebooting doesn't work?.. Haven't heard about it. My Radeon-based VM system reboots just fine.
Anyway, i can conclude that Asus can not into UEFI properly.


The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.

Offline

#5035 2015-05-07 19:11:37

deniv
Member
Registered: 2013-10-16
Posts: 27

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Duelist wrote:
deniv wrote:
Duelist wrote:

Using envytools' nvagetbios -s prom, here's my GT610's VBIOS. It's a Gigabyte Gigabyte(sic!) GT610.
After 90 days the file will be automagically deleted, sorry about that.

Thanks a bunch! It works with my https://www.asus.com/us/Graphics_Cards/GT610SL1GD3L/ So, yet another working win7 efi setup.

A pity rebooting doesn't work (I think I have the same problem as you). Perhaps it's somehow related to the VBIOS. Anybody else mind sharing their VBIOS for gt610?

P.S. Wish QXL wouldn't stop working when a passed card is active. It works in win 8.1! I get two screens one on a physical card and one on a qxl card. Why win 7 can't do it? :x

Rebooting doesn't work?.. Haven't heard about it.

I recall somebody in this topic said their GT610 didn't survive reboots. I thought it was you, but it seems like I was wrong.

My Radeon-based VM system reboots just fine.

My Radeon-based VM reboots fine as well.

Anyway, i can conclude that Asus can not into UEFI properly.

But I used your Gigabyte UEFI. big_smile Anyway, ASUS does have a windows-only utility to update vbios; I just can't use it since I have no bare-metal Windows installs.

Offline

#5036 2015-05-07 19:33:50

PureTryOut
Member
Registered: 2014-09-23
Posts: 64

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

PureTryOut wrote:

So I recently switched to i3 for everyday use, and I noticed my virtual machine has no sound anymore.
Pulseaudio seems to be running, I can correctly change volumes and outputs with pavucontrol, and every other applications plays  sound normally.

However when I switch to a full-on DE, Mate in my case, I do have sound in the vm. I'm not sure what's up here.

My launch script:

QEMU_AUDIO_DRV=all qemu-system-x86_64 -L . -enable-kvm -m 8096 -cpu host,kvm=off -smp 6,sockets=1,cores=6,threads=1 -vga none \
 -device vfio-pci,host=02:00.0,x-vga=on -device vfio-pci,host=02:00.1 -device vfio-pci,host=00:19.0 -device vfio-pci,host=04:00.0 \
 -device virtio-scsi-pci,id=scsi1 -drive file=/dev/sdb,id=ssddisk,format=raw,if=none -device scsi-hd,drive=ssddisk \
 -device virtio-scsi-pci,id=scsi2 -drive file=/dev/sdd,id=hdddisk,format=raw,if=none -device scsi-hd,drive=hdddisk \
 -usb -usbdevice host:0738:2215 -usbdevice host:0738:a215 -usbdevice host:13d3:3404 -usbdevice host:2516:0011 -usbdevice host:1532:0033 \
 -usbdevice host:054c:0268 -soundhw hda

Shouldn't "QEMU_AUDIO_DRV=alsa" set it to alsa? Even that doesn't seem to work while, again, in Mate it works.
i3 shouldn't be messing with my sound right?

Last edited by PureTryOut (2015-05-07 21:58:32)

Offline

#5037 2015-05-08 15:14:03

wulfspider
Member
From: Germany, Hesse, Darmstadt
Registered: 2015-05-05
Posts: 13

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hi again,

OVMF works. Started the ovmf with the qemu command and ovmf and TianoCore appears. But after I added ovmf to my libvirt xml I get "Permission denied". My OVMF is self compiled

XML config:

...
<os>
    ....
    <loader readonly='yes' type='pflash'>/opt/ovmf/OVMF_CODE.fd</loader>
    <nvram template='/opt/ovmf/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/win8.1_VARS.fd</nvram>
    ....
</os>
...

Error:

qemu-system-x86_64: -drive file=/var/lib/libvirt/qemu/nvram/win8.1_VARS.fd,if=pflash,format=raw,unit=1: Could not open '/var/lib/libvirt/qemu/nvram/win8.1_VARS.fd': Permission denied

ls -lah:

drwxr-x--- 7 libvirt-qemu kvm  4,0K Mai  8 17:11 ..
-rwxr-x--- 1 root         root 128K Mai  6 11:29 win8.1_VARS.fd

Last edited by wulfspider (2015-05-08 15:17:20)

Offline

#5038 2015-05-08 15:23:44

The_Moves
Member
Registered: 2015-01-06
Posts: 59

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Remove /var/lib/libvirt/qemu/nvram/win8.1_VARS.fd, which will leave:

<nvram template='/opt/ovmf/OVMF_VARS.fd'></nvram>

When you start the VM, it will generate a new nvram file.

Offline

#5039 2015-05-08 15:27:49

wulfspider
Member
From: Germany, Hesse, Darmstadt
Registered: 2015-05-05
Posts: 13

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hm, I removed the template parameter but nothing has changed.

I also changed the permissions of this file from root:root to libvirt-qemu:kvm, but after I executed virsh start win8.1 the permissions are resetted to root:root

Last edited by wulfspider (2015-05-08 15:28:09)

Offline

#5040 2015-05-08 16:44:41

Schlunze
Member
Registered: 2013-10-03
Posts: 53

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hello,

i just need a way to get win7 running from another disk currently "sdg", configured by vmm or xml. I´m not sure if there is a need for me to passthrough SATA controller at all.

Or pass through the other SATA controller from Intel?

### Group 11 ###
    00:1f.0 ISA bridge: Intel Corporation 9 Series Chipset Family Z97 LPC Controller
    00:1f.2 SATA controller: Intel Corporation 9 Series Chipset Family SATA Controller [AHCI Mode]
    00:1f.3 SMBus: Intel Corporation 9 Series Chipset Family SMBus Controller

and plug the disks

lrwxrwxrwx  1 root root 0  8. Mai 17:30 sda -> ../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda
lrwxrwxrwx  1 root root 0  8. Mai 17:30 sdb -> ../devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb
lrwxrwxrwx  1 root root 0  8. Mai 17:30 sdc -> ../devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/block/sdc
lrwxrwxrwx  1 root root 0  8. Mai 17:30 sdd -> ../devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/block/sdd

on the ASM1062 witch failed yesterday.

There are just too many disks to wire.
Just need the easiest solution, because Group 9 passthrough isn´t working. VirtIO disks worked perfectly for me in the past.

Anyone?

Last edited by Schlunze (2015-05-08 16:49:18)

Offline

#5041 2015-05-08 17:14:46

PureTryOut
Member
Registered: 2014-09-23
Posts: 64

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

PureTryOut wrote:

Shouldn't "QEMU_AUDIO_DRV=alsa" set it to alsa? Even that doesn't seem to work while, again, in Mate it works.
i3 shouldn't be messing with my sound right?

Well I found out why I had no sound with Pulseaudio, still not sure why it works fine in Mate though.
Pulseaudio is running as the current user, but i'm launching Qemu with sudo rights.

I'm launching Qemu with sudo because I boot directly from hard disk (to get full ssd speeds), to open these I need sudo rights. I guess I could chown the disks to my user every time but I rather not do that.
Also, even when chowning it to my user, and then launching Qemu without root, it complains about not being able to open /dev/vfio/16 because it's missing permissions.

I thought switching to OVMF might help (do note, i'm a noob in all of this), but of course it didn't.

So how can I run Qemu as root, while still using Pulseaudio?

Offline

#5042 2015-05-09 00:57:06

Denso
Member
Registered: 2014-08-30
Posts: 179

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

deniv wrote:

I recall somebody in this topic said their GT610 didn't survive reboots. I thought it was you, but it seems like I was wrong.

It is me sad

Been trying with this cursed card for more than a month , and nothing would fix it .

The issue is when you reboot the VM , it succeeds , you can see OVMF screen and Windows loading logo then an infinite black screen . Hopefully , I'll get another newer card soon .

Can anyone suggest a newer architecture SINGLE-SLOT card from NVIDIA ? Couldn't find anything other than a GTX 750 .

Offline

#5043 2015-05-09 10:47:52

deniv
Member
Registered: 2013-10-16
Posts: 27

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Denso wrote:

The issue is when you reboot the VM , it succeeds , you can see OVMF screen and Windows loading logo then an infinite black screen .

Yep, I have the same problem. And even the host hangs when the VM reboots.

Offline

#5044 2015-05-09 12:23:12

novist
Member
Registered: 2014-03-14
Posts: 47

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Denso wrote:

The issue is when you reboot the VM , it succeeds , you can see OVMF screen and Windows loading logo then an infinite black screen .

Idk if this will be of any help but similar thing happens when emulated vga is used as primary and physical vga is used as secondary. windows logo would be seen on emulated vga window and then it goes black as windows switches to more powerful physical vga. maybe something similar is happening there?

Offline

#5045 2015-05-09 14:03:07

wulfspider
Member
From: Germany, Hesse, Darmstadt
Registered: 2015-05-05
Posts: 13

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Can somebody tell me if my hardware supports VT-d? Or how can I check this? I don't get working the pass through and I am slowly dispairing.

Motherboard: Asus P8Z77-V Pro
Processor: i7-3770

I know that my processor and the Z77 chipset support VT-d, but don't know if it really works or if Asus disabled this function in my model. Under the CPU section in my bios I enabled "Intel Virtualisation technology". Is this the same? Another Option like "VT-d" is not available.

Last edited by wulfspider (2015-05-09 14:13:52)

Offline

#5046 2015-05-09 17:37:46

novist
Member
Registered: 2014-03-14
Posts: 47

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

wulfspider wrote:

Can somebody tell me if my hardware supports VT-d? Or how can I check this? I don't get working the pass through and I am slowly dispairing.

Motherboard: Asus P8Z77-V Pro
Processor: i7-3770

I know that my processor and the Z77 chipset support VT-d, but don't know if it really works or if Asus disabled this function in my model. Under the CPU section in my bios I enabled "Intel Virtualisation technology". Is this the same? Another Option like "VT-d" is not available.

/proc/cpuinfo flags #

/proc/cpuinfo will tell you if the processor supports virtualization and if it is enabled (but it could not show up in flags because it is disabled — more on this below).

The flags to look out for are:

    vmx — Intel VT-x, basic virtualization
    svm — AMD SVM, basic virtualization
    ept — Extended Page Tables, an Intel feature to make emulation of guest page tables faster.
    vpid — VPID, an Intel feature to make expensive TLB flushes unnecessary when context switching between guests.
    npt — AMD Nested Page Tables, similar to EPT.
    tpr_shadow and flexpriority — Intel feature that reduces calls into the hypervisor when accessing the Task Priority Register, which helps when running certain types of SMP guests.
    vnmi — Intel Virtual NMI feature which helps with certain sorts of interrupt events in guests.

from http://virt-tools.org/learning/check-hardware-virt/

Offline

#5047 2015-05-09 18:10:27

stokbaek
Member
Registered: 2014-09-20
Posts: 3

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Hello,

I desided to give this a go since I had to reinstall pc anyways.

I managed to get myself stuck and hope some of you guys would be able to help out of my problem. My issue is when I start the vm does a QUEMU window open but I never get any signal on the screen that is in the GFX card that is linked to it.
If I add the following line to the vmcreate script am I able to VNC into the VM. It can see the gfx card and installed the drivers for it, but still aint able to get its screen working even after I have installed the video driver to it.

-vnc :0 -vga vmware

This PC is running Linux Mint 17.1
kernel:

3.13.0-37-generic

PC Setup:

       description: Motherboard
       product: B75M-D3H
       vendor: Gigabyte Technology Co., Ltd.
       physical id: 0
       version: x.x
       serial: To be filled by O.E.M.
       slot: To be filled by O.E.M.

          description: CPU
          product: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
          vendor: Intel Corp.
          physical id: 43
          bus info: cpu@0
          version: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
          slot: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
          size: 3801MHz
          capacity: 3801MHz
          width: 64 bits
          clock: 100MHz

/etc/modules:

lp
rtc
pci_stub
vfio
vfio_iommu_type1
vfio_pci
kvm
kvm_intel

/etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1"

lspci -nn | grep NVIDIA:

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK104 [GeForce GTX 760] [10de:1187] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1)

iniramfs/modules:

pci_stub ids=10DE:0E0A,10DE:1187

dmesg | grep pci-stub:

[    2.737698] pci-stub: add 10DE:0E0A sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    2.737712] pci-stub 0000:01:00.1: claimed by stub
[    2.737718] pci-stub: add 10DE:1187 sub=FFFFFFFF:FFFFFFFF cls=00000000/00000000
[    2.737721] pci-stub 0000:01:00.0: claimed by stub

/etc/vfio-pci1.cfg:

0000:01:00.0
0000:01:00.1

/usr/vm1:

#!/bin/bash

configfile=/etc/vfio-pci1.cfg

vfiobind() {
    dev="$1"
        vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
        device=$(cat /sys/bus/pci/devices/$dev/device)
        if [ -e /sys/bus/pci/devices/$dev/driver ]; then
                echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
        fi
        echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id

}

modprobe vfio-pci

cat $configfile | while read line;do
    echo $line | grep ^# >/dev/null 2>&1 && continue
        vfiobind $line
done

sudo qemu-system-x86_64 -enable-kvm -M q35 -m 8192 -cpu host \
-smp 4,sockets=1,cores=4,threads=1 \
-bios /usr/share/qemu/bios.bin -vga none \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=01:00.1,bus=root.1,addr=00.1 \
-drive file=/media/christoffers/Games/vm_machines/windows8.1.img,id=disk,format=raw -device ide-hd,bus=ide.0,drive=disk \
-drive file=/home/christoffers/Downloads/windows8.1.iso,id=isocd -device ide-cd,bus=ide.1,drive=isocd \
-boot menu=on

exit 0

kvm-ok:

INFO: /dev/kvm exists
KVM acceleration can be used

Please do tell if I need to supply more information

Last edited by stokbaek (2015-05-09 19:58:30)

Offline

#5048 2015-05-09 21:30:27

Denso
Member
Registered: 2014-08-30
Posts: 179

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

novist wrote:

Idk if this will be of any help but similar thing happens when emulated vga is used as primary and physical vga is used as secondary. windows logo would be seen on emulated vga window and then it goes black as windows switches to more powerful physical vga. maybe something similar is happening there?

That's not the case , I am passing through the GT610 as the primary and only GPU to the VM (-vga none) .

Maybe it will work if I passed it as a secondary one tongue Let's try and see !

EDIT : Nope . Gonna replace it with an ASUS GTX 750 soon .

Last edited by Denso (2015-05-09 22:56:27)

Offline

#5049 2015-05-10 00:11:25

Duelist
Member
Registered: 2014-09-22
Posts: 358

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

Denso wrote:

EDIT : Nope . Gonna replace it with an ASUS GTX 750 soon .

There was a passively-cooled version of GTX750, and maybe even 750Ti from Zotac. Sorry for my obsession, none of my GPUs are actively cooled..


The forum rules prohibit requesting support for distributions other than arch.
I gave up. It was too late.
What I was trying to do.
The reference about VFIO and KVM VGA passthrough.

Offline

#5050 2015-05-10 00:44:01

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: KVM VGA-Passthrough using the new vfio-vga support in kernel =>3.9

I've been moving from QEMU bash scripts to libvirt/virt-manager and have had no problems with the main setup in either yet.

Since the basic setup worked without issues for me, I tried to create some more exotic configurations and use cases. What I've found during the process:
- The latest nVidia host drivers (349.16-2) can not be used if you want to passthrough a GPU (at least not without modifications and I don't know how to do that).
- The 'intel_iommu=on' kernel parameter may prevent the system from booting into X if you are using *.conf files for X (though maybe this depends on hardware).
- If X is running when you unbind or rebind a GPU, it'll freeze your whole system.
- Stubbing or binding to vfio-pci is not needed when using libvirt/virt-manager (it binds the GPU when you start the VM and unbinds/rebinds to host after it shuts down)
- SLI is currently not possible on either chipset (at least I did not manage to get this working. I'll be happy to hear if someone did!).
- Standard sound configuration of libvirt doesn't work if the VM is started without an active X session (the sound won't play over the host speakers).
- Onboard audio unbinding and rebinding works perfectly and can be done during active X sessions as well.
- When emulating an audio device it is not possible to define how much channels it should have?? (ie. 2.1, 5.1 or 7.1 instead of the default stereo)
- Windows 8.1 will not boot with the Q35 chipset (it freezes during boot at the logo).
- No working QXL/Spice drivers available for Windows 8.1 yet so you get a wonderful 800x600 resolution!
- The OVMF version on extra stops the VM from rebooting (it just shows a white _ in the top left). The ovmf-svn package on the AUR works fine and rebooting works.


Used hardware
MoBo: ASUS X99-A
GPU: GeForce GTX 970 (x2)
CPU: Intel i7 5930K
UEFI boot mode only (CSM/Legacy support disabled)

Software:
- kernel 4.0.1-1 (latest on core)
- qemu 2.2.1-4 (latest on extra)
- ovmf-svn 17281-1 (aur)
- libvirt 1.2.15-1 (latest on community)
- virt-manager 1.2.0-1 (latest on community)

Last edited by Omar007 (2015-05-10 01:02:06)

Offline

Board footer

Powered by FluxBB