HOW-TO make dual-boot obsolete using kvm VGA passthrough

Questions about virtualization software
Forum rules
Before you post please read how to get help
powerhouse
Level 5
Level 5
Posts: 987
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby powerhouse » Tue Aug 29, 2017 12:04 pm

juju wrote:Signed up to post a big thanks to powerhouse and all other linux mint users in this thread who contributed. I had tried to do a passthrough about 1.5 years ago on a different machine, but could not do ACS Override with my configuration. I built a new machine specs below, some parts missing.

I just got the kvm VGA passthrough working without an ACS Override patch. I had IOMMU grouping conflicts between both of my cards, but I updated my BIOS to the latest version and it split the PCI-E Video devices into their own IOMMU groupings. I read using the ACS Override patch is insecure, I doubt I would ever run into that issue but I am glad I got it to work without having to resort to using it. I had poor audio quality so I setup the Realtek ac97 audio drivers for the audio device and installed within the Windows 10 VM.

Machine
Host OS: Xubuntu 16.0.4
Guest OS: Windows 10 x64
CPU: AMD Ryzen 7 1800x - 12 Cores Guest - 4 Cores Host
Mobo: ASUS Crosshair VI Hero - 1501 BIOS Version
Host Card: AMD Firepro v7900
Guest: NVIDIA GTX 970 (Current Nvidia Driver)
RAM: 64GB (32GB per system right now)
Disks:
--Host: SSD - 500GB
--Guest: SSD - 1TB

I have a GTX 1050 TI SC I would like to get working but it was too difficult for me to find a way to assign a different driver to my 1050ti and the 970, whatever I put on one would go to the other. Either way for the time being the Firepro card I had kicking around did the trick. I am going to get back to messing around in the guest thanks again! Ill check back here at some point soon in-case anyone asks me any questions about the setup.


I'm glad you joined the club! It would be great if you could run some benchmark in the Windows VM so to get an idea of how it performs. See my post above.

Actually, you should be able to get your GTX 1050 working under Linux, and it shouldn't be that difficult either. You need to blacklist the nouveau driver (see tutorial). Also make sure that your GTX 970 is attached to the vfio-pci driver (use the initramfs method described in the tutorial) - since you already have VGA passthrough working, your settings should be fine.

Linux Mint comes with a convenient proprietary drivers manager. Check your GTX 1050 and select a proprietary driver. Make sure that your GTX 970 uses the Opensource (nouveau) driver. Install and reboot.

EDIT: Perhaps this may help for Xubuntu: https://sites.google.com/site/easylinuxtipsproject/first-xubuntu#TOC-Install-missing-drivers

Like you, I have two different Nvidia cards - one for the host (a Quadro 2000), one for the Windows VM (GTX 970). Once I discovered the trick with the proprietary driver selection, all was fine. See the troubleshooting section for more.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3 RAM, Noctua NH-D14 CPU cooler, Gigabyte GTX 970 + PNY Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk Extreme 120GB + Samsung EVO 850 250GB SSD + 5 HDD, Corsair 500R case, SeaSonic 660W Gold X PS

juju
Level 1
Level 1
Posts: 7
Joined: Sun Aug 27, 2017 9:45 pm

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby juju » Tue Aug 29, 2017 4:23 pm

I purchased some Benchmarking Software (3DMark/PCMark) last night so I can start to run some tests with different configs/drivers, I will also review your post and get the windows scores ASAP (at work right now). I actually tried it the first night I got it working but hit an issue complaining about my realtime clock or something, I did not work through this yet.

I was a bit disheartened last night because my Video Game Rendering performance seemed to degrade to an unusable state over night magically o_o After a little troubleshooting I narrowed it down to the Windows 10 "Creator Update" that was automatically installed just before I turned my VM off the night before, it was the only thing that changed with the setup. Before the Windows 10 Creator Update I noticed no issues in any application I tested felt like using Native hardware. I decided to roll my Windows 10 build back to before the update and reinstalled my video drivers as they got removed during the rollback and my performance was back to normal. If I keep running into issues with Windows 10 x64, I might just go ahead and use Windows 7 x64 Ultimate.

I did the Passthrough specifically to play Native Windows games, I used a recent game "Elder Scrolls Online" as a way to benchmark my performance in the VM temporarily, I have almost everything cranked to Max, noticed no issues with FPS/performance after I had rolled back the OS version to before Creator Update. With the Creator Update version of Windows 10 it was basically a slideshow. Audio with the ac97 device I created did not work as well as I had liked, still lots of distortion. I found a USB Sound card in my room and just passed it through, now my Audio is Fantastic! I am looking at getting an ASUS or Soundblaster Soundcard to passthrough permanently.

I inadvertently did some Networking Benchmarking, I downloaded ~70GB worth of Games from Steam at an average of ~7mbps. I also get roughly about this speed when downloading games using native hardware so I was impressed it was not much slower.

Probably sometime this week or weekend, I will try and use my 1050, I might also try to use Linux Mint. I have no loyalty with distros, really I just prefer using Debian distros with xfce4 as I have my own theme I made. I know Linux Mint is debian so I will probably feel right at home. Thanks again for all the effort to make this thread/update it, I also checked out your Blog page! I have linked both to a few colleagues who have tried to do this also in the past years but failed.

Cheers,
juju

powerhouse
Level 5
Level 5
Posts: 987
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby powerhouse » Wed Aug 30, 2017 4:00 am

@juju: Thanks for the reply. I hope you didn't buy the benchmarking software because of my request. Passmark can be had for a trial, and the userbenchmark I suggest now is free.

The good things about benchmarks is that it allows you to compare with similar configurations, and to discover problems in the configuration. With KVM there are a number of performance issues one may run into. The settings I've given in the how-to have worked well for me, and it seems with many other people too.

Networking speed: With a bridge set up you should get somewhere around 10Gbit between the host and the VM. This is a transfer speed of about 1.2GB/s - no SSD is fast enough for that. Of course, Internet speed is something different.

I'm using Win 10 with the creators update, but have tweaked the settings after installation. If you install Windows 7, make sure you can UEFI boot the Windows ISO.

Sound: It took me a while to get decent sound. The best way is to do what you did - pass through a sound card. I'm currently using the following in my script, which offers good sound without the crackling noise:

Code: Select all

