You are not logged in.

#2476 2014-08-11 20:19:25

abdullah
Member
Registered: 2014-06-10
Posts: 34

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

devianceluka wrote:

I think I got it how to compile the kernel, read few guides.

What I now get is this:

sudo patch -p1 < override_for_missing_acs_capabilities.patch
patching file Documentation/kernel-parameters.txt
Hunk #1 succeeded at 2490 with fuzz 1 (offset -64 lines).
patching file drivers/pci/quirks.c
Hunk #1 succeeded at 3394 (offset 10 lines).
Hunk #2 succeeded at 3539 with fuzz 1 (offset -45 lines).
Hunk #3 FAILED at 3597.
1 out of 3 hunks FAILED -- saving rejects to file drivers/pci/quirks.c.rej

Could anyone please tell me what I'm doing wrong? The kernel I got is: "linux-image-3.13.0-32-generic" which I got with "sudo apt-get source linux-image-`uname -r`"

here is the kernel :
http://kernel.org/

change dir to

 cd /usr/src/ 

Download the last stable, extract with

tar -xvf "archive name"

Download the patches from the first page, extract to /usr/src
change dir to the extracted kernel,

 cd linux-3.16/ 

apply the needed patches by:

 patch -p1 < ../linux-mainline/ [NEEDED .PATCH] 

you could also read here, it helped me very well:
http://edencomputing.com/

Offline

#2477 2014-08-11 20:25:47

devianceluka
Member
Registered: 2014-05-19
Posts: 44

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

abdullah wrote:
devianceluka wrote:

I think I got it how to compile the kernel, read few guides.

What I now get is this:

sudo patch -p1 < override_for_missing_acs_capabilities.patch
patching file Documentation/kernel-parameters.txt
Hunk #1 succeeded at 2490 with fuzz 1 (offset -64 lines).
patching file drivers/pci/quirks.c
Hunk #1 succeeded at 3394 (offset 10 lines).
Hunk #2 succeeded at 3539 with fuzz 1 (offset -45 lines).
Hunk #3 FAILED at 3597.
1 out of 3 hunks FAILED -- saving rejects to file drivers/pci/quirks.c.rej

Could anyone please tell me what I'm doing wrong? The kernel I got is: "linux-image-3.13.0-32-generic" which I got with "sudo apt-get source linux-image-`uname -r`"

here is the kernel :
http://kernel.org/

change dir to

 cd /usr/src/ 

Download the last stable, extract with

tar -xvf "archive name"

Download the patches from the first page, extract to /usr/src
change dir to the extracted kernel,

 cd linux-3.16/ 

apply the needed patches by:

 patch -p1 < ../linux-mainline/ [NEEDED .PATCH] 

you could also read here, it helped me very well:
http://edencomputing.com/

Thank you very much to you and sinny! But what I want to do is compile a "stable" kernel that gets updated every now and then by the OS to more and more "stable" one. Does this kernel from this site need to get "manually" updated every now and then? Im very grateful for what you wrote but try to answer this...

Offline

#2478 2014-08-12 04:44:33

alexis_evo
Member
Registered: 2013-07-04
Posts: 33

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

slis wrote:

@aw

one question pls smile

what are options for clock or what clock to use on windows guest to make it "tight" or something like that, i get this weird problem after 30 or 60mins clock on vm is re/set or smth, cause when streaming games logs show frame time in -12312435ms expected is 20-50ms, and it starts to lag, it shows estimated bandwith like 10-40mbps (expected is 400-1000) in steam stats on 1gbps lan (alt-tab, copy-paste at same time 100MB/s) etc.... maybe cause of high cpu load? clock lags?

i did try couple of options that i found here/on internet, but nothing seems to make it go away completely.

problem it is happening after 30mins so its pain to wait for it smile

does hwclock need to be in sync with os clock?


thx

A solution is posted on the very same page of the thread that your post is on wink. Pass -no-hpet to qemu. HPET in qemu seems to cause time drift.

Offline

#2479 2014-08-12 04:46:59

sinny
Member
Registered: 2014-05-24
Posts: 75

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

devianceluka wrote:
abdullah wrote:
devianceluka wrote:

I think I got it how to compile the kernel, read few guides.

What I now get is this:

