You are not logged in.

#4026 2015-02-02 06:01:19

AKSN74
Member
From: Taichung, Taiwan
Registered: 2014-02-18
Posts: 52

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

Hello guys, meet again~

In these days, I have a time to keep working on VFIO's work.
And I found that if I want to solve the issue that VM cannot reboot if guest OS is Linux, maybe OVMF is another options.

I'll try Ubuntu 14.04-1 as guest os and try it again.
But now my Kernel version is 3.17-rc6 with QEMU 2.1.0

Does OVMF included in QEMU 2.2.0?
If so, how can I change my script to use OVMF?

For example:

Original code is:

#!/bin/bash

qemu-system-x86_64 -enable-kvm -M q35 -m 8192 -cpu host,kvm=off \
-smp 6,sockets=1,cores=6,threads=1 \
-bios /usr/share/qemu/bios.bin -vga none -localtime \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=03:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=03:00.1,bus=root.1,addr=00.1 \
-device ahci,bus=pcie.0,id=ahci \
-usb -usbdevice host:046d:c534 \
-drive file=/home/eddieak/win7.img,id=disk,format=raw,if=virtio \
-net tap -net nic,macaddr=40-D8-2D-52-FB-43

To this?

#!/bin/bash

qemu-system-x86_64 -enable-kvm -M q35 -m 8192 -cpu host,kvm=off \
-smp 6,sockets=1,cores=6,threads=1 \
-vga none -nographic -localtime \
-drive if=pflash,format=raw,readonly,file=/path/to/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/copy/of/OVMF_VARS.fd \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=03:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=03:00.1,bus=root.1,addr=00.1 \
-device ahci,bus=pcie.0,id=ahci \
-usb -usbdevice host:046d:c534 \
-drive file=/home/eddieak/win7.img,id=disk,format=raw,if=virtio \
-net tap -net nic,macaddr=40-D8-2D-52-FB-43

Offline

#4027 2015-02-02 06:38:07

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

AKSN74 wrote:

Hello guys, meet again~

In these days, I have a time to keep working on VFIO's work.
And I found that if I want to solve the issue that VM cannot reboot if guest OS is Linux, maybe OVMF is another options.

I'll try Ubuntu 14.04-1 as guest os and try it again.
But now my Kernel version is 3.17-rc6 with QEMU 2.1.0

Does OVMF included in QEMU 2.2.0?
If so, how can I change my script to use OVMF?

For example:

Original code is:

#!/bin/bash

qemu-system-x86_64 -enable-kvm -M q35 -m 8192 -cpu host,kvm=off \
-smp 6,sockets=1,cores=6,threads=1 \
-bios /usr/share/qemu/bios.bin -vga none -localtime \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=03:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=03:00.1,bus=root.1,addr=00.1 \
-device ahci,bus=pcie.0,id=ahci \
-usb -usbdevice host:046d:c534 \
-drive file=/home/eddieak/win7.img,id=disk,format=raw,if=virtio \
-net tap -net nic,macaddr=40-D8-2D-52-FB-43

To this?

#!/bin/bash

qemu-system-x86_64 -enable-kvm -M q35 -m 8192 -cpu host,kvm=off \
-smp 6,sockets=1,cores=6,threads=1 \
-vga none -nographic -localtime \
-drive if=pflash,format=raw,readonly,file=/path/to/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/copy/of/OVMF_VARS.fd \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=03:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=03:00.1,bus=root.1,addr=00.1 \
-device ahci,bus=pcie.0,id=ahci \
-usb -usbdevice host:046d:c534 \
-drive file=/home/eddieak/win7.img,id=disk,format=raw,if=virtio \
-net tap -net nic,macaddr=40-D8-2D-52-FB-43

OVMF isnt included with QEMU, but perhaps it ships with Ubuntu, you should drop Q35, and be prepared to reinstall windows.

Offline

#4028 2015-02-02 06:56:39

AKSN74
Member
From: Taichung, Taiwan
Registered: 2014-02-18
Posts: 52

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

nbhs wrote:

OVMF isnt included with QEMU, but perhaps it ships with Ubuntu, you should drop Q35, and be prepared to reinstall windows.

Nope, I didn't see any about OVMF in Ubuntu 14.04.

I checked wiki about OVMF, seems like need to build one by myself, I'll try it.