export QEMU_AUDIO_DRV=alsa
export QEMU_ALSA_ADC_BUFFER_SIZE=1024 QEMU_ALSA_ADC_PERIOD_SIZE=256
export QEMU_ALSA_DAC_BUFFER_SIZE=1024 QEMU_ALSA_DAC_PERIOD_SIZE=256
export QEMU_AUDIO_DAC_FIXED_SETTINGS=1
export QEMU_AUDIO_DAC_FIXED_FREQ=44100 QEMU_AUDIO_DAC_FIXED_FMT=S16 QEMU_AUDIO_ADC_FIXED_FREQ=44100 QEMU_AUDIO_ADC_FIXED_FMT=S16
export QEMU_AUDIO_DAC_TRY_POLL=1 QEMU_AUDIO_ADC_TRY_POLL=1
export QEMU_AUDIO_TIMER_PERIOD=50

The qemu option then is:

Code: Select all

  -soundhw hda \


Obviously, your solution is better. Another option is to use a USB audio stick. There are some real good ones (audiophile quality). In that case I would pass through a USB controller.

I recently posted my Unigine Heaven benchmark (yet another free graphics benchmark) over at the overclock.net forum: http://www.overclock.net/t/1235557/official-top-30-heaven-benchmark-4-0-scores/3590#post_26293511

It's not breathtaking, but absolutely comparable with other GTX970 benchmarks that were posted there (all others were overclocked, mine not).

You should be able to play Windows games on your VM and not notice any difference.

Don't switch to Linux Mint just because my how-to is written for it. You can replace the xed commands with gedit and it works the same in Ubuntu/Xubuntu. Stick with the distribution you feel most comfortable with. Look at my last post regarding how to get the 1050 work with your 970. I'm sure you'll make it work.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3 RAM, Noctua NH-D14 CPU cooler, Gigabyte GTX 970 + PNY Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk Extreme 120GB + Samsung EVO 850 250GB SSD + 5 HDD, Corsair 500R case, SeaSonic 660W Gold X PS

HPMint
Level 1
Level 1
Posts: 23
Joined: Mon Aug 18, 2014 10:56 am

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby HPMint » Wed Aug 30, 2017 4:42 pm

Hi everybody!

Thank you powerhouse for this How-to.

If win10 starts without problem, use it is impossible: without mouse and keyboard, it's ... difficult :mrgreen:

Some data about my hardware:
CPU: i7 7700K
MB: Asrock Z270 Taichi
RAM: 32Gb (16/16 win/linux)
GPU: 1080 Ti
Keyboard: Corsair K70
Mouse: Corsair M65

OS: Linux Mint 18.2
QEMU: 2.9 (I've build it myself).

I have a KVM USB 3.0 with 2 output ports and 1 input : I plugged an USB 3.0 hub, with keyboard and mouse plugged on it. The KVM is plugged on Intel USB 3.0 and ASMedia USB 3.0 on the MB.

This is the IOMMU groups:

Code: Select all

IOMMU Group 00 00:00.0 Host bridge [0600]: Intel Corporation Device [8086:591f] (rev 05)
IOMMU Group 01 00:01.0 PCI bridge [0604]: Intel Corporation Sky Lake PCIe Controller (x16) [8086:1901] (rev 05)
IOMMU Group 01 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:1b06] (rev a1)
IOMMU Group 01 01:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:10ef] (rev a1)
IOMMU Group 02 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:5912] (rev 04)
IOMMU Group 03 00:14.0 USB controller [0c03]: Intel Corporation Device [8086:a2af]
IOMMU Group 03 00:14.2 Signal processing controller [1180]: Intel Corporation Device [8086:a2b1]
IOMMU Group 04 00:16.0 Communication controller [0780]: Intel Corporation Device [8086:a2ba]
IOMMU Group 05 00:17.0 SATA controller [0106]: Intel Corporation Device [8086:a282]
IOMMU Group 06 00:1b.0 PCI bridge [0604]: Intel Corporation Device [8086:a2e7] (rev f0)
IOMMU Group 07 00:1c.0 PCI bridge [0604]: Intel Corporation Device [8086:a290] (rev f0)
IOMMU Group 08 00:1c.2 PCI bridge [0604]: Intel Corporation Device [8086:a292] (rev f0)
IOMMU Group 09 00:1c.4 PCI bridge [0604]: Intel Corporation Device [8086:a294] (rev f0)
IOMMU Group 10 00:1d.0 PCI bridge [0604]: Intel Corporation Device [8086:a298] (rev f0)
IOMMU Group 11 00:1d.6 PCI bridge [0604]: Intel Corporation Device [8086:a29e] (rev f0)
IOMMU Group 12 00:1d.7 PCI bridge [0604]: Intel Corporation Device [8086:a29f] (rev f0)
IOMMU Group 13 00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:a2c5]
IOMMU Group 13 00:1f.2 Memory controller [0580]: Intel Corporation Device [8086:a2a1]
IOMMU Group 13 00:1f.3 Audio device [0403]: Intel Corporation Device [8086:a2f0]
IOMMU Group 13 00:1f.4 SMBus [0c05]: Intel Corporation Device [8086:a2a3]
IOMMU Group 14 00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (2) I219-V [8086:15b8]
IOMMU Group 15 03:00.0 USB controller [0c03]: ASMedia Technology Inc. Device [1b21:2142]
IOMMU Group 16 04:00.0 PCI bridge [0604]: ASMedia Technology Inc. Device [1b21:1184]
IOMMU Group 17 05:01.0 PCI bridge [0604]: ASMedia Technology Inc. Device [1b21:1184]
IOMMU Group 17 06:00.0 Network controller [0280]: Intel Corporation Wireless 3160 [8086:08b3] (rev 83)
IOMMU Group 18 05:03.0 PCI bridge [0604]: ASMedia Technology Inc. Device [1b21:1184]
IOMMU Group 18 07:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Connection [8086:1539] (rev 03)
IOMMU Group 19 05:05.0 PCI bridge [0604]: ASMedia Technology Inc. Device [1b21:1184]
IOMMU Group 19 08:00.0 SATA controller [0106]: ASMedia Technology Inc. ASM1062 Serial ATA Controller [1b21:0612] (rev 02)
IOMMU Group 20 05:07.0 PCI bridge [0604]: ASMedia Technology Inc. Device [1b21:1184]
IOMMU Group 20 09:00.0 SATA controller [0106]: ASMedia Technology Inc. ASM1062 Serial ATA Controller [1b21:0612] (rev 02)
IOMMU Group 21 0c:00.0 USB controller [0c03]: Fresco Logic FL1100 USB 3.0 Host Controller [1b73:1100] (rev 01)


The USB info by IOMMU:

Code: Select all