sudo patch -p1 < override_for_missing_acs_capabilities.patch
patching file Documentation/kernel-parameters.txt
Hunk #1 succeeded at 2490 with fuzz 1 (offset -64 lines).
patching file drivers/pci/quirks.c
Hunk #1 succeeded at 3394 (offset 10 lines).
Hunk #2 succeeded at 3539 with fuzz 1 (offset -45 lines).
Hunk #3 FAILED at 3597.
1 out of 3 hunks FAILED -- saving rejects to file drivers/pci/quirks.c.rej

Could anyone please tell me what I'm doing wrong? The kernel I got is: "linux-image-3.13.0-32-generic" which I got with "sudo apt-get source linux-image-`uname -r`"

here is the kernel :
http://kernel.org/

change dir to

 cd /usr/src/ 

Download the last stable, extract with

tar -xvf "archive name"

Download the patches from the first page, extract to /usr/src
change dir to the extracted kernel,

 cd linux-3.16/ 

apply the needed patches by:

 patch -p1 < ../linux-mainline/ [NEEDED .PATCH] 

you could also read here, it helped me very well:
http://edencomputing.com/

Thank you very much to you and sinny! But what I want to do is compile a "stable" kernel that gets updated every now and then by the OS to more and more "stable" one. Does this kernel from this site need to get "manually" updated every now and then? Im very grateful for what you wrote but try to answer this...

you will have to manually update it every time either way unless you stop updating kernel at all. or you may find somewhere some kind of ubuntu repo with kernels specifically built for vt-d puproses (though me doubts it)
once again: this IS experimental stuff, so it IS NOT a convenient thing and it MAY break with any change/update you perform on the system

@abdullah:
there are tons of distro-specific scenarios descriptions on the internet, so you probably should not even try to describe it here (simply because you will miss ton of distro-specific details: e.g. co-existing with distro infrastructure, managing initramfs/initrd, etc)

Last edited by sinny (2014-08-12 04:47:26)

Offline

#2480 2014-08-12 05:11:57

maxexcloo
Member
Registered: 2009-10-14
Posts: 177

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

Does this work with switcable graphics? It would be an awesome use of that capability in my laptop wink

Offline

#2481 2014-08-12 07:04:00

slis
Member
Registered: 2014-06-02
Posts: 127

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

alexis_evo wrote:
slis wrote:

@aw

one question pls smile

what are options for clock or what clock to use on windows guest to make it "tight" or something like that, i get this weird problem after 30 or 60mins clock on vm is re/set or smth, cause when streaming games logs show frame time in -12312435ms expected is 20-50ms, and it starts to lag, it shows estimated bandwith like 10-40mbps (expected is 400-1000) in steam stats on 1gbps lan (alt-tab, copy-paste at same time 100MB/s) etc.... maybe cause of high cpu load? clock lags?

i did try couple of options that i found here/on internet, but nothing seems to make it go away completely.

problem it is happening after 30mins so its pain to wait for it smile

does hwclock need to be in sync with os clock?


thx

A solution is posted on the very same page of the thread that your post is on wink. Pass -no-hpet to qemu. HPET in qemu seems to cause time drift.

i did try that... but problem still presists... i think its not real clock problem, its ticks or something... cause in logs input time goes in negative values.... and it happens due high cpu load... like some ticks got delayed...

Offline

#2482 2014-08-12 08:31:35

brezerk
Member
From: Kiev, Ukraine
Registered: 2014-08-12
Posts: 1
Website

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

lojsar wrote:

Furthermore, I had great success modifying the VBIOS. Using a program called "nvbios" from "envytools" together with nVidia's documentation of the DCB ( ftp://download.nvidia.com/open-gpu-doc/ … _dcb_flags ), I was able to replace the VGA output. After this, I see BIOS output on my monitor! I was also able to run Windows (with -vga none), and install the nVidia drivers!

Hi. Does anyone have an idea or doc how I can modify DCB table?

I have an Notebook with Intel HD + GT650M glued with optimus.
I was able to switch host output to Intel Graphic and bypass GT650M to kvm, and install nvidia drivers on w7 guest. But... I see no output on HDMI at all. =\
Also windows refuse to start if I set -vga none.

DCB reports:

