Skip to contentSkip to conversation

Unable to start Windows 8 HVM guest with Xen VGA Passthrough with Xen 4.2.1-pre

DISCUSSION Teo En Ming (Zhang Enming) 2 participants 5 messages Sep 29, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

I have applied Xen VGA passthrough patches from David Techer's personal website to Xen 4.2.1-pre source tree. Everything compiled and installed smoothly. But when I tried to start Windows 8 HVM domU with VGA passthrough, it gave me the following error:

xc: error: unable to allocate memory to the HVM guest. (16: device or resource busy): Internal error.

There are no issues with Xen 4.2-unstable changeset 25099 however.

Signature · 4 lines
Yours sincerely,

Mr. Teo En Ming (Zhang Enming)
Singapore
#1 lore raw
Quoted 7 lines · Teo En Ming (Zhang Enming)

Hi,

I have applied Xen VGA passthrough patches from David Techer's personal website to Xen 4.2.1-pre source tree. Everything compiled and installed smoothly. But when I tried to start Windows 8 HVM domU with VGA passthrough, it gave me the following error:

Quoted 5 lines

xc: error: unable to allocate memory to the HVM guest. (16: device or resource busy): Internal error.

There are no issues with Xen 4.2-unstable changeset 25099 however.

Attached are screenshots of the errors for Xen 4.2.1-pre and Xen configuration files.

The following are links to screenshots of the errors for Xen 4.2.1-pre.

http://i45.tinypic.com/2j3s7pj.jpg

http://i45.tinypic.com/95myc3.jpg

Signature · 4 lines
Yours sincerely,

Mr. Teo En Ming (Zhang Enming)
Singapore

#!/bin/sh
set -x
#
# Starts Shorewall Firewall
sudo service shorewall restart
#
# Loads pci-stub kernel module
sudo modprobe pci-stub
#
# Passthrough EVGA Geforce GTX 560 1 GB GDDR5
#
echo "Passthrough EVGA Geforce GTX 560 1 GB GDDR5"
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:01:00.0/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "10de 1201" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:01:00.0" > /sys/bus/pci/devices/0000:01:00.0/driver/unbind echo "0000:01:00.0" > /sys/bus/pci/drivers/pci-stub/bind
#
# Passthrough Intel HD Audio Controller
#
echo "Passthrough Intel HD Audio Controller."
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:00:1b.0/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3a6e" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:1b.0" > /sys/bus/pci/devices/0000:00:1b.0/driver/unbind echo "0000:00:1b.0" > /sys/bus/pci/drivers/pci-stub/bind
#
# Sleep for 10 secs
#
sleep 10
#
# Passthrough USB Controller #1
#
echo "Passthrough USB Controller #1."
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:00:1a.0/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3a67" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:1a.0" > /sys/bus/pci/devices/0000:00:1a.0/driver/unbind echo "0000:00:1a.0" > /sys/bus/pci/drivers/pci-stub/bind
#
# Passthrough USB Controller #2
#
echo "Passthrough USB Controller #2."
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:00:1a.1/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3a68" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:1a.1" > /sys/bus/pci/devices/0000:00:1a.1/driver/unbind echo "0000:00:1a.1" > /sys/bus/pci/drivers/pci-stub/bind
#
# Passthrough USB Controller #3
#
echo "Passthrough USB Controller #3."
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:00:1a.2/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3a69" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:1a.2" > /sys/bus/pci/devices/0000:00:1a.2/driver/unbind echo "0000:00:1a.2" > /sys/bus/pci/drivers/pci-stub/bind
#
# Passthrough USB Controller #4
#
echo "Passthrough USB Controller #4."
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:00:1a.7/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3a6c" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:1a.7" > /sys/bus/pci/devices/0000:00:1a.7/driver/unbind echo "0000:00:1a.7" > /sys/bus/pci/drivers/pci-stub/bind
#
# Passthrough USB Controller #5
#
echo "Passthrough USB Controller #5."
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:00:1d.0/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3a64" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:1d.0" > /sys/bus/pci/devices/0000:00:1d.0/driver/unbind echo "0000:00:1d.0" > /sys/bus/pci/drivers/pci-stub/bind
#
# Passthrough USB Controller #6
#
echo "Passthrough USB Controller #6."
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:00:1d.1/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3a65" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:1d.1" > /sys/bus/pci/devices/0000:00:1d.1/driver/unbind echo "0000:00:1d.1" > /sys/bus/pci/drivers/pci-stub/bind
#
# Passthrough USB Controller #7
#
echo "Passthrough USB Controller #7."
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:00:1d.2/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3a66" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:1d.2" > /sys/bus/pci/devices/0000:00:1d.2/driver/unbind echo "0000:00:1d.2" > /sys/bus/pci/drivers/pci-stub/bind
#
# Passthrough USB Controller #8
#
echo "Passthrough USB Controller #8."
sudo chmod o+w /sys/bus/pci/drivers/pci-stub/new_id
sudo chmod o+w /sys/bus/pci/devices/0000:00:1d.7/driver/unbind sudo chmod o+w /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3a6a" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:1d.7" > /sys/bus/pci/devices/0000:00:1d.7/driver/unbind echo "0000:00:1d.7" > /sys/bus/pci/drivers/pci-stub/bind