Bus 1 --> 0000:00:14.0 (IOMMU group 3)                           <=============== Intel Controller [8086:a2af]
Bus 001 Device 005: ID 8087:07dc Intel Corp.
Bus 001 Device 003: ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed hub
Bus 001 Device 010: ID 1b1c:0a03 Corsair
Bus 001 Device 008: ID 1b1c:1b31 Corsair
Bus 001 Device 015: ID 1b1c:1b38 Corsair                          <========================= Mouse or Keyboard
Bus 001 Device 013: ID 2109:2812 VIA Labs, Inc. VL812 Hub
[b]Bus 001 Device 014: ID 1b1c:1b2e Corsair                       <========================= Mouse or Keyboard
Bus 001 Device 012: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 001 Device 011: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 2 --> 0000:00:14.0 (IOMMU group 3)
Bus 002 Device 003: ID 174c:3074 ASMedia Technology Inc. ASM1074 SuperSpeed hub
Bus 002 Device 010: ID 11b0:6348 ATECH FLASH TECHNOLOGY
Bus 002 Device 009: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 002 Device 008: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 002 Device 007: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 3 --> 0000:03:00.0 (IOMMU group 15)                           <=============== ASMedia Controller [1b21:2142]
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 4 --> 0000:03:00.0 (IOMMU group 15)
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 5 --> 0000:0c:00.0 (IOMMU group 21)                           <=============== Fresco Controller [1b73:1100]
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 6 --> 0000:0c:00.0 (IOMMU group 21)
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub


The grub line:

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT="modprobe.blacklist=nouveau quiet intel_iommu=on"


The modprobe.d/local.conf:

Code: Select all

options vfio-pci ids=10de:1b06,10de:10ef


The vfio-pci.cfg (for Ethernet & USB Controllers) :

Code: Select all

0000:00:1f.6
0000:03:00.0


The initramfs-tools/modules:

Code: Select all

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
#vhost-net


I've commented vhost-net as I passthrough an ethernet controller.

And my script to start the VM:

Code: Select all

#!/bin/bash

vmname="windows10vm"

configfile=/etc/vfio-pci.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
}

if ps -A | grep -q $vmname; then
   echo "$vmname is already running." &
   exit 1

else

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

cp /usr/share/OVMF/OVMF_VARS.fd /tmp/my_vars.fd

qemu-system-x86_64 \
  -name $vmname,process=$vmname \
  -machine type=q35,accel=kvm \
  -cpu host,kvm=off \
  -smp 4,sockets=1,cores=2,threads=2 \
  -m 16G \
  -mem-path /run/hugepages/kvm \
  -mem-prealloc \
  -balloon none \
  -rtc clock=host,base=localtime \
  -serial none \
  -nographic \
  -vga none \
  -parallel none \
  -device vfio-pci,host=01:00.0,multifunction=on \
  -device vfio-pci,host=01:00.1 \
  -device vfio-pci,host=00:1f.6 \
  -device vfio-pci,host=03:00.0 \
  -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \
  -drive if=pflash,format=raw,file=/tmp/my_vars.fd \
  -drive id=BootWin,if=none,format=raw,file=/dev/disk/by-id/ata-Crucial_CT480M500SSD1_xxxxxxx \
  -device virtio-blk-pci,drive=BootWin \
  -drive id=WinData,if=none,format=raw,file=/dev/disk/by-id/ata-SAMSUNG_HD204UI_yyyyyyy \
  -device virtio-blk-pci,drive=WinData \
  -drive id=Games1,if=none,format=raw,file=/dev/disk/by-id/ata-ST2000DM001-1ER164_zzzzzzz \
  -device virtio-blk-pci,drive=Games1 \
  -drive id=Games2,if=none,format=raw,file=/dev/disk/by-id/ata-ST2000DM001-1ER164_wwwwwww \
  -device virtio-blk-pci,drive=Games2 \
  -drive id=Divers,if=none,format=raw,file=/dev/disk/by-id/ata-ST31000524AS_vvvvvvvv \
  -device virtio-blk-pci,drive=Divers



And now, my problems:
- Sound: I was unable to have a good sound with hda (a lot of clicks), so I plugged the headset output of my windows screen into the line-in of Linux.
- Ethernet: I've manage to passthrough one of the 2 ethernet controller and it works. The bridge never worked. Don't know why...
- Disk: BootWin is a SSD... but Windows do not see it as is. I've tried to passthrough the SATA Controller. No success: Windows do not boot, got a black screen.
- And USB: a NIGHTMARE! I think I've tried all I can to have my keyboard and mouse, but each time, after some time, Windows loose the USB, keyboard and mouse goes offline with the sound as if I've unplug any USB device. With another mouse, (passed by -usb -usbdevice), if I deactivate/activate the usb controller in Windows, it comes back... to go down sometime later.
Sometimes it takes several hours before failure, sometimes, it takes a few minutes.
I've tried to switch to -usb -usbdevice host:1b1c:1b2e -usbdevice host:1b1c:1b38 (and removing the passthrough of USB Controller) but the VM do not even start or is super-slow and USB is not passed, it continues to work under Linux! I don't understand: if I plugged and pass another mouse/kb this way, it works fine...

All my search for the past week on the net and tries never work. I've installed the Fresco Controller to try with. It's worse: sometimes id is 0b:00.0 sometimes 0c:00.0, sometimes USB never even init...

I'm totally lost, I'm desperate! :cry: :cry:

Can someone help me? I can do any test you think of. If you want any log, data, please tell me where or how to find them.

powerhouse
Level 5
Level 5
Posts: 987
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby powerhouse » Thu Aug 31, 2017 6:50 am

HPMint wrote:Some data about my hardware:
CPU: i7 7700K
MB: Asrock Z270 Taichi
RAM: 32Gb (16/16 win/linux)
GPU: 1080 Ti
Keyboard: Corsair K70
Mouse: Corsair M65