DCB table at 0x532a version 4.0 unk16 0x01
DCB 0: type 3 [LVDS] I2C 0 heads 0 CONN 0 [0x40] conntag 0 LOCAL unk02_6 2 OR 0 links 0 1 INFO EDID_I2C POWER 1 unk06 0x01
DCB 1: type 6 [DP] I2C 10 heads 1 CONN 1 [0x46] conntag 1 LOCAL unk02_6 2 OR 1 links 0 BW 270000 lanes 0 1 2 3
DCB 2: type 2 [TMDS] I2C 1 heads 1 CONN 1 [0x46] conntag 1 LOCAL OR 1 links 0 HDMI
DCB 3: type 6 [DP] I2C 11 heads 2 CONN 2 [0x46] conntag 2 LOCAL unk02_6 2 OR 2 links 0 BW 270000 lanes 0 1 2 3
DCB 4: type 2 [TMDS] I2C 7 heads 2 CONN 2 [0x46] conntag 2 LOCAL OR 2 links 0 HDMI
DCB 5: type 6 [DP] I2C 12 heads 3 CONN 3 [0x46] conntag 3 LOCAL unk02_6 2 OR 3 links 0 BW 270000 lanes 0 1 2 3
DCB 6: type 2 [TMDS] I2C 8 heads 3 CONN 3 [0x46] conntag 3 LOCAL OR 3 links 0 HDMI
DCB 7: type 14 [EOL]

It looks like I need to replace VGA output as well. But I am not 100% sure what I am doing :) Any help will be appreciated.

Offline

#2483 2014-08-12 08:40:06

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

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

Hey. Just wanted to report my success thanks to this guide, been running this kind of setup for a few months and it's working great.

Running:
- Kernel 3.14.2 with Gentoo patchset and the i915 drm patch listed at start of thread
- Qemu 2.0.0 Vanilla
- Seabios 1.7.4 Vanilla
- Windows 8.1

On hardware:
- Asrock Z87 Extreme3
- Xeon E3-1275v3 (Xeon equivalent of the i7-4771, same price)
- And a GeForce GTX 750 Ti, works with or without passing the sound sub-card
- Running with EFI on the Host side, BIOS on the Guest side
I initially planned to run this kind of setup under Xen but apparently GeForce requires hardmods, and the 750 doesn't even seem to be moddable : p

Now for the gotchas:

- Windows 8.1's bootloader
The install had to be done without VGA passthrough enabled: when it is enabled, any bootloader update just nukes it for some reason. I tried to install Windows 8 and upgrade to 8.1 with passthrough, nuked. I installed 8.1 and left Windows Update auto, nuked after two days. All my recovery attempts failed miserably and the bootloader partition is outright empty.

- Commandline gotchas
Some of the standard Qemu options didn't seem to work because of the custom chipset, for exemple i had to use -drive instead of -hda and such.
You wouldn't believe how long it took me to figure it out...

- Sound
Sound's been a big issue for me at start. Using AC97 froze guest. I could never get the ES1370 driver from realtek installed on Win8. HDA seemed to work fine until i realized it added huge echo after some time. I settled with usb-audio which caused occasional crashes but worked fine. However once I installed PulseAudio on guest and output wasn't on ALSA anymore, it would start stuttering. After a while digging in the QEMU Source, i found out that the hda driver is meant to work on ICH6 chipsets while the IOH3420 is of the ICH9 variety. Thanksfully there is an undocumented "ich9-intel-hda" variant which works perfectly !

-device ich9-intel-hda,bus=root.1
-device hda-duplex,bus=hda.0

- Virtio
Couldn't manage to get virtio working correctly under Win8. It's probably possible, but i'm too lazy to try again knowing about the bootloader problems.

- Awkward Disk Iops Patterns
The only real issue i still have today. Maybe because i'm running with 32GB RAM (16GB Host; 16GB to Guest), there seems to be abberrant amount of caching. Got a 4-disk SATA RAID5 array underneath.
When doing a disk-to-disk transfer in the guest, rate peaks at 500 Mb then drops to zero. The guest freezes for a few seconds, then does it again.
This is especially noticeable in some games, where any object entering the field can cause a little freeze - i believe due to texture and models loading.

- Synergy for mouse/keyboard sharing
Little offtopic, but If you plan to use Synergy, be aware that the AltGr key seems to be buggued...
Even applying the workarounds found around the net, it doesn't seem to help much.
I chose to just live with it and keep @s to copy/paste around : p
Otherwise perfs are very good. Just be aware you need to lock the mouse to your screen to use mouse-grabbing apps or they glitch.


The whole line:

QEMU_AUDIO_DRV=pa \
qemu-system-x86_64 \
        -name winix \
        -enable-kvm \
        -M q35 \
        -m 16192 \
        -cpu host \
        -smp 4,sockets=1,cores=4 \
        -net nic -net user \
        -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
        -device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
        -usb \
        -device ich9-intel-hda,bus=root.1 \
        -device hda-duplex,bus=hda.0 \
        -drive file=/dev/raidvg/winix-sys,id=system \
        -device ide-hd,bus=ide.0,drive=system \
        -drive file=/dev/raidvg/winix,id=data \
        -device ide-hd,bus=ide.1,drive=data \
        -vga none -nographic \
        -boot order=dc

That's it. Thanks for all the help, and I hope these informations will help you in turn smile
Good luck with your setups !

Last edited by Fira (2014-08-12 09:00:36)

Offline

#2484 2014-08-12 09:23:21

Wimma77
Member
Registered: 2014-08-12
Posts: 15

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

I've got an ubuntu 14.04 64bit server with an ATI HD7770 secondary card (HD5450 primary, no proprietary drivers loaded) and having issues, so hope someone could help.

Has anyone got this working with the virtual machine manager (GUI)?
I've got hardware that is capable (did get EXSi VM working with my HD7770 and streaming some steam games), but struggling with kvm.
I have used the cli method to get my video card & audio passed ( lspci -k |grep vfio shows the 2 entries) and installed Win7.
But after installing the ATI drivers (just video & audio custom install) the first reboot I got error code 43 on the card. Close?
After a shutdown I can not boot the VM again successfully.

So thought I'd try the VMM route.
Installed Win7 and passed the card, shows in device manager, but again install drivers and fails to boot again.
Remove card entries and will boot fine.
I'm using a default sata drivers, using /dev/sdb2 raw partition and a fresh Win7x64 install.
So I noticed VMM was using kvm as the emulator (my error on creating I assume), so I started again with qemu-system-x86_64 but it blue screens on any VM boot it seems.
Is it futile to continue with VMM?
I have qemu 2.0 installed.
kvm --version
QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.2), Copyright (c) 2003-2008 Fabrice Bellard
Any suggestions?
Thanks.

Offline

#2485 2014-08-12 09:44:38

devianceluka
Member
Registered: 2014-05-19
Posts: 44

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

sinny wrote:
devianceluka wrote:
abdullah wrote:

here is the kernel :
http://kernel.org/

change dir to

 cd /usr/src/ 

Download the last stable, extract with

tar -xvf "archive name"

Download the patches from the first page, extract to /usr/src
change dir to the extracted kernel,

 cd linux-3.16/ 

apply the needed patches by:

 patch -p1 < ../linux-mainline/ [NEEDED .PATCH] 

you could also read here, it helped me very well:
http://edencomputing.com/

Thank you very much to you and sinny! But what I want to do is compile a "stable" kernel that gets updated every now and then by the OS to more and more "stable" one. Does this kernel from this site need to get "manually" updated every now and then? Im very grateful for what you wrote but try to answer this...

you will have to manually update it every time either way unless you stop updating kernel at all. or you may find somewhere some kind of ubuntu repo with kernels specifically built for vt-d puproses (though me doubts it)
once again: this IS experimental stuff, so it IS NOT a convenient thing and it MAY break with any change/update you perform on the system

@abdullah:
there are tons of distro-specific scenarios descriptions on the internet, so you probably should not even try to describe it here (simply because you will miss ton of distro-specific details: e.g. co-existing with distro infrastructure, managing initramfs/initrd, etc)

I understand, I thought it was like that. Can you recommend me a distro which has a repo like that? I don't care to use any other distro if its better for this. I just want it to be "stable" so I dont get hacked... Thanks for explanation!

Offline

#2486 2014-08-12 11:37:46

sinny
Member
Registered: 2014-05-24
Posts: 75

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

devianceluka wrote:

I understand, I thought it was like that. Can you recommend me a distro which has a repo like that? I don't care to use any other distro if its better for this. I just want it to be "stable" so I dont get hacked... Thanks for explanation!