BTW, OVMF will use in Ubuntu guest OS, because Windows 7 is reboot normally when using legacy seabios.
And then drop Q35 and use 440FX if I use OVMF.
Any notice about change script from Q35 to 440FX?

Last edited by AKSN74 (2015-02-02 06:58:01)

Offline

#4029 2015-02-02 08:36:21

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

AKSN74 wrote:
nbhs wrote:

OVMF isnt included with QEMU, but perhaps it ships with Ubuntu, you should drop Q35, and be prepared to reinstall windows.

Nope, I didn't see any about OVMF in Ubuntu 14.04.

I checked wiki about OVMF, seems like need to build one by myself, I'll try it.

BTW, OVMF will use in Ubuntu guest OS, because Windows 7 is reboot normally when using legacy seabios.
And then drop Q35 and use 440FX if I use OVMF.
Any notice about change script from Q35 to 440FX?

Should be like this:

#!/bin/bash

qemu-system-x86_64 -enable-kvm -m 8192 -cpu host,kvm=off \
-smp 6,sockets=1,cores=6,threads=1 \
-vga none -nographic -localtime \
-drive if=pflash,format=raw,readonly,file=/path/to/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/copy/of/OVMF_VARS.fd \
-device vfio-pci,host=03:00.0,x-vga=on \
-device vfio-pci,host=03:00.1
-usb -usbdevice host:046d:c534 \
-drive file=/home/eddieak/win7.img,id=disk,format=raw,if=virtio \
-net tap -net nic,macaddr=40-D8-2D-52-FB-43

OVMF binaries

Last edited by nbhs (2015-02-02 08:36:36)

Offline

#4030 2015-02-02 18:57:52

lordleto
Member
Registered: 2014-11-14
Posts: 6

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

Quick heads up for those who want to run linux guest with nvidia.
Apparently you need kvm=off exactly like in Windows. Then it works like a charm.
Installed Ubuntu 14.04 with Nvidia 346 from CUDA 7.0RC with OMVF (see xml below)
Works like a charm, cuda runs perfectly. Even PCI3.0 with host-device transfers in 10GByte/s Range

Also switched Windows 7 to 440FX. It is truly better (GFE prolbems seemed to disappear).
I can even hotplug the whole USB 3.0 controller to a running the guest, thats awesome. Didnt expect Windows 7 to handle that.
Windows 7 runs on Seabios and qemu wrapper script.
To anyone having passing Asmedia USB 3.0 controller, you should get the latest firmware for them. That made alot of warning in dmesg disappear for me.
Its a bit of pain to find the latest one and beware there are apperently 2 versions of the chip, but it worth it.

I will try now to get OS X running. Any one got any luck starting Yosemite install? Mavericks install starts fine with chameleon. Yosemite with clover hangs on logo. need to research more. Would be nice to have a virtualized backup clone of wifes mac air.

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>Ubuntu1404</name>
  <memory unit='G'>12</memory>
  <currentMemory unit='G'>12</currentMemory>
  <memoryBacking>
    <hugepages/>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='4' threads='2'/>
  </cpu>
  <vcpu placement='static'>8</vcpu>
  <iothreads>4</iothreads>
  <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='2' cpuset='3'/>
    <vcpupin vcpu='4' cpuset='4'/>
    <vcpupin vcpu='6' cpuset='5'/>
    <vcpupin vcpu='1' cpuset='8'/>
    <vcpupin vcpu='3' cpuset='9'/>
    <vcpupin vcpu='5' cpuset='10'/>
    <vcpupin vcpu='7' cpuset='11'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type>
    <loader readonly='yes' type='pflash'>..OVMF_CODE-pure-efi.fd</loader>
    <nvram template='..OVMF_VARS-pure-efi.fd'/> 
  </os>
  <features>
    <pae/>
    <acpi/>
    <apic/>
  </features> 
  <clock offset='utc'>
  </clock> 
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/local/bin/qemu-system-x86_64</emulator> 
    <controller type='scsi' model='virtio-scsi' index='0'>
      <driver queues='8' />
    </controller>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writethrough' io='threads' discard='unmap'/>
      <source file='/daten/vms/storage/Ubuntu1404/ubuntu1404.img'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/daten/images/Images/Linux/ubuntu-14.04-desktop-amd64.iso'/>
      <target dev='sdb' bus='scsi'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='1' unit='0'/>
    </disk>
    <interface type='bridge'>
      <mac address='52:54:00:c4:c4:d0'/>
      <source bridge='virbr0'/>
      <model type='virtio'/>
      <driver name='vhost' queues='1'>
        <guest csum='off' tso4='off' tso6='off'/>
      </driver>
    </interface>
    <!-- TITAN -->
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address bus='0x03' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' bus='0x00' slot='0x09' function='0x0' multifunction='on'/>
    </hostdev>
    <!-- LAN -->
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address bus='0x0c' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' bus='0x00' slot='0x0c' function='0x0'/>
    </hostdev>
    <!-- USB 3.0 -->
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address bus='0x0a' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' bus='0x00' slot='0x0a' function='0x0'/>
    </hostdev>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='host,kvm=off'/> 
  </qemu:commandline>