OS: Linux Mint 18.2
QEMU: 2.9 (I've build it myself).

I have a KVM USB 3.0 with 2 output ports and 1 input : I plugged an USB 3.0 hub, with keyboard and mouse plugged on it. The KVM is plugged on Intel USB 3.0 and ASMedia USB 3.0 on the MB.

...

And now, my problems:
- Sound: I was unable to have a good sound with hda (a lot of clicks), so I plugged the headset output of my windows screen into the line-in of Linux.
- Ethernet: I've manage to passthrough one of the 2 ethernet controller and it works. The bridge never worked. Don't know why...
- Disk: BootWin is a SSD... but Windows do not see it as is. I've tried to passthrough the SATA Controller. No success: Windows do not boot, got a black screen.
- And USB: a NIGHTMARE! I think I've tried all I can to have my keyboard and mouse, but each time, after some time, Windows loose the USB, keyboard and mouse goes offline with the sound as if I've unplug any USB device. With another mouse, (passed by -usb -usbdevice), if I deactivate/activate the usb controller in Windows, it comes back... to go down sometime later.
Sometimes it takes several hours before failure, sometimes, it takes a few minutes.
I've tried to switch to -usb -usbdevice host:1b1c:1b2e -usbdevice host:1b1c:1b38 (and removing the passthrough of USB Controller) but the VM do not even start or is super-slow and USB is not passed, it continues to work under Linux! I don't understand: if I plugged and pass another mouse/kb this way, it works fine...

All my search for the past week on the net and tries never work. I've installed the Fresco Controller to try with. It's worse: sometimes id is 0b:00.0 sometimes 0c:00.0, sometimes USB never even init...

I'm totally lost, I'm desperate! :cry: :cry:

Can someone help me? I can do any test you think of. If you want any log, data, please tell me where or how to find them.


1. For sound, try this:

Code: Select all

#use ALSA
export QEMU_AUDIO_DRV=alsa
export QEMU_ALSA_ADC_BUFFER_SIZE=1024 QEMU_ALSA_ADC_PERIOD_SIZE=256
export QEMU_ALSA_DAC_BUFFER_SIZE=1024 QEMU_ALSA_DAC_PERIOD_SIZE=256
export QEMU_AUDIO_DAC_FIXED_SETTINGS=1
export QEMU_AUDIO_DAC_FIXED_FREQ=44100 QEMU_AUDIO_DAC_FIXED_FMT=S16 QEMU_AUDIO_ADC_FIXED_FREQ=44100 QEMU_AUDIO_ADC_FIXED_FMT=S16
export QEMU_AUDIO_DAC_TRY_POLL=1 QEMU_AUDIO_ADC_TRY_POLL=1
export QEMU_AUDIO_TIMER_PERIOD=50


2. Bridge setup can be a pain in the neck. Instead of removing Network Manager, I'm now using it to configure the bridge. See Define a network bridge using Ubuntu’s / Linux Mint’s Network Manager application - sorry, but the forum limitations make it impossible to post tutorials with many pictures.
Your solution is perfectly OK.

3. BootWin SSD: In my tutorial I describe how to have Windows detect an SSD. Did you follow that? Or am I misunderstanding your post?

4. USB mouse and keyboard: Remove the USB KVM switch and connect your mouse and keyboard directly to the passed through USB ports. How does that work? If that solves the problem, return your KVM switch to the shop for refund.

I had the exact same issue with my USB KVM switch. Over time, the mouse / keyboard would stop working. Connecting the keyboard/mouse directly to the USB solved the issue.

Many USB KVM switches are simply garbage. The best solution is probably Synergy. Another solution are multi-device keyboards and mice. I now use a Logitech K780 multi-device wireless keyboard and a Logitech MX Master wireless mouse (also multi-device), both pretty expensive, but they do their job.

Some remarks and questions on your configuration:

a. I hate to see that a newer CPU such as the Intel 7700K is actually worse in terms of IOMMU and ACS compared to my old 3930K. Intel could have done better.
b. Why did you compile qemu 2.9? Was it needed to get VGA passthrough working? I run the standard qemu 2.5 that comes with Linux Mint and it works fine.
c. How is your WinBoot SSD configured? Is it an NTFS disk, a LVM disk, etc.? Did/does it hold your "bare metal" Windows installation?
If you pass through the WinBoot SSD's SATA controller, then WinBoot better be a native Windows disk with boot sector and everything. Else it won't work.
d. Did you try to configure the bridge using Network Manager, or did you use the bridge-utils tools?

Looks like you got a great gaming setup. Once the issues are sorted out, would you mind to post some benchmarks (see my previous 2-3 posts above)?
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3 RAM, Noctua NH-D14 CPU cooler, Gigabyte GTX 970 + PNY Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk Extreme 120GB + Samsung EVO 850 250GB SSD + 5 HDD, Corsair 500R case, SeaSonic 660W Gold X PS

HPMint
Level 1
Level 1
Posts: 23
Joined: Mon Aug 18, 2014 10:56 am

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby HPMint » Thu Aug 31, 2017 6:39 pm

Thank you for your interest in my problems.

powerhouse wrote:1. For sound, try this:

Code: Select all

#use ALSA
export QEMU_AUDIO_DRV=alsa
export QEMU_ALSA_ADC_BUFFER_SIZE=1024 QEMU_ALSA_ADC_PERIOD_SIZE=256
export QEMU_ALSA_DAC_BUFFER_SIZE=1024 QEMU_ALSA_DAC_PERIOD_SIZE=256
export QEMU_AUDIO_DAC_FIXED_SETTINGS=1
export QEMU_AUDIO_DAC_FIXED_FREQ=44100 QEMU_AUDIO_DAC_FIXED_FMT=S16 QEMU_AUDIO_ADC_FIXED_FREQ=44100 QEMU_AUDIO_ADC_FIXED_FMT=S16
export QEMU_AUDIO_DAC_TRY_POLL=1 QEMU_AUDIO_ADC_TRY_POLL=1
export QEMU_AUDIO_TIMER_PERIOD=50



I keep that for later. My priority is the USB. Using the HDMI=>screen headset=>line-in=>real headset resolves two : while having the clicks, I've seen that video and sound desynchronize when playing youtube videos. Perhaps using your proposition would work. But I prefer to focus: one problem at a time. :)

powerhouse wrote:2. Bridge setup can be a pain in the neck. Instead of removing Network Manager, I'm now using it to configure the bridge. See Define a network bridge using Ubuntu’s / Linux Mint’s Network Manager application - sorry, but the forum limitations make it impossible to post tutorials with many pictures.
Your solution is perfectly OK.


I've done what your how-to say: using Network manager to define the bridge. Windows was having an IP outside of my network (10.xx... instead of 192.168....), could not join the gateway even if force the values, etc. And passing through a controller was more simple if I need to unplug the windows from network and not Linux. By the way under windows, I have now 2 ethernet connections... I've read that qemu automatically create a network if no -netdev option is specified.
It's a detail in which I'll dig later.

powerhouse wrote:3. BootWin SSD: In my tutorial I describe how to have Windows detect an SSD. Did you follow that? Or am I misunderstanding your post?


I was stuck some days on drives subject. I followed your tutorial and try to add my 5 HDD (1 SSD & 4 HDD) and a CD drive... I fall into the limitation of 4 drives max. Your tuto use the IDE bus built-in qemu, which is limited to 4 drives. But with the help of the links to post about drives optimizations, I've understand a lot and figured how to add SATA controllers with virtio-blk-pci (or virtio-scsi-pci).
So I use the lines:
-drive id=BootWin,if=none,format=raw,file=/dev/disk/by-id/ata-Crucial_CT480M500SSD1_xxxxxxx \
-device virtio-blk-pci,drive=BootWin \
to give the full disk for Windows boot (xxxxxxx are only the serial number, no part in it).
But now that you're asking... I know I've done the winsat formal, but I do not remember if it was before or after my conf with virtio-blk-pci...
I'll replay it... (see next paragraph).

powerhouse wrote:4. USB mouse and keyboard: Remove the USB KVM switch and connect your mouse and keyboard directly to the passed through USB ports. How does that work? If that solves the problem, return your KVM switch to the shop for refund.

I had the exact same issue with my USB KVM switch. Over time, the mouse / keyboard would stop working. Connecting the keyboard/mouse directly to the USB solved the issue.

Many USB KVM switches are simply garbage. The best solution is probably Synergy. Another solution are multi-device keyboards and mice. I now use a Logitech K780 multi-device wireless keyboard and a Logitech MX Master wireless mouse (also multi-device), both pretty expensive, but they do their job.


That's a try I've done: keyboard+mouse use 3 USB ports. I've plugged them on the fresco controller and try to passthrough the controller... And I think it worked... (I should have write down all my tests and results). I think it worked, but as soon as I stop windows, mouse and keyboard were no more usable as the controller was no more visible for Linux.
I've just replay these tests:
- USB hub plugged: does not work
- kn&m plugged directly on the fresco card: it works fine... for USB (I don't know how long it will last). But boot was chaotic: Tianno screen for several seconds, then an error message "can't boot on CD/DVD", black screen a few seconds, then windows login screen. Tried winsat command and few hours later, it's not over! And shutdown is not possible, even with system_powerdown in qemu command line!
Next boot was fine. Winsat executes with errors like "ERROR: no adapter for device 0" but it progress.
WEI is 8.1. (and SSD is detected! :mrgreen: )

So, it seems to work. Let's say its stable, there's no problem under Windows: how can I have back kb&m under Linux without going under the desk to plug them on another usb?...

I have Synergy... but windows must be my server: I can have some lag on my linux when I use Windows for video, but not while gaming on Windows.

Multi-device kb & mouse are not an option for me: I'm too much in love with mechanical KB :oops:

powerhouse wrote:Some remarks and questions on your configuration:

a. I hate to see that a newer CPU such as the Intel 7700K is actually worse in terms of IOMMU and ACS compared to my old 3930K. Intel could have done better.
b. Why did you compile qemu 2.9? Was it needed to get VGA passthrough working? I run the standard qemu 2.5 that comes with Linux Mint and it works fine.
c. How is your WinBoot SSD configured? Is it an NTFS disk, a LVM disk, etc.? Did/does it hold your "bare metal" Windows installation?
If you pass through the WinBoot SSD's SATA controller, then WinBoot better be a native Windows disk with boot sector and everything. Else it won't work.
d. Did you try to configure the bridge using Network Manager, or did you use the bridge-utils tools?

Looks like you got a great gaming setup. Once the issues are sorted out, would you mind to post some benchmarks (see my previous 2-3 posts above)?


a. Before, I was having a i7-4970, and it was even worse!
b. With all my problems with USB, I've done some research and following google links I've come on the qemu project page. I've seen the 2.8, 2.9 and future 2.10, read the change log and found that 2.9 resolves USB 3 problems, which seems to be my case. So, let's build it 8) The first time, lsusb option was not active... It's nothing to say that it was worse than 2.5 :mrgreen:
c. WinBoot is GPT, entirely for Windows which automatically partitioned it at install. Just the virtio drivers installed during installation.
d. Network Manager as you describe.

And no problem for benchmarking my setup. Games are only a part of the use of this setup. Video are another one.
And I've a GTX 980 for Linux, as my goal is to play on Linux as long as games offer it for a part, and I' seen some problem with kodi when playing videos when Windows was running. I suppose that decoding video with the cpu while gaming on windows is a little to much.

Ah! And sorry if sometimes my english is weird, it's not my mother tongue, but I try to do my best and learn too. :roll:
Last edited by HPMint on Fri Sep 01, 2017 5:13 pm, edited 1 time in total.

juju
Level 1
Level 1
Posts: 7
Joined: Sun Aug 27, 2017 9:45 pm

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby juju » Fri Sep 01, 2017 12:55 pm

powerhouse wrote:--snip--


I got the software out of personal curiosity, I was interested in how well my machine would perform compared to some of my friends scores and to hardware running nativley on Windows.

Before I switched my setup, I ran the Heaven Benchmark, with recommended settings from that overclock thread you linked. I had 54.4fps overall and a score of 1371 if I remember correctly. I ran that same benchmark also on my brothers native Windows 7 gaming machine he plays all day everyday (no job), his score was like 975 cant remember the fps average like 28 or 38, he has no problems playing games even new ones at a fairly competitive level. I don't think the guy cataloging the benchmarks realized how cool/usable your setup is when you posted your score, their is no slideshow with our setups :) I am amazed that this works so well, I even forget I am using a VM after playing games for awhile. Here is my User-benchmark: http://www.userbenchmark.com/UserRun/4829650 also I did on that machine. I had issues with Passmark being able to launch, I added the msrs which looks like it will fix it but I have not tried again. I moved my Windows 10 disk image to a non solid state last night before I reformatted so the benchmark speed for disk went down when I tested it again. Ill move it back to my SSD/ or get the Windows 7 setup.

I installed Linux Mint to test it out I also switched my Video card so the 1050 and 970 is now in the machine instead of the Firepro. I also switched my disk drives up I had initially I had my 500gb ssd for the guest and 1tb ssd for the host, this is reversed now. I think my cards always worked fine I may have just been confusing myself, I was expecting to see both NVIDIA cards in the Proprietary Driver dialog. But I just applied everything and rebooted and was all good! Linux mint looks like a great distro, I ran my default setup config and it updated it to my liking. I notice no problems with it in-fact it is better than my previous OS, it came with gufw and other pieces of software installed by default that I typically scramble to add :)

After I installed Linux mint, I modified my launcher script to point to my backed up windows 10 image file, I copied it over to a non SSD before formatting the disks, and I was surprised to see it just worked even after being moved around (super cool it was a ~450gb file). I ran benchmarks on it after setting up Linux Mint, but the run was worse just with the disk drive being a 3TB non-SSD. I'll get passmark and some more scores later and add them to your other thread, after I move the Windows 7 and 10 back to SSD.

I toiled with Windows 7 Installer for awhile last night but with not much success :0 I kept getting stuck at the Starting Windows dialog, uefi problems most likely. I started making a UEFI compatible usb installer but used a USB3 device and had issues with the speed when passing through. I will try again with USB2 and maybe using the Rufus installer like suggested by another user. I might as well use my Win10 vm to make it >:) I broke down and bought a ASUS pcie sound card, it should arrive tomorrow so I want to try using that instead of the USB device. I was using the USB device on my Linux machine to record audio streams in, so passing it through for games was not a long term solution.

If you have any suggestions on ways to tweak the performance of the VM further let me know, I would be interested in learning about any optimizations I could set on Windows or in qemu that would increase the performance. I did some of the basic things like High-performance power mode, and disabled the visual settings etc. Disable game dvr etc. One thing that is interesting to me is, my brothers user-benchmark (don't have it), showed he had 2% background cpu usage with Windows 7. Windows 10 I had some runs with 14-22% background usage, seems like better scores could be achievable on Windows 7 based on background usage alone. Or does that background rating notice whats happening with the other 4 cores I did not pass-through?

You mentioned you view your Guests disk files from your Host machine, if you have a link or explanation for this might be nice. I did not try mounting my img file maybe its just simple as that.

HPMint
Level 1
Level 1
Posts: 23
Joined: Mon Aug 18, 2014 10:56 am

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby HPMint » Sat Sep 02, 2017 12:18 pm

HPMint wrote:
powerhouse wrote:4. USB mouse and keyboard: Remove the USB KVM switch and connect your mouse and keyboard directly to the passed through USB ports. How does that work? If that solves the problem, return your KVM switch to the shop for refund.

I had the exact same issue with my USB KVM switch. Over time, the mouse / keyboard would stop working. Connecting the keyboard/mouse directly to the USB solved the issue.

Many USB KVM switches are simply garbage. The best solution is probably Synergy. Another solution are multi-device keyboards and mice. I now use a Logitech K780 multi-device wireless keyboard and a Logitech MX Master wireless mouse (also multi-device), both pretty expensive, but they do their job.


That's a try I've done: keyboard+mouse use 3 USB ports. I've plugged them on the fresco controller and try to passthrough the controller... And I think it worked... (I should have write down all my tests and results). I think it worked, but as soon as I stop windows, mouse and keyboard were no more usable as the controller was no more visible for Linux.
I've just replay these tests:
- USB hub plugged: does not work
- kn&m plugged directly on the fresco card: it works fine... for USB (I don't know how long it will last). But boot was chaotic: Tianno screen for several seconds, then an error message "can't boot on CD/DVD", black screen a few seconds, then windows login screen. Tried winsat command and few hours later, it's not over! And shutdown is not possible, even with system_powerdown in qemu command line!
Next boot was fine. Winsat executes with errors like "ERROR: no adapter for device 0" but it progress.
WEI is 8.1. (and SSD is detected! :mrgreen: )

So, it seems to work. Let's say its stable, there's no problem under Windows: how can I have back kb&m under Linux without going under the desk to plug them on another usb?...

I have Synergy... but windows must be my server: I can have some lag on my linux when I use Windows for video, but not while gaming on Windows.

Multi-device kb & mouse are not an option for me: I'm too much in love with mechanical KB :oops:


I've tried to activate XHCI hand-off in BIOS: no improvement. If the kb is plugged directly on the usb controller and the mouse on the KVM, no problem, I can play for hours. I'll try to plug a BT USB dongle directly on the card...

Passmark won't run :( Without "ignore_msrs=1", Windows 10 crash. With it, each time I run the test, I have the error 4. I've tried safemode, debugmode, nothing, passmark won't run :(

powerhouse
Level 5
Level 5
Posts: 987
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby powerhouse » Sat Sep 02, 2017 3:57 pm

@HPMint: I agree - leave your sound setup, it works!

2. If you have configured your network using brctl or editing the /etc/network/interfaces file, there might be remnants of the configuration left that mess up a Network Manager configuration. When using Network Manager to configure the bridge, you should see the following interfaces:

Screenshot at 2017-09-02 13-58-52.png


When the VM is running, I get this Connection Information:

Screenshot at 2017-09-02 14-40-39.png


3. Drive configuration: Good that you found the solution - my drive configuration is very simple.

4. PCI passthrough: Once you pass through a PCI controller to the guest, when you shut down the guest the PCI controller does not automatically release and you need to manually (or via script) make it available to Linux. See the virsh command (can't remember the exact command).
It looks like you need to get rid of your KVM switch and USB hub. I forget to mention in my previous post that my USB hubs also had issues and would disconnect devices or simply not work. Now I'm free of this garbage and everything works.

You got too many errors, but try to restart Windows a few times and see if it goes away - sometimes Windows needs some time to install all the new drivers (or detect that a device is gone). It's called "plug and pray".

I hope very much that connecting you kb/m directly will solve the issues. You can use Synergy - a software solution - to use your kb/m in both Linux and Windows. Else, check out virsh.

Good luck!

(I'm going on a cruise for a week so won't be able to answer much.)

EDIT: For Passmark to work, you need the ignore_msrs... as written in the tutorial!
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3 RAM, Noctua NH-D14 CPU cooler, Gigabyte GTX 970 + PNY Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk Extreme 120GB + Samsung EVO 850 250GB SSD + 5 HDD, Corsair 500R case, SeaSonic 660W Gold X PS

powerhouse
Level 5
Level 5
Posts: 987
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby powerhouse » Sat Sep 02, 2017 4:22 pm

@juju: I noticed you use the standard "pc" (fx440) machine instead of "q35" - see my start script. In my case the "pc" (fx440) option always delivered bad performance. You cannot just change this option but would need to reinstall Windows. However, I have no idea which option is better for Ryzen.

Background CPU: It might be because it is a new installation of Windows and Windows is still indexing files etc. There are some Windows tweaking options that you can do - search the Internet as I don't recall them all. Regarding kvm/qemu I already mentioned everything in my tutorial. Have a look at my latest version here: https://heiko-sieger.info/running-windows-10-on-linux-using-kvm-with-vga-passthrough/.

Thanks for the benchmarks. Your GTX 970 bare metal performance is a little better than my GTX 970 VM performance - we are talking 2 fps better. You could run the Unigine Heaven benchmark in your Windows VM and compare the results. That would give you a good indication how well passthrough is working. The expected difference is a few %.

I look forward to see your Passmark results when running on SSD.

Windows 7: Make sure you got a Windows 7 install ISO that uses UEFI, else my how-to won't work.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3 RAM, Noctua NH-D14 CPU cooler, Gigabyte GTX 970 + PNY Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk Extreme 120GB + Samsung EVO 850 250GB SSD + 5 HDD, Corsair 500R case, SeaSonic 660W Gold X PS

HPMint
Level 1
Level 1
Posts: 23
Joined: Mon Aug 18, 2014 10:56 am

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby HPMint » Sat Sep 02, 2017 7:23 pm

powerhouse wrote:@HPMint: I agree - leave your sound setup, it works!

2. If you have configured your network using brctl or editing the /etc/network/interfaces file, there might be remnants of the configuration left that mess up a Network Manager configuration. When using Network Manager to configure the bridge, you should see the following interfaces:

Screenshot at 2017-09-02 13-58-52.png

When the VM is running, I get this Connection Information:

Screenshot at 2017-09-02 14-40-39.png


I followed the tuto and did not use brctl ou edit interfaces file.

powerhouse wrote:4. PCI passthrough: Once you pass through a PCI controller to the guest, when you shut down the guest the PCI controller does not automatically release and you need to manually (or via script) make it available to Linux. See the virsh command (can't remember the exact command).
It looks like you need to get rid of your KVM switch and USB hub. I forget to mention in my previous post that my USB hubs also had issues and would disconnect devices or simply not work. Now I'm free of this garbage and everything works.
You got too many errors, but try to restart Windows a few times and see if it goes away - sometimes Windows needs some time to install all the new drivers (or detect that a device is gone). It's called "plug and pray".

I hope very much that connecting you kb/m directly will solve the issues. You can use Synergy - a software solution - to use your kb/m in both Linux and Windows. Else, check out virsh.


"plug and pray" ... I know this since W95 :lol: I've tried Linux (with slackware) in 96... Have an X config was a pain in the ass at this time... Need to fill manually Vertical & Horizontal Frequency of the monitor for each resolution (without error, otherwise, the screen can be broken!)...

Whatever... To reattach the USB controller, he line:

Code: Select all

virsh nodedev-reattach pci_0000_0c_00_0
seems to work fine!
The strange thing is that while the kb is plugged directly on the card, there's no problem with the mouse no matter how connected it is (KVM or hub)...
I think I'll stay with kb&m on the card, and add the hub with the kvm to plugged other devices (video camera) on it. Synergy is already install to use Linux while in Windows :wink:

With the installation of libvirt-bin (for virsh), a virbr0 bridge showed.

powerhouse wrote:EDIT: For Passmark to work, you need the ignore_msrs... as written in the tutorial!


Yes, I did it: no more windows crash, but passmark won't start, but with a nice windows stating "Error 4".

powerhouse
Level 5
Level 5
Posts: 987
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby powerhouse » Sun Sep 03, 2017 2:35 am

@HPMint: About Passmark, unless you forgot to use the ignore_msgr option it might be because you use the PC or fx440 machine type.

See also here: https://www.passmark.com/forum/performancetest/4748-startup-error-number-4-on-qemu-bsod
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3 RAM, Noctua NH-D14 CPU cooler, Gigabyte GTX 970 + PNY Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk Extreme 120GB + Samsung EVO 850 250GB SSD + 5 HDD, Corsair 500R case, SeaSonic 660W Gold X PS

powerhouse
Level 5
Level 5
Posts: 987
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby powerhouse » Sun Sep 03, 2017 10:28 am

@juju:

You mentioned you view your Guests disk files from your Host machine, if you have a link or explanation for this might be nice. I did not try mounting my img file maybe its just simple as that.


I use LVM formated drives and mount my volumes using kpartx.

If you use image files, for example qcow2, there are commands to mount the files on Linux. Just make sure the guest is not running, or mount it read only! Don't have a link now, but you'll find it when you search for image files or qcow.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3 RAM, Noctua NH-D14 CPU cooler, Gigabyte GTX 970 + PNY Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk Extreme 120GB + Samsung EVO 850 250GB SSD + 5 HDD, Corsair 500R case, SeaSonic 660W Gold X PS

juju
Level 1
Level 1
Posts: 7
Joined: Sun Aug 27, 2017 9:45 pm

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby juju » Sun Sep 03, 2017 1:40 pm

powerhouse wrote:@juju: I noticed you use the standard "pc" (fx440) machine instead of "q35" - see my start script. In my case the "pc" (fx440) option always delivered bad performance. You cannot just change this option but would need to reinstall Windows. However, I have no idea which option is better for Ryzen.

Background CPU: It might be because it is a new installation of Windows and Windows is still indexing files etc. There are some Windows tweaking options that you can do - search the Internet as I don't recall them all. Regarding kvm/qemu I already mentioned everything in my tutorial. Have a look at my latest version here: https://heiko-sieger.info/running-windows-10-on-linux-using-kvm-with-vga-passthrough/.

Thanks for the benchmarks. Your GTX 970 bare metal performance is a little better than my GTX 970 VM performance - we are talking 2 fps better. You could run the Unigine Heaven benchmark in your Windows VM and compare the results. That would give you a good indication how well passthrough is working. The expected difference is a few %.

I look forward to see your Passmark results when running on SSD.

Windows 7: Make sure you got a Windows 7 install ISO that uses UEFI, else my how-to won't work.


The Heaven Benchmark was actually from the VM I built using your tutorial with the GTX 970 passthroughed. I did not get a chance to do one on a bare-metal Windows install that would have been a good comparison. I have not had one of those for a few years now.

I actually remember reading now that you got better performance using q35, I had switched it at some point because I had a Blackscreen issues. But honestly I think I was just not patient enough waiting for a reboot during my testing. I am going to install Windows 7 x64 Ultimate I'll use q35 and get some more benchmarks soonish, including Passmark, I will probably also do the same for Win 10 fresh on q35. I found a guy selling Win 7 ult x64 keys for 11 USD on ebay instant delivery, and I tried activating Win 10 with it and it worked also lol. It might be a couple days before I post something, I have been uninspired to write a program that I finally am finding some energy to do so.

HPMint
Level 1
Level 1
Posts: 23
Joined: Mon Aug 18, 2014 10:56 am

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby HPMint » Sun Sep 03, 2017 3:34 pm

powerhouse wrote:@HPMint: About Passmark, unless you forgot to use the ignore_msgr option it might be because you use the PC or fx440 machine type.

See also here: https://www.passmark.com/forum/performancetest/4748-startup-error-number-4-on-qemu-bsod


Nope: like you in the tuto, I use the Q35 machine type.

But I haven't tried to remove C:\ProgramData\PassMark before reinstall (one of thread reply). I'll try in a few days: adding the second graphic card was a difficult time for my case and some cable were not long enough. So no more virtu until new cables are received.

juju
Level 1
Level 1
Posts: 7
Joined: Sun Aug 27, 2017 9:45 pm

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby juju » Tue Sep 05, 2017 2:12 pm

powerhouse wrote:@juju: I noticed you use the standard "pc" (fx440) machine instead of "q35" - see my start script. In my case the "pc" (fx440) option always delivered bad performance. You cannot just change this option but would need to reinstall Windows. However, I have no idea which option is better for Ryzen.

Background CPU: It might be because it is a new installation of Windows and Windows is still indexing files etc. There are some Windows tweaking options that you can do - search the Internet as I don't recall them all. Regarding kvm/qemu I already mentioned everything in my tutorial. Have a look at my latest version here: https://heiko-sieger.info/running-windows-10-on-linux-using-kvm-with-vga-passthrough/.

Thanks for the benchmarks. Your GTX 970 bare metal performance is a little better than my GTX 970 VM performance - we are talking 2 fps better. You could run the Unigine Heaven benchmark in your Windows VM and compare the results. That would give you a good indication how well passthrough is working. The expected difference is a few %.

I look forward to see your Passmark results when running on SSD.

Windows 7: Make sure you got a Windows 7 install ISO that uses UEFI, else my how-to won't work.


I tried to get Windows 7 Created again... I could not for the life of me create a UEFI bootable USB Drive with my Windows 7 ISO, I spent maybe more than 4 hours so far trying to do so. I downloaded my ISO from the official Microsoft subscription center, then used rufus in Windows and tried too create the thumb drive. Every-time I make the drive I get an error about explorer.exe or it fails to make edits or something to that effect. I tried on 2 different machines same issue. I read viewtopic.php?t=212692&start=260#p1296156 and other guides online but have had no success.

Synopsis of what I was doing, using MSFT Windows 7 Ultimate SP1 ISO, pass through a 8GB USB 2.0 thumb drive to my Windows 10 machine. Run Rufus using the settings settings suggested by bash64. Error near very end of running rufus aaah. I searched around for the error but did not find much, creator of project said to use process hacker and watch what has handles on file and kill those processes. I tried also using Linux to make it a few ways with Unetbootin and some other methods with no success either. I am wondering if my ISO is not "complete" or something I am running out of ideas, Ill run MD5 hash and check later. I tried to do this manually, format the stick as fat32 add bootable parameter with gparted, mount ISO copy contents to the disk that did not work either.

If you have any pointers it would be helpful at this point as long as they are not null :) I hate Windows so much I don't know where to begin lol. I'll send you a Windows 7 Ultimate 32/64 (Multi-Language) Key over PM for your efforts in creating your guide and providing me and others help when I get home. As far as I can tell the key can be used with either Win 7 or 10, I have used one of my Win 7 X64 Ultimate keys on the Windows 10 installer dialog and it was fine with it, I think it works because they offered the Free upgrades for awhile, therefore the older keys had to be valid as well.


Update: Great! I forgot I put my bootloader on my 1TB, I formatted it the other night to move my vm images around and now I am hosed. Might be a day or two before I am back up and running again. I'll pm that key 7 ASAP
Update 2: Back in action, Going to try and make a UEFI Win 7 installer again later today!

juju
Level 1
Level 1
Posts: 7
Joined: Sun Aug 27, 2017 9:45 pm

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby juju » Fri Sep 08, 2017 1:02 am

Posting this reply from my Windows 7 x64 Ultimate SP1 KVM VGA Passthrough! What a very long and strange trip this has been :roll:

http://www.userbenchmark.com/UserRun/4934991

I managed to create a Win 7 VM from a USB Drive that was made with official win7 ult x64 sp1 ISO and rufus USB creator tool. I made this using my Windows 10 x64 passthrough :)

What worked was during the Windows 7 install my card was passthroughed, but I did not use the video card during the install process at all or even Windows 7 updates. I had vga std and nographic set the entire time until Windows updates put NVIDIA Driver on the machine, bingo!

After this point I could not get back into the VM...kind of expected though cause nothing has worked for like 2 weeks now.

I figured I would try again and install over the last install, this time I was using my Passthroughed card when trying to install instead of the vga std and nographic like last time. So I created a UEFI Bootable Win 7 ISO from the knowledge I learned over the past week, but I could not get the VM to boot to it at all. So I started fiddling with the boot to file options in the BIOS, I must have hit the right file in my Windows 7 Ult x64 Install that I did previously and my machine booted to it to my wild surprise. Since I had installed the NVIDIA Driver previously, I checked dxdiag and my GTX 970 shows up. Linux Mint Host is just fine while my Win 7 guest is running.

I need to take sometime to analyze what the rainbows actually made this work and save it off to the side but I think I have some clues. Windows Update is asking me to reboot lets hope I can get back to this point reliably :wink:

Cheers,
Juju

HPMint
Level 1
Level 1
Posts: 23
Joined: Mon Aug 18, 2014 10:56 am

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby HPMint » Sun Sep 10, 2017 6:25 am

This is the result of the passmark test:

Image

The result seems low. But I give only 2 core & 2 threads from the 7700. No OC.
The 2D perf of the CG is pretty low too.

powerhouse
Level 5
Level 5
Posts: 987
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby powerhouse » Thu Sep 14, 2017 1:05 am

Just a short reply: I'm travelling a lot this month so won't be able to answer to posts in a timely fashion. I'll be back at the end of the month.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3 RAM, Noctua NH-D14 CPU cooler, Gigabyte GTX 970 + PNY Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk Extreme 120GB + Samsung EVO 850 250GB SSD + 5 HDD, Corsair 500R case, SeaSonic 660W Gold X PS

Arp
Level 2
Level 2
Posts: 88
Joined: Mon Mar 11, 2013 8:41 am

Re: HOW-TO make dual-boot obsolete using kvm VGA passthrough

Postby Arp » Tue Sep 19, 2017 3:54 pm

Hello,

I am trying to get this running, and I already fail at the first thing: Virtualization. I have an intel i7-7700 on an Asus Z270 board, both support virtualization. When I installed Linux, the intel VT-d option was disabled. I enabled it and made sure that Intel Virtualization is also enabled in the bios.

But still, dmesg will not show me "DMAR: Intel(R) Virtualization Technology for Directed I/O".

Do I need to reinstall because it was disabled while I was installing it? Or am I overlooking something?

Thx.


Return to “Virtualization”