you really think you are worth "hacking"? more like you can get "hacked" only if you do something weird with your own hands. bad news - no distro will protect you from that

btw, "stable" is not about being "hack"-proof. in case you wondered

back to the topic...
i doubt there is any (once again: experimental feature we are talking about here). people occasionally write their success reports, some include distro mention - you can dig the thread and get something to make a choice from. manual work will be needed any way though.
i use fedora, but every kernel update i download i have to manually rebuild i915 module and update initramfs (posted more detailed description few pages "ago")

p.s. there was a google docs file containing peoples' specs with success/failure indication - could anyone please bring up the link (have trouble finding it - would be great to have it in head post)?

Offline

#2487 2014-08-12 12:17:15

devianceluka
Member
Registered: 2014-05-19
Posts: 44

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

sinny wrote:
devianceluka wrote:

I understand, I thought it was like that. Can you recommend me a distro which has a repo like that? I don't care to use any other distro if its better for this. I just want it to be "stable" so I dont get hacked... Thanks for explanation!

you really think you are worth "hacking"? more like you can get "hacked" only if you do something weird with your own hands. bad news - no distro will protect you from that

btw, "stable" is not about being "hack"-proof. in case you wondered

back to the topic...
i doubt there is any (once again: experimental feature we are talking about here). people occasionally write their success reports, some include distro mention - you can dig the thread and get something to make a choice from. manual work will be needed any way though.
i use fedora, but every kernel update i download i have to manually rebuild i915 module and update initramfs (posted more detailed description few pages "ago")

p.s. there was a google docs file containing peoples' specs with success/failure indication - could anyone please bring up the link (have trouble finding it - would be great to have it in head post)?

I will try fedora. As long as its updating kernel every now and then as it should, I'm happy with rebuilding it manually. Fedora needs qemu from git yes? Ubuntu has qemuv2.x and it wasnt needed. Thanks man!

Offline

#2488 2014-08-12 14:39:57

abdullah
Member
Registered: 2014-06-10
Posts: 34

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

sinny wrote:
devianceluka wrote:

I understand, I thought it was like that. Can you recommend me a distro which has a repo like that? I don't care to use any other distro if its better for this. I just want it to be "stable" so I dont get hacked... Thanks for explanation!

you really think you are worth "hacking"? more like you can get "hacked" only if you do something weird with your own hands. bad news - no distro will protect you from that

btw, "stable" is not about being "hack"-proof. in case you wondered

back to the topic...
i doubt there is any (once again: experimental feature we are talking about here). people occasionally write their success reports, some include distro mention - you can dig the thread and get something to make a choice from. manual work will be needed any way though.
i use fedora, but every kernel update i download i have to manually rebuild i915 module and update initramfs (posted more detailed description few pages "ago")

p.s. there was a google docs file containing peoples' specs with success/failure indication - could anyone please bring up the link (have trouble finding it - would be great to have it in head post)?

This one :

https://docs.google.com/spreadsheet/ccc … _web#gid=0

If you have the right hardware, it should work, I did it on Ubuntu, debian, working on Linux Mint now. When I did it on ubuntu it was stable enough, yet I had to get A nvidia card, which came with troubles, ending in breaking the system trying to fix it, so yes, no, this is not about being stable, and if you value the work on your PC you should be packing it up right now before even starting.

And I found an intersting wiki here, on isolating the guest
http://wiki.qemu.org/Documentation/Networking

and I was able to pass through a USB keyboard & mouse by bus # and addr #, which is good for whom got identical keyboards,
the command would be

 -usb -device usb-host,hostbus=#,hostaddr=# 

this was a helpful doc from opensus:
http://doc.opensuse.org/products/draft/ … nning.html

Offline

#2489 2014-08-12 18:22:48

monchi
Member
Registered: 2014-07-21
Posts: 9

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

Finally I got an video output on my passedthrough GPU with the following commandline:

sudo qemu-system-x86_64 -enable-kvm -M q35 -m 1024 -cpu host \
-smp 6,sockets=1,cores=2,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

