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
hamsterjam
Level 1
Level 1
Posts: 1
Joined: Mon May 22, 2017 11:10 am

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

Post by hamsterjam » Mon May 22, 2017 11:49 am

Posting to say Big Thanks!

I followed your recipe and it worked first time. This is after a couple of years (yes, seriously!) of faffing around with no success.

I am running a clean install of Mint 18.1 on an ASUS X99 motherboard with an I7-5960X (4 cores for Win10), 16GB RAM in total (of which 8GB for Windows 10). Host GPU is a GTX960, guest GPU is a GTX1080Ti.

The key to success (apart from your admirable instructions) was a new graphics card (the 1080). Earlier attempts foundered on trying to make it happen with older cards that I had lying around.

Two curious experiences, neither one fatal: firstly the hugepages mount point differed from the one depicted (mine was /dev/hugepages but it worked just the fine when I changed it in the script) and secondly although I didn´t configure the bridge (and commented out the networking lines in the script because my MB has two Ethernet ports and I was planning on passing one through later) the Windows 10 installer grabbed the port anyway and configured it with IPv6 so networking worked immediately without my having to do anything else. I will still pass through the other port at some point but it is now somewhat less urgent that I do so.

tl:dr: if at first you don´t succeed throw money at the problem. :D

I shall upload the Passmark in due course. Thanks again!

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

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

Post by powerhouse » Mon May 22, 2017 2:41 pm

hamsterjam wrote:Posting to say Big Thanks!

I followed your recipe and it worked first time. This is after a couple of years (yes, seriously!) of faffing around with no success.

I am running a clean install of Mint 18.1 on an ASUS X99 motherboard with an I7-5960X (4 cores for Win10), 16GB RAM in total (of which 8GB for Windows 10). Host GPU is a GTX960, guest GPU is a GTX1080Ti.

The key to success (apart from your admirable instructions) was a new graphics card (the 1080). Earlier attempts foundered on trying to make it happen with older cards that I had lying around.

Two curious experiences, neither one fatal: firstly the hugepages mount point differed from the one depicted (mine was /dev/hugepages but it worked just the fine when I changed it in the script) and secondly although I didn´t configure the bridge (and commented out the networking lines in the script because my MB has two Ethernet ports and I was planning on passing one through later) the Windows 10 installer grabbed the port anyway and configured it with IPv6 so networking worked immediately without my having to do anything else. I will still pass through the other port at some point but it is now somewhat less urgent that I do so.

tl:dr: if at first you don´t succeed throw money at the problem. :D

I shall upload the Passmark in due course. Thanks again!
Thanks for your report! I totally agree with your tl:dr - with your hardware you can only succeed.

Hugepages

Use whatever hugeadm --explain gives you. In fact, in my case I get now:

Code: Select all

sudo hugeadm --explain
Total System Memory: 32177 MB

Mount Point          Options
/dev/hugepages       rw,relatime
/run/hugepages/kvm   rw,relatime,mode=775,gid=126

Huge page pools:
      Size  Minimum  Current  Maximum  Default
   2097152    11000    11000    11000        *
1073741824        0        0        0         

Huge page sizes with configured pools:
2097152

The recommended shmmax for your currently allocated huge pages is 23068672000 bytes.
To make shmmax settings persistent, add the following line to /etc/sysctl.conf:
  kernel.shmmax = 23068672000

To make your hugetlb_shm_group settings persistent, add the following line to /etc/sysctl.conf:
  vm.hugetlb_shm_group = 126

Note: Permanent swap space should be preferred when dynamic huge page pools are used.
Either option (/dev/hugepages or /run/hugepages/kvm) should work. I'm using

Code: Select all

  -mem-path /run/hugepages/kvm \
in the start script.

Networking

When you do NOT specify a networking option, KVM/qemu does it for you. In that case it will be a routed network, not a bridge. This routed network has the advantage that it should work with a wireless network adapter.