#
# Wait for 10 seconds
#
sleep 10
#
# Start Windows HVM domU with VGA Passthrough
#
#sudo xl create /etc/xen/WindowsXPHomeEditionSP3
sudo xl create /etc/xen/windows8

# XL domain configuration file for Windows 8 Consumer Preview 64-bit English HVM domU # Please refer to "man xl.cfg" for further explanations.
# See also docs/misc/xl-network-configuration.markdown and

# docs/misc/xl-disk-configuration.txt
# Written by Teo En Ming (Zhang Enming)
# Email: [email protected]
# Mobile Phone: +65-8369-2618
# Country: Singapore
# Date: 18 Mar 2012 Sun
name="Windows8"
# Product Key: DNJXJ-7XBW8-2378T-X22TX-BKG7J
builder="hvm"
vcpus=2
memory=2048
on_poweroff="destroy"
on_reboot="restart"
on_crash="destroy"
disk=[ 'format=raw, vdev=hda, access=rw, target=/etc/xen/images/windows8.img', 'format=raw, vdev=hdc, access=ro, devtype=cdrom, target=/home/teo-en-ming/Windows8-ReleasePreview-64bit-English.iso' ]
#vif=[ 'bridge=virbr0,type=ioemu,model=e1000' ]
#boot=[c|d|n]
#Selects the emulated virtual device to boot from. Options are hard disk (c), cd-rom (d) or network/PXE (n).
#Multiple options can be given and will be attempted in the order they are given. e.g. to boot from cd-rom
#but fallback to the hard disk you can give dc. The default is cd.
boot="dc"
acpi=1
#xen_platform_pci=1
#viridian=1
#stdvga=1
vnc=1
vnclisten="192.168.1.2"
vncdisplay=0
vncunused=1
vncpasswd=""
sdl=0
usb=1
usbdevice="tablet"
# Enable Xen VGA Passthrough
gfx_passthru=1
# VGA Passthrough EVGA Geforce GTX 560 1 GB GDDR5.
pci = [ '01:00.0','00:1b.0','00:1a.0','00:1a.1','00:1a.2','00:1a.7','00:1d.0','00:1d.1','00:1d.2','00:1d.7' ]
# PCI Passthrough Intel HD Audio Controller.
#pci = [ '00:1b.0' ]
# PCI Passthrough all the USB Controllers.
# pci = [ '00:1a.0','00:1a.1','00:1a.2','00:1a.7','00:1d.0','00:1d.1','00:1d.2','00:1d.7' ]

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw

Hello Teo,

That output is identical to the errors I had a few days ago, which was related to available RAM.

Ian helped me debug it, said xl was having a ballooning problem and couldn't free up enough RAM in time to start my HVM.

His suggested solution was to assign a fixed amount of RAM to Dom0 and turn off ballooning.

Prior to this I had been letting Dom0 take all the RAM, but this problem was fixed by adding dom0_mem to grub.cfg and setting a fixed value.

Have you tried re-running the xl create command after the first error? There are commands to move RAM around at run-time as well that you could try.

~Casey

Quoted 33 lines · Teo En Ming (Zhang Enming)
Quoted 7 lines · Teo En Ming (Zhang Enming)