Now I want to transfer this settings to an existing Win7 VM controlled via WebVirtmg. Here is my current configuration file:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>win7_test_vm</name>
  <uuid>a4040ddc-cb89-b885-5758-7cd84af1fc16</uuid>
  <description>None</description>
  <memory unit='KiB'>6291456</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='host-model'>
    <model fallback='allow'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/dev/lvmlocal/win7_test_vm'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/www/webvirtmgr/images/Microsoft.Windows.7.Ultimate.SP1.x64.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/www/webvirtmgr/images/virtio-win-0.1-81.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 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>
    <interface type='bridge'>
      <mac address='00:54:00:3d:df:01'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <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>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='de'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='apparmor' relabel='yes'/>
  <qemu:commandline>
    <qemu:arg value='-bios'/>
    <qemu:arg value='/usr/share/qemu/bios.bin'/>
    <qemu:arg value='-vga'/>
    <qemu:arg value='none'/>
    <qemu:arg value='-M'/>
    <qemu:arg value='q35'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='ahci,bus=pcie.0,id=ahci'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.1,bus=root.1,addr=00.1'/>
  </qemu:commandline>
</domain>

If I try to power up the VM I get this error:

internal error: process exited while connecting to monitor: qemu-system-x86_64: -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2: Bus 'pci.0' not found 

Anyone got an idea how to fix this?

Offline

#2490 2014-08-12 22:50:38

abdullah
Member
Registered: 2014-06-10
Posts: 34

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

@ monchi, the -smp should be 2, same as the # cores.
could you try to boot up from cmd first, just to make sure..?

Offline

#2491 2014-08-12 22:53:14

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

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

abdullah wrote:

@ monchi, the -smp should be 2, same as the # cores.
could you try to boot up from cmd first, just to make sure..?

You can actually just specify "-smp sockets=x,cores=y,threads=z", QEMU can do the math to figure out the total.


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

#2492 2014-08-12 23:14:57

abdullah
Member
Registered: 2014-06-10
Posts: 34

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

aw wrote:
abdullah wrote:

@ monchi, the -smp should be 2, same as the # cores.
could you try to boot up from cmd first, just to make sure..?

You can actually just specify "-smp sockets=x,cores=y,threads=z", QEMU can do the math to figure out the total.

will be testing that soon, thanks for the info, but what about the number just after the -smp tag?

I managed to set-up a windows 8 VM with Nvidia 760 GTX, updated to the latest drivers (no code errors), and I'm just working to get Opensuse to work with the 8500 GT. If I got the chance, I will be adding AMD 4790 HD ( which worked before I bought the 760 GTX ), I'm on Linux Mint 17 ( you need to add the packages yourself from debian testing and make sure to install the right tools, I did it through synaptic).

a side note, I got my windows key blocked, as a nice advise, isolate the windows guest with:

 -netdev user,id=mynet0,restrict=y 

Offline

#2493 2014-08-12 23:19:50

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

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

abdullah wrote:
aw wrote:
abdullah wrote:

@ monchi, the -smp should be 2, same as the # cores.
could you try to boot up from cmd first, just to make sure..?

You can actually just specify "-smp sockets=x,cores=y,threads=z", QEMU can do the math to figure out the total.

will be testing that soon, thanks for the info, but what about the number just after the -smp tag?

That's what I'm saying, it's unnecessary.  Once upon a time, -smp # was all QEMU understood.  Then people wanted to specify topology, so along came sockets, cores, and threads.  Obviously we can figure out the number of CPUs given just the latter, but the old way still exists for compatibility, and I suppose if you wanted to under populate your core... TBH, I'm not sure what happens when they're out of sync because I don't specify both.


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

#2494 2014-08-13 02:58:53

shazeal
Member
From: New Zealand
Registered: 2007-06-05
Posts: 341

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

Fira wrote:

- Synergy for mouse/keyboard sharing
Little offtopic, but If you plan to use Synergy, be aware that the AltGr key seems to be buggued...
Even applying the workarounds found around the net, it doesn't seem to help much.
I chose to just live with it and keep @s to copy/paste around : p
Otherwise perfs are very good. Just be aware you need to lock the mouse to your screen to use mouse-grabbing apps or they glitch.

Thanks for this, never knew about Synergy before, just made my life a zillion times easier. I was planning on getting a mechanical KVM but this... so much better!

One part I did not really understand is the locking of the mouse? How can you do this without the SDL window?

Offline

#2495 2014-08-13 08:16:21

dwe11er
Member
Registered: 2014-03-18
Posts: 73

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

shazeal wrote:
Fira wrote:

- Synergy for mouse/keyboard sharing
Little offtopic, but If you plan to use Synergy, be aware that the AltGr key seems to be buggued...
Even applying the workarounds found around the net, it doesn't seem to help much.
I chose to just live with it and keep @s to copy/paste around : p
Otherwise perfs are very good. Just be aware you need to lock the mouse to your screen to use mouse-grabbing apps or they glitch.

Thanks for this, never knew about Synergy before, just made my life a zillion times easier. I was planning on getting a mechanical KVM but this... so much better!

One part I did not really understand is the locking of the mouse? How can you do this without the SDL window?

Synergy can lock input on particular screen with key bind.

Offline

#2496 2014-08-13 23:19:53

deivid
Member
Registered: 2014-08-13
Posts: 5

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

I got this to work with vainilla 3.16, an existing windows installation BSOD's on boot, but I'll just reinstall and try again.

My question is ( I did not read the 100 pages of the thread so don't kill me if this has been posted before):

I am running this on a headless server and will try to use steam in home streaming to use it. Is there any way to disable the screen output? Just seems like a waste

Offline

#2497 2014-08-13 23:26:42

nbhs
Member
From: Montevideo, Uruguay
Registered: 2013-05-02
Posts: 402

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

deivid wrote:

I got this to work with vainilla 3.16, an existing windows installation BSOD's on boot, but I'll just reinstall and try again.

My question is ( I did not read the 100 pages of the thread so don't kill me if this has been posted before):

I am running this on a headless server and will try to use steam in home streaming to use it. Is there any way to disable the screen output? Just seems like a waste

You just need to read the first page to know why that might not work.

Offline

#2498 2014-08-14 13:11:20

d3lxa
Member
Registered: 2014-07-16
Posts: 4

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

When I applied the VGAARB patch of aw on 3.15 (and enabled i915.enable_hd_vgaarb=1) I had my host DRI disabled. I've read some posts saying people applying 81b5c7bc and 6e1b4fdad but it was back in 2013, what's the status right now? Is this normal to not have DRI although the patch purpose is to lie to Xorg so he does not see it?

I can say it solve the color glitch when the VM startup but the host cannot wake up reliably after suspend (tried twice, one failed). I could try a bit more to see if I was unlucky.

Offline

#2499 2014-08-14 14:51:29

irtimmer
Member
Registered: 2013-07-30
Posts: 4

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

DRI2 is still disabled when the VGA arbiter is used. But it looks like DRI3 don't suffer from that problem. Although is currently a little bit unstable and you have to recompile xf86-video-intel

Offline

#2500 2014-08-14 14:52:23

monchi
Member
Registered: 2014-07-21
Posts: 9

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

aw wrote:
abdullah wrote:

@ monchi, the -smp should be 2, same as the # cores.
could you try to boot up from cmd first, just to make sure..?

You can actually just specify "-smp sockets=x,cores=y,threads=z", QEMU can do the math to figure out the total.

thanks for the info. It works. But the error when trying to start the VM from webvirtmgr remains:

internal error: process exited while connecting to monitor: qemu-system-x86_64: -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2: Bus 'pci.0' not found

I think its a configuration failure. Here is my XML file again:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>win7_test_vm</name>
  <uuid>a4040ddc-cb89-b885-5758-7cd84af1fc16</uuid>
  <description>None</description>
  <memory unit='KiB'>6291456</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='host-model'>
    <model fallback='allow'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/dev/lvmlocal/win7_test_vm'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/www/webvirtmgr/images/Microsoft.Windows.7.Ultimate.SP1.x64.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/www/webvirtmgr/images/virtio-win-0.1-81.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 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>
    <interface type='bridge'>
      <mac address='00:54:00:3d:df:01'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <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>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='de'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='apparmor' relabel='yes'/>
  <qemu:commandline>
    <qemu:arg value='-bios'/>
    <qemu:arg value='/usr/share/qemu/bios.bin'/>
    <qemu:arg value='-vga'/>
    <qemu:arg value='none'/>
    <qemu:arg value='-M'/>
    <qemu:arg value='q35'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='ahci,bus=pcie.0,id=ahci'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.1,bus=root.1,addr=00.1'/>
  </qemu:commandline>
</domain>

Last edited by monchi (2014-08-14 15:05:08)

Offline

Board footer

Powered by FluxBB