</domain>

Offline

#4031 2015-02-02 19:08:26

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

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

lordleto wrote:
  <qemu:commandline>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='host,kvm=off'/> 
  </qemu:commandline>

http://vfio.blogspot.com/2014/08/upstre … -2014.html


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

#4032 2015-02-02 19:42:08

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

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

What does a person have to do to get pass their console/only graphics adapter passed through to a VM? Is it even possible? I would use a PCI video card except that my BIOS doesn't allow me to choose between PCI and PCIe for graphics.

Offline

#4033 2015-02-02 19:49:36

lordleto
Member
Registered: 2014-11-14
Posts: 6

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

aw wrote:
lordleto wrote:
  <qemu:commandline>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='host,kvm=off'/> 
  </qemu:commandline>

http://vfio.blogspot.com/2014/08/upstre … -2014.html

Yeah i know. My libvirt is too old to support the proper way. Should still have put it in to not make bad examples.

Offline

#4034 2015-02-02 21:29:22

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

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

In the first post of this thread, NBHS references x-vga=on, is this the value I need to set in order to pass my Primary Graphics card through? (Essentially running the host headless) When i attempt to do this now, my system freezes hard require a system reset.

Qemu also mention adding x-vga support.

http://wiki.qemu.org/ChangeLog/1.5

If x-vga is the proper option I need to enable, what is the syntax I need to do to add it to my XML file? Or do I need to use a wrapper script?

I've see references to Primary and Secondary passthrough, but I'm confuzed as what they actually mean.

Offline

#4035 2015-02-02 21:56:30

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

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

The_Moves wrote:

In the first post of this thread, NBHS references x-vga=on, is this the value I need to set in order to pass my Primary Graphics card through? (Essentially running the host headless) When i attempt to do this now, my system freezes hard require a system reset.

Qemu also mention adding x-vga support.

http://wiki.qemu.org/ChangeLog/1.5

If x-vga is the proper option I need to enable, what is the syntax I need to do to add it to my XML file? Or do I need to use a wrapper script?

I've see references to Primary and Secondary passthrough, but I'm confuzed as what they actually mean.

Primary and secondary in this thread predominantly refers to how the graphics device is presented to the guest.  It's generally recommended that the graphics card for assignment is a secondary device on the host because it's often difficult to detach all the host drivers from the primary display.  Even if you use pci-stub.ids to prevent PCI drivers from attaching, the low level VGA/VESA drivers can still make use of it.  It's not necessarily impossible, but it's not a heavily used or documented path.

x-vga=on is a QEMU vfio-pci option that allows you to enable VGA resource access for the assigned graphics card.  This is necessary if the assigned graphics card is configured as the primary graphics for the guest in a non-OVMF configuration.  It's optional for graphics cards assigned as a secondary graphics device to the guest.  It should never be used with an OVMF guest configuration.  Whether x-vga=on is used for the guest is entirely independent of whether the graphics card is primary or secondary on the host.

If you need to use x-vga=on and you're using libvirt to manage your VM, the recommended way to add it is via a wrapper script.


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

#4036 2015-02-03 03:12:35

AKSN74
Member
From: Taichung, Taiwan
Registered: 2014-02-18
Posts: 52

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

nbhs wrote:

Should be like this:

#!/bin/bash

qemu-system-x86_64 -enable-kvm -m 8192 -cpu host,kvm=off \
-smp 6,sockets=1,cores=6,threads=1 \
-vga none -nographic -localtime \
-drive if=pflash,format=raw,readonly,file=/path/to/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/copy/of/OVMF_VARS.fd \
-device vfio-pci,host=03:00.0,x-vga=on \
-device vfio-pci,host=03:00.1
-usb -usbdevice host:046d:c534 \
-drive file=/home/eddieak/win7.img,id=disk,format=raw,if=virtio \
-net tap -net nic,macaddr=40-D8-2D-52-FB-43

OVMF binaries

I got a first problem when I tried to install Win7.
When I boot VM, it gave me a message

Boot Failed EFI DVD/CDROM

And I google this message, found this solution.
Microsoft KB

Maybe I've try Win8 or 8.1

Offline

#4037 2015-02-03 03:25:09

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

AKSN74 wrote:
nbhs wrote:

Should be like this:

#!/bin/bash

qemu-system-x86_64 -enable-kvm -m 8192 -cpu host,kvm=off \
-smp 6,sockets=1,cores=6,threads=1 \
-vga none -nographic -localtime \
-drive if=pflash,format=raw,readonly,file=/path/to/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/copy/of/OVMF_VARS.fd \
-device vfio-pci,host=03:00.0,x-vga=on \
-device vfio-pci,host=03:00.1
-usb -usbdevice host:046d:c534 \
-drive file=/home/eddieak/win7.img,id=disk,format=raw,if=virtio \
-net tap -net nic,macaddr=40-D8-2D-52-FB-43

OVMF binaries

I got a first problem when I tried to install Win7.
When I boot VM, it gave me a message

Boot Failed EFI DVD/CDROM

And I google this message, found this solution.
Microsoft KB

Maybe I've try Win8 or 8.1

You have to create a fat32 formatted disk image containing the windows installation files

Offline

#4038 2015-02-03 03:31:59

AKSN74
Member
From: Taichung, Taiwan
Registered: 2014-02-18
Posts: 52

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

nbhs wrote:

You have to create a fat32 formatted disk image containing the windows installation files

That means I have to use USB Stick to make a installation disk and then mount into VM, I thought this is a easiest way to install Win7.

Or any options?

EDIT: I tried make Win7 installation USB stick(FAT32 Format) and mount into VM by using -usb command
But after that, OVMF can't find out my USB stick to load. And it still can't find device to boot.

Last edited by AKSN74 (2015-02-03 04:09:50)

Offline

#4039 2015-02-03 05:10:24

AKSN74
Member
From: Taichung, Taiwan
Registered: 2014-02-18
Posts: 52

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

AKSN74 wrote:

That means I have to use USB Stick to make a installation disk and then mount into VM, I thought this is a easiest way to install Win7.

Or any options?

EDIT: I tried make Win7 installation USB stick(FAT32 Format) and mount into VM by using -usb command
But after that, OVMF can't find out my USB stick to load. And it still can't find device to boot.

I created a empty image file, then use mkfs.vfat to format image to FAT32.
After that, I mount my image and copy WIndows 7 installation file into image.

Edit my script to:

-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-cd,bus=ide.1,drive=ins_cd

But OVMF still can't boot my image.

Last edited by AKSN74 (2015-02-03 05:10:43)

Offline

#4040 2015-02-03 05:16:22

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

AKSN74 wrote:
AKSN74 wrote:

That means I have to use USB Stick to make a installation disk and then mount into VM, I thought this is a easiest way to install Win7.

Or any options?

EDIT: I tried make Win7 installation USB stick(FAT32 Format) and mount into VM by using -usb command
But after that, OVMF can't find out my USB stick to load. And it still can't find device to boot.

I created a empty image file, then use mkfs.vfat to format image to FAT32.
After that, I mount my image and copy WIndows 7 installation file into image.

Edit my script to:

-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-cd,bus=ide.1,drive=ins_cd

But OVMF still can't boot my image.

Make sure this file exists:

/efi/boot/bootx64.efi

EDIT: btw since its a disk image and not a cdrom image you should change this:

-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-cd,bus=ide.1,drive=ins_cd

to this:

-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-hd,bus=ide.1,drive=ins_cd

Last edited by nbhs (2015-02-03 05:20:20)

Offline

#4041 2015-02-03 05:42:21

AKSN74
Member
From: Taichung, Taiwan
Registered: 2014-02-18
Posts: 52

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

nbhs wrote:

Make sure this file exists:

/efi/boot/bootx64.efi

EDIT: btw since its a disk image and not a cdrom image you should change this:

-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-cd,bus=ide.1,drive=ins_cd

to this:

-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-hd,bus=ide.1,drive=ins_cd

Things not always be easy.

When I set install image from ide-cd to ide-hd, it gave me this:
CfZ1Edq.jpg

And if I set ide-hd back to ide-cd, it can enter without any problem, but stuck at "Starting Windows."

Maybe I can try put bootx64.efi into ISO file by using UltraISO or something.

And here is my script:

#!/bin/bash

qemu-system-x86_64 -enable-kvm -m 8192 -cpu host,kvm=off \
-smp 6,sockets=1,cores=6,threads=1 \
-bios /usr/share/qemu/bios.bin -vga none -nographic -localtime -boot menu=on \
-drive if=pflash,format=raw,readonly,file=/home/eddieak/OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/home/eddieak/OVMF/OVMF_VARS.fd \
-device vfio-pci,host=03:00.0,x-vga=on \
-device vfio-pci,host=03:00.1 \
-device virtio-scsi-pci,id=scsi \
-usb -usbdevice host:046d:c534 \
-drive file=/home/eddieak/win7.img,id=disk,format=raw,if=none -device scsi-hd,drive=disk \
-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-cd,bus=ide.0,drive=ins_cd \
-drive file=/home/eddieak/virtio.iso,id=virtocd,if=none -device ide-cd,bus=ide.1,drive=virtocd \
-net tap -net nic,macaddr=40-D8-2D-52-FB-43

Now I have no idea what problem about this.

Last edited by AKSN74 (2015-02-03 05:42:43)

Offline

#4042 2015-02-03 05:55:41

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

AKSN74 wrote:
nbhs wrote:

Make sure this file exists:

/efi/boot/bootx64.efi

EDIT: btw since its a disk image and not a cdrom image you should change this:

-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-cd,bus=ide.1,drive=ins_cd

to this:

-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-hd,bus=ide.1,drive=ins_cd

Things not always be easy.

When I set install image from ide-cd to ide-hd, it gave me this:
http://i.imgur.com/CfZ1Edq.jpg

And if I set ide-hd back to ide-cd, it can enter without any problem, but stuck at "Starting Windows."

Maybe I can try put bootx64.efi into ISO file by using UltraISO or something.

And here is my script:

#!/bin/bash

qemu-system-x86_64 -enable-kvm -m 8192 -cpu host,kvm=off \
-smp 6,sockets=1,cores=6,threads=1 \
-bios /usr/share/qemu/bios.bin -vga none -nographic -localtime -boot menu=on \
-drive if=pflash,format=raw,readonly,file=/home/eddieak/OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/home/eddieak/OVMF/OVMF_VARS.fd \
-device vfio-pci,host=03:00.0,x-vga=on \
-device vfio-pci,host=03:00.1 \
-device virtio-scsi-pci,id=scsi \
-usb -usbdevice host:046d:c534 \
-drive file=/home/eddieak/win7.img,id=disk,format=raw,if=none -device scsi-hd,drive=disk \
-drive file=/home/eddieak/wintest.img,id=ins_cd,if=none -device ide-cd,bus=ide.0,drive=ins_cd \
-drive file=/home/eddieak/virtio.iso,id=virtocd,if=none -device ide-cd,bus=ide.1,drive=virtocd \
-net tap -net nic,macaddr=40-D8-2D-52-FB-43

Now I have no idea what problem about this.

The problem is windows 7 requires a CSM present in order to boot, thats why you're stuck on the windows logo, i posted a workarround a few pages back, i recommend you use windows 8 instead.

Offline

#4043 2015-02-03 06:16:54

AKSN74
Member
From: Taichung, Taiwan
Registered: 2014-02-18
Posts: 52

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

nbhs wrote:

The problem is windows 7 requires a CSM present in order to boot, thats why you're stuck on the windows logo, i posted a workarround a few pages back, i recommend you use windows 8 instead.

Mmm... Seems like it's only way to use Windows 8.1 instead of Win7.

ITOW, maybe it will not be stuck when rebooting if guest OS is Linux. From legacy bios to OVMF.

Offline

#4044 2015-02-03 08:55:04

nythrix
Member
Registered: 2015-01-22
Posts: 4

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

Quick question: Does anyone know why we can't pass through the intel igfx? Is it a technical limitation or a matter of not enough programmers/money thrown at it?

Offline

#4045 2015-02-03 08:59:16

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

nythrix wrote:

Quick question: Does anyone know why we can't pass through the intel igfx? Is it a technical limitation or a matter of not enough programmers/money thrown at it?

https://01.org/kvm/blogs/albcamus/2014/ … st-release

Offline

#4046 2015-02-03 09:15:28

Bronek
Member
From: London
Registered: 2014-02-14
Posts: 123

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

aw wrote:

Primary and secondary in this thread predominantly refers to how the graphics device is presented to the guest.  It's generally recommended that the graphics card for assignment is a secondary device on the host because it's often difficult to detach all the host drivers from the primary display.  Even if you use pci-stub.ids to prevent PCI drivers from attaching, the low level VGA/VESA drivers can still make use of it.  It's not necessarily impossible, but it's not a heavily used or documented path.


One way to do it is to avoid any use of VGA from host, e.g. redirect console to serial port (kernel command line parameter console=ttyS0 which effectively turns your host headless). I'd be interested to learn other ways.

Offline

#4047 2015-02-03 12:52:09

mostlyharmless
Member
Registered: 2014-01-16
Posts: 72

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

Supposedly the CSM requirement is only for Setup; making an unattended installation is thought to fix the Win 7 installation problem also, but I haven't verified this yet.

Offline

#4048 2015-02-03 14:59:04

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

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

nythrix wrote:

Quick question: Does anyone know why we can't pass through the intel igfx? Is it a technical limitation or a matter of not enough programmers/money thrown at it?

The problem is that IGD is not a self-contained device like a discrete graphics card.  Enabling it in the guest requires not only passing the device at PCI address 0000:00:02.0, but also modifying the PCI device IDs of various chipset components and emulating or passing through I/O ranges of other devices obliquely associated with graphics.  IOW, instead of being isolated to a single device, it's smeared across parts of the whole chipset.  It's not impossible to support it, Xen has done it and there's very rough prototype code to do it in KVM.  It is pretty messy though due to the architecture (or perhaps more correctly, lack of architecture in IGD design).

Last I heard, we're waiting on Intel to see if they can redesign their driver to take a more self-contained approach to IGD.  It's possible that some of the chipset and miscellaneous resource requirements are no longer necessary.  However, that may also mean that a solution relying on that approach may only work for the very latest devices.  I haven't had the time or interest to put in to IGD assignment, but another KVM developer has recently started looking at it, so it's possible it could move forward.


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

#4049 2015-02-03 15:00:39

lael
Member
Registered: 2015-02-03
Posts: 1

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

Hi guys congrats to this humongus thread!

I have been wanting to do such a setup for a long time, had some experience with XEN but i bought the wrong cpu for this with no vt-d and i postponed up until now that i am able to buy new hardware and would like to hear what parts to look out for and hopefully have less hassle setting everything up.

The doc with the listed Mainboards https://docs.google.com/spreadsheet/ccc … _web#gid=0 is a huge help but i fear that some info might be missing like info on Revision and the Motheboards i checked so far seem to be a quite a few years old but i am not done with the list yet.

Thanks for any suggestions.

Offline

#4050 2015-02-03 15:04:15

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

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

lael wrote:

Hi guys congrats to this humongus thread!

I have been wanting to do such a setup for a long time, had some experience with XEN but i bought the wrong cpu for this with no vt-d and i postponed up until now that i am able to buy new hardware and would like to hear what parts to look out for and hopefully have less hassle setting everything up.

The doc with the listed Mainboards https://docs.google.com/spreadsheet/ccc … _web#gid=0 is a huge help but i fear that some info might be missing like info on Revision and the Motheboards i checked so far seem to be a quite a few years old but i am not done with the list yet.

Thanks for any suggestions.

https://bbs.archlinux.org/viewtopic.php … 6#p1495466


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

Board footer

Powered by FluxBB