The downside of it is performance. But you usually won't notice unless you need a low-latency or high-speed network connection with the host (Linux) OS. For example, if you use Windows for gaming and run a Synergy server on Linux, you may want to reduce the network latency as your mouse movements are transmitted by the Synergy client in Windows to the server. Any latency could ruin your gaming experience.
A bridged network offers low latency and high speed, around 10Gig. File transfers are as if you were to copy from disk to disk, even when using SSD (they aren't as fast as the bridged network). I also use Samba to share files on my Linux host with Windows.

If your network performance is good for you, don't bother changing it.

I look forward to seeing your Passmark or UserBenchmark results.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 860 1TB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

bash64
Level 3
Level 3
Posts: 108
Joined: Mon Mar 23, 2015 12:19 am

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

Post by bash64 » Wed Jun 07, 2017 1:06 pm

Powerhouse,

I tried to implement your networking on my setup.
I get an error when using vhost=on in -netdev type=tap,id=net0,ifname=tap0,vhost=on \
I looked this up and vhost=on is only if you have created a dev entry for tap0 ahead of time.
I don't see any instructions on doing that in the tutorial.
Maybe you need to add it.
For now I have removed the vhost=on from that line and I get booted.

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

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

Post by powerhouse » Thu Jun 08, 2017 12:01 am

bash64 wrote:Powerhouse,

I tried to implement your networking on my setup.
I get an error when using vhost=on in -netdev type=tap,id=net0,ifname=tap0,vhost=on \
I looked this up and vhost=on is only if you have created a dev entry for tap0 ahead of time.
I don't see any instructions on doing that in the tutorial.
Maybe you need to add it.
For now I have removed the vhost=on from that line and I get booted.
Hello bash64, thanks for pointing this out.

I just had a look at my how-to and the networking part lacks information. There is a lot to expand and explain.

There is just one problem: I'm very inexperienced with it and the documentation on the web just adds more to the confusion. Next week I should find a little time to research the matter and update the tutorial.

In general one does not require any network definition in the qemu command. In that case qemu will set up its own network interface, if I'm not mistaken a routed interface. That routed interface should even work with wireless LAN. The downside and the reason I set up a bridged network is performance and easy access to partitions or folders in the Linux host.

Using a bridged setup, I can simply share my folders under Linux with Windows using Samba. This should also work on a routed network, if I'm not mistaken, but I haven't tried. Anyway performance of my bridged network is excellent, which was /is important for me as I often transfer large amounts of data (hundreds of GB).
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 860 1TB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

bash64
Level 3
Level 3
Posts: 108
Joined: Mon Mar 23, 2015 12:19 am

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

Post by bash64 » Thu Jun 08, 2017 12:13 pm

I was using an up and down script i borrowed from a wiki.
I kept having routing issues where linux would lose dns.
Also, someone broke the bridge commands and I had to rewrite the scripts.
I decided yesterday to implement a permanent bridge and remove the scripts and went with your static bridge instructions.
Except for the vhost=on it worked perfect for me.
I'd like the command you used to make the permanent /dev/tap0 entry.

bash64
Level 3
Level 3
Posts: 108
Joined: Mon Mar 23, 2015 12:19 am

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

Post by bash64 » Sat Jun 10, 2017 4:08 pm

Hey,

I wanted to mention an issue I had recently and the solution.
I moved my computer setup to the other side of the house away from the main router.
This left me without a wired connection. Only wireless internet. As you know, you cannot bridge a wireless adapter in the tutorial.
Only wired connections can be added to bridges.

I solved this issue by bridging my wireless adapter to my bridge (known as br0) using this tutorial:
https://help.ubuntu.com/community/Inter ... ionSharing

It simply uses iptables to form a bridge between your wireless adapter and an existing wired adapter (br0 in this case).
It is the equivalent of Microsoft ICS (Internet Connection Sharing). Sort of.

Only one error occurred: no bridge for guest interface found.
I fixed this by adding switch=br0 to the /etc/qemu-ifup script as shown by this mans article:
https://tthtlc.wordpress.com/2015/10/21 ... etworking/

Obviously replace br0 with the name of your bridge.

I have always wanted to know how to bridge a wireless adapter to a wired adapter.
I hope this helps someone, especially if your using a laptop and must go to a computer meeting where there is only wireless access.

bash64
Level 3
Level 3
Posts: 108
Joined: Mon Mar 23, 2015 12:19 am

This will permanently stop Windows from asking you to do a startup repair instead of a normal boot.

Post by bash64 » Sun Jun 11, 2017 9:14 pm

I have another solution I worked out today:
This will permanently stop Windows from asking you to do a startup repair instead of a normal boot.
If there are any bugs in this code let me know. Enjoy!

Normally, if Windows crashes it will prompt you to use Startup Repair. For those doing qemu with gpu passthrough you cannot see this boot menu option and windows never boots. I have used bcdedit to tell Windows to not do this anymore, but it does not work every time or consistently. Windows maintains the crashed status of Windows in the System Reserved partition in the \Boot folder in a file called BOOTSTAT.DAT. This file is always exactly 64k in size.


WARNING: You MUST NOT have Windows or qemu running when executing these scripts!!!


Script 1 extracts a copy of your BOOTSTAT.DAT file to your qemu folder.
Script 2 copies it back, overwriting the existing BOOTSTAT.DAT file with the good backup copy. No more Startup Repair option. Windows always thinks it has shutdown properly. Personally, I incorporated the code from script 2 into my normal qemu script so that I am guaranteed to skip the Startup Repair option every time.


Script 1 - do this:

save this script in your qemu folder as csr.sh.
make sure you change the name of the qcow2 image file and the path to the qemu folder. mine is ~/qemu and windows7.img.
open a terminal to the qemu folder.
make it executable with sudo chmod +x csr.sh

Boot Windows and shutdown Windows PROPERLY using Start menu->SHUTDOWN.

when qemu has quit run this script: sudo ./csr.sh
You will now have a copy of your BOOTSTAT.DAT file in your qemu folder.
This is the file that tells Windows that it was shutdown properly (or not).

######################################################
#!/bin/bash
#
#Script 1
#grab a copy of \Boot\BOOTSTAT.DAT from your windows img file...
#replace "windows7.img" with the name of your qcow2 image file.
#replace "cd ~/qemu" with the path to your qemu folder.


cd ~/qemu
#these two commands are just in case the previous unmount failed...ignore the errors
umount /media/w7
qemu-nbd -d /dev/nbd0

#now mount the qcow2 image file and extract BOOTSTAT.DAT to the current folder...
modprobe nbd max_part=63
qemu-nbd -f raw -c /dev/nbd0 windows7.img
mkdir -p /media/w7
mount /dev/nbd0p1 /media/w7
cp /media/w7/Boot/BOOTSTAT.DAT .

#wait for 5 seconds to give time for the file to copy...or you will get strange errors
sleep 5

#unmount everything...
umount /media/w7
qemu-nbd -d /dev/nbd0

#goodbye
exit 0




Script2 - do this:

save this script in your qemu folder as rsr.sh.
make sure you change the name of the qcow2 image file and the path to the qemu folder. mine is ~/qemu and windows7.img.
open a terminal to the qemu folder.
make it executable with sudo chmod +x rsr.sh

after qemu is stopped and before launching qemu run this script: sudo ./rsr.sh

Your BOOTSTAT.DAT file has been recovered and you will not be given a Startup Repair option when booting Windows.

#########################################################
#!/bin/bash
#
#Script 2
#Replace \Boot\BOOTSTAT.DAT with the good copy in your qemu folder
#replace "windows7.img" with the name of your qcow2 image file.
#replace "cd ~/qemu" with the path to your qemu folder.


cd ~/qemu
#these two commands are just in case the previous unmount failed...ignore the errors
umount /media/w7
qemu-nbd -d /dev/nbd0

#now mount the qcow2 image file and overwrite BOOTSTAT.DAT with the good backup copy...
modprobe nbd max_part=63
qemu-nbd -f raw -c /dev/nbd0 windows7.img
mkdir -p /media/w7
mount /dev/nbd0p1 /media/w7
cp BOOTSTAT.DAT /media/w7/Boot/

#wait for 5 seconds to give time for the file to copy...or you will get strange errors
sleep 5

#unmount everything...
umount /media/w7
qemu-nbd -d /dev/nbd0

#goodbye
exit 0

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

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

Post by powerhouse » Mon Jun 12, 2017 7:35 am

bash64 wrote:I was using an up and down script i borrowed from a wiki.
I kept having routing issues where linux would lose dns.
Also, someone broke the bridge commands and I had to rewrite the scripts.
I decided yesterday to implement a permanent bridge and remove the scripts and went with your static bridge instructions.
Except for the vhost=on it worked perfect for me.
I'd like the command you used to make the permanent /dev/tap0 entry.
I was hoping to find some time this week to look into the networking issues. But things turned out differently and I need to travel. Hopefully next week I'll find some time.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 860 1TB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

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

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

Post by powerhouse » Mon Jun 12, 2017 7:59 am

A note on input devices and switching between Linux and Windows VM:

I have been considering getting some multi-device bluetooth mouse and keyboard for a long time. After my Microsoft mouse gave me fits, I replaced it with a Logitech MX Master mouse. What a difference!

Today I did the next step - getting a Logitech K780 multi-device keyboard. Both mouse and keyboard come with its own USB unifying receiver, and each receiver can be paired to multiple devices.

It's best to pair mouse and keyboard under Windows using the Unifying software. I paired both devices to both USB receivers, but each using a different channel. Linux is on channel 1, Windows on channel 2. The first USB receiver is on a Linux Mint USB port, the 2nd on a USB port I passed through to Windows.

Now all I need to do is select the proper channel on both the keyboard and the mouse to switch between Linux and Windows. The best part is - no cables on the desk!

And I use the keyboard for my Samsung Android tablet too.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 860 1TB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

bash64
Level 3
Level 3
Posts: 108
Joined: Mon Mar 23, 2015 12:19 am

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

Post by bash64 » Mon Jun 12, 2017 11:46 am

I had not heard of multi device mouse/keyboards.
No more synergy?

JimFritzMI
Level 1
Level 1
Posts: 1
Joined: Mon Jun 12, 2017 5:59 pm

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

Post by JimFritzMI » Mon Jun 12, 2017 6:03 pm

All this work to find it will not work with my laptop. And I went the extra mile and spent money on one that had a separate GPU. I've come to realize it just doesn't bother anyone anymore that even now more and more hardware manufacturers are locking us into the Microsoft machine. Maybe it's time to wave the white flag and just embrace the borg...

bash64
Level 3
Level 3
Posts: 108
Joined: Mon Mar 23, 2015 12:19 am

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

Post by bash64 » Tue Jun 13, 2017 10:12 am

JimFritzMI wrote:All this work to find it will not work with my laptop. And I went the extra mile and spent money on one that had a separate GPU. I've come to realize it just doesn't bother anyone anymore that even now more and more hardware manufacturers are locking us into the Microsoft machine. Maybe it's time to wave the white flag and just embrace the borg...
I do not recommend anyone try this with a laptop. I assume the laptop has nvidia synergy (nvidia/intel). That is not recommended by myself or by Powerhouse who owns this article.

It worked for me by using seabios rather than ovmf. I also use pci_stub instead of vfio-pci to reserve my video card for qemu. Perhaps I can help you get it working. I can even do a Teamviewer session if you have the time. Provide me a way to contact you if you want help. If you do a friend request to "Linux Mint Survival Guides" (I prefer this one) or "Roger Lee Lawhorn" on facebook we can use facebook chat. Sorry, no cell phone, at least not with any minutes left.

Here are some ebooks I have written at lulu.com:
http://www.lulu.com/spotlight/bash64

The mint 18 ebook contains a chapter on this with my own insights and how I made this work on a laptop with Synergy.

bash64
Level 3
Level 3
Posts: 108
Joined: Mon Mar 23, 2015 12:19 am

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

Post by bash64 » Fri Jun 16, 2017 1:36 pm

I have asked this before, but I have come back to the issue and would like to solve it.

With qemu working I boot in 4min 18secs into windows 7 using seabios and mbr.

If I remove the "-vga none" switch and let qemu emulate a standard vga controller I boot in 1min.

Why is this? Is qemu hanging for over 3 mins on the nvidia card? I watch the hd led light flicker and mostly it does very little for 3 mins then suddenly zooms on for the boot.

"There is nothing you can do about it" is a better answer than not knowing why it happens.

Thanks

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

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

Post by powerhouse » Sat Jun 17, 2017 4:43 pm

bash64 wrote:I had not heard of multi device mouse/keyboards.
No more synergy?
Synergy is fine. But I wanted to have a hardware solution, also because my MS mouse once again quit on me. The wireless keyboard also supports my Samsung tablet at the press of a button, which is convenient. I still need to test the mouse on the Samsung tablet. Actually it's too bad that these multi-device keyboard and mouse only support up to 3 devices - I got plenty of devices to pair them with.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 860 1TB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

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

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

Post by powerhouse » Sat Jun 17, 2017 4:56 pm

bash64 wrote:I have asked this before, but I have come back to the issue and would like to solve it.

With qemu working I boot in 4min 18secs into windows 7 using seabios and mbr.

If I remove the "-vga none" switch and let qemu emulate a standard vga controller I boot in 1min.

Why is this? Is qemu hanging for over 3 mins on the nvidia card? I watch the hd led light flicker and mostly it does very little for 3 mins then suddenly zooms on for the boot.

"There is nothing you can do about it" is a better answer than not knowing why it happens.

Thanks
Not sure I can help on that. Windows 7 is kind of difficult to handle with kvm. You need to do secondary VGA passthrough, meaning your primary display under Windows is a VGA standard display and your Nvidia card becomes a secondary display. Windows will first boot into VGA mode using the VGA driver under Windows, then switch to the Nvidia card.

In order to avoid that, you would have to use either Windows 8 or 10 with UEFI to boot directly using primary passthrough. An alternative is to create an updated Windows 7 ISO with UEFI support, but that is easier said than done. I failed miserably but I found posts of people who have succeeded. If you care to try that and succeed, it would be great to share how you did it.

In the end what counts is that it works. If you post your current boot script, I will search for my old Windows 7 boot script to compare.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 860 1TB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

bash64
Level 3
Level 3
Posts: 108
Joined: Mon Mar 23, 2015 12:19 am

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

Post by bash64 » Thu Jun 22, 2017 7:12 pm

configfile=~/qemu/vfio-pci1.cfg

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

modprobe vfio-pci

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

qemu-system-x86_64 -machine type=q35,accel=kvm -cpu host,kvm=off \
-smp 8,sockets=1,cores=4,threads=2 \
-bios /usr/share/seabios/bios.bin \
-serial none \
-parallel none \
-vga none \
-m 7G \
-mem-prealloc \
-balloon none \
-rtc clock=host,base=localtime \
-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 virtio-scsi-pci,id=scsi \
-drive id=disk0,if=virtio,cache=none,format=raw,file=/home/bob/qemu/windows7.img \
-drive file=/home/bob/qemu/qemu2/virtio-win-0.1.126.iso,id=isocd,format=raw,if=none -device scsi-cd,drive=isocd \
-netdev type=tap,id=net0,ifname=tap0 \
-device virtio-net-pci,netdev=net0,mac=00:16:3e:00:01:01 \
-usbdevice host:413c:a503 \
-usbdevice host:13fe:3100 \
-usbdevice host:0bc2:ab21 \
-boot menu=on \
-boot order=c

bash64
Level 3
Level 3
Posts: 108
Joined: Mon Mar 23, 2015 12:19 am

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

Post by bash64 » Fri Jun 23, 2017 11:55 am

Good news: Pulse audio started working. All of my lag is gone. All of the lag was caused by using usb audio. Never again.
With windows7/fallout 4 on max settings and linux viewing a 1080p stream in firefox my total cpu usage is only 68%. Two OS's at once is nice.

Bad news: Windows is making a new local area connection each time I boot. This causes my static IP to be blown away and Synergy to fail. Have you seen this issue? A search of the internet shows that those using hyper-v and other types of software like Comodo end up with virtual adapters in windows which causes this. Is there any qemu hyper-v switch to get this to stop? Doesn't always happen but it's massively annoying when it does.

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

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

Post by powerhouse » Fri Jun 23, 2017 12:38 pm

bash64 wrote:Good news: Pulse audio started working. All of my lag is gone. All of the lag was caused by using usb audio. Never again.
With windows7/fallout 4 on max settings and linux viewing a 1080p stream in firefox my total cpu usage is only 68%. Two OS's at once is nice.
Great!
bash64 wrote:Bad news: Windows is making a new local area connection each time I boot. This causes my static IP to be blown away and Synergy to fail. Have you seen this issue? A search of the internet shows that those using hyper-v and other types of software like Comodo end up with virtual adapters in windows which causes this. Is there any qemu hyper-v switch to get this to stop? Doesn't always happen but it's massively annoying when it does.
Does your VM get the IP from your router? If so, perhaps you can configure a permanent IP in the router.

With regard to tap configuration (I believe you had asked for that earlier), see here: http://blog.elastocloud.org/2015/07/qem ... h-tap.html. I haven't tried it, though.

Edit: I haven't found my old Windows 7 start script - sorry. However, it was based on the instructions I read on the Arch Linux forum, see Part 12 first link in my how-to.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 860 1TB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

diabolusss
Level 1
Level 1
Posts: 10
Joined: Sat Jun 24, 2017 7:24 am

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

Post by diabolusss » Sat Jun 24, 2017 7:40 am

bash64 wrote:
JimFritzMI wrote:All this work to find it will not work with my laptop. And I went the extra mile and spent money on one that had a separate GPU. I've come to realize it just doesn't bother anyone anymore that even now more and more hardware manufacturers are locking us into the Microsoft machine. Maybe it's time to wave the white flag and just embrace the borg...
I do not recommend anyone try this with a laptop. I assume the laptop has nvidia synergy (nvidia/intel). That is not recommended by myself or by Powerhouse who owns this article.

It worked for me by using seabios rather than ovmf. I also use pci_stub instead of vfio-pci to reserve my video card for qemu. Perhaps I can help you get it working. I can even do a Teamviewer session if you have the time. Provide me a way to contact you if you want help. If you do a friend request to "Linux Mint Survival Guides" (I prefer this one) or "Roger Lee Lawhorn" on facebook we can use facebook chat. Sorry, no cell phone, at least not with any minutes left.

Here are some ebooks I have written at lulu.com:
http://www.lulu.com/spotlight/bash64

The mint 18 ebook contains a chapter on this with my own insights and how I made this work on a laptop with Synergy.
Hello. I want to make dual-boot obsolete on my laptop(Dell Alienware 17 R3 with Integrated Intel HD 530 HD + Nvidia GeForce GTX 970M 3GB) using this tutorial. So far i had no luck using other tutorials that was based on Xen Project HVM. I am wondering why you dont recommend to try it with a laptop. Please, explain that to me and give me advice if possible(about installing HVM on laptop, not buying PC :D).

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

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

Post by powerhouse » Tue Jun 27, 2017 7:13 am

@bash64: My old qemu start script for Win 7: viewtopic.php?f=225&t=153482&#p856822.

Important: This script misses the kvm=off option in the cpu statement: -cpu host,kvm=off \

You need kvm=off else all sorts of things won't work properly, for example Passmark will complain.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 860 1TB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

Post Reply

Return to “Virtualization”