Hi,

I have applied Xen VGA passthrough patches from David Techer's personal website to Xen 4.2.1-pre source tree. Everything compiled and installed smoothly. But when I tried to start Windows 8 HVM domU with VGA passthrough, it gave me the following error:

Quoted 6 lines

xc: error: unable to allocate memory to the HVM guest. (16: device or resource busy): Internal error.

There are no issues with Xen 4.2-unstable changeset 25099 however.

Attached are screenshots of the errors for Xen 4.2.1-pre and Xen configuration files.

The following are links to screenshots of the errors for Xen 4.2.1-pre.

http://i45.tinypic.com/**2j3s7pj.jpg <http://i45.tinypic.com/2j3s7pj.jpg>

http://i45.tinypic.com/95myc3.**jpg <http://i45.tinypic.com/95myc3.jpg>

--
Yours sincerely,

Mr. Teo En Ming (Zhang Enming)
Singapore

Quoted 5 lines

_______________________________________________
Xen-users mailing list
[email protected]
http://lists.xen.org/xen-users

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw

Dear Casey,

I had dom0_mem set to 1024 and 4096 as well, but it did not help. I am still getting the errors.

I have 6 GB of memory installed. How much memory should I assign to dom0_mem?

Thank you for your prompt reply.

Signature · 4 lines
Yours sincerely,

Mr. Teo En Ming (Zhang Enming)
Singapore
Quoted 53 lines · Casey DeLorme

Hello Teo,

That output is identical to the errors I had a few days ago, which was related to available RAM.

Ian helped me debug it, said xl was having a ballooning problem and couldn't free up enough RAM in time to start my HVM.

His suggested solution was to assign a fixed amount of RAM to Dom0 and turn off ballooning.

Prior to this I had been letting Dom0 take all the RAM, but this problem was fixed by adding dom0_mem to grub.cfg and setting a fixed value.

Have you tried re-running the xl create command after the first error? There are commands to move RAM around at run-time as well that you could try.

~Casey

On Sat, Sep 29, 2012 at 12:09 PM, Teo En Ming (Zhang Enming) <[email protected] <mailto:[email protected]>> wrote:

On 29/09/2012 21:35, Teo En Ming (Zhang Enming) wrote:

Hi,

I have applied Xen VGA passthrough patches from David Techer's personal website to Xen 4.2.1-pre source tree. Everything compiled and
installed smoothly. But when I tried to start Windows 8 HVM domU with
VGA passthrough, it gave me the following error:

xc: error: unable to allocate memory to the HVM guest. (16:
device or
resource busy): Internal error.

There are no issues with Xen 4.2-unstable changeset 25099 however.

Attached are screenshots of the errors for Xen 4.2.1-pre and Xen configuration files.

The following are links to screenshots of the errors for Xen 4.2.1-pre.

http://i45.tinypic.com/2j3s7pj.jpg

http://i45.tinypic.com/95myc3.jpg

--
Yours sincerely,

Mr. Teo En Ming (Zhang Enming)
Singapore

Quoted 6 lines

_______________________________________________
Xen-users mailing list
[email protected] <mailto:[email protected]>
http://lists.xen.org/xen-users

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw

I am working with 32GB, so you probably don't want to model your configuration after mine. My problem was memory was not being freed from Dom0 fast enough.

If you have already lowered Dom0 memory, checked it with xl info, and are still having problems launching, then it might be something else.

My assumption is the memory assigned in the configuration is not a 1:1 map to what is required.

---

I decided to run some tests to see how Xen used my memory.

Starting with Dom0 and ipfire running, I ran xl info, got the diff, and then xl list and compared the two to find that xl info shows 500MB more memory used up.

I started Windows, and again roughly 500MB unaccounted for.

---

So, based on that information I can assume Xen requires half a gigabyte to work with in the backend for its normal responsibilities.

The wiki has a best practices which shows 512MB set for Dom0:
http://wiki.xen.org/wiki/Xen_Best_Practices

I would try setting 512MB in your grub configuration like the above, check available RAM after your reload using xl info, making sure you have more than the 2GB set in the HVM configuration.

If it still doesn't work, then it must be something different. You could also try lowering the memory in your DomU configuration as an alternative, just to see if it works.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel