Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1820144
  • 博文数量: 473
  • 博客积分: 13997
  • 博客等级: 上将
  • 技术积分: 5953
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-22 11:52
文章分类

全部博文(473)

文章存档

2014年(8)

2013年(38)

2012年(95)

2011年(181)

2010年(151)

分类: LINUX

2011-05-29 22:43:18

ATI
=============================================
I was able to successfully passthrough my ATI Radeon 4550 VGA to a HVM
Windows 7 guest.
However, after installing ATI/AMD latest Catalyst drivers, I get a BSOD on
reboot.

Here are the steps I've followed to get there :

Motherboard : Intel DQ45CB (with VT-d support)
CPU : Intel Core 2 Duo E8400 3.00 Ghz (with VT-d support)
Dom0 OS : Debian 6 Squeeze 64-bit

1- Install Debian stock Xen Kernel with Dom0 support (2.6.32-5) :
apt-get install linux-image-2.6-xen-amd64

2- Install Xen required packages
apt-get install bcc bin86 gawk bridge-utils iproute libcurl3
libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo
texlive-latex-base texlive-latex-recommended texlive-fonts-extra
texlive-fonts-recommended pciutils-dev mercurial build-essential make gcc
libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch
libvncserver-dev libsdl-dev libjpeg62-dev iasl libbz2-dev e2fslibs-dev
git-core uuid-dev ocaml libx11-dev bison flex ocaml-findlib gcc-multilib
xz-utils

3- Download and extract Xen 4.1.0 (Current stable version)
cd /usr/src/; wget

tar xvzf xen-4.1.0.tar.gz

4- Apply Mr. Wei Huang's patch (with dynamic detection of BARs) to Xen 4.1.0
source code
cd /usr/src/xen-4.1.0/tools/ioemu-qemu-xen; touch patchATI.txt
(Copy paste in file patchATI.txt, code found here :
)
patch -p1 < patchATI.txt

5- Compile and install Xen
cd /usr/src/xen-4.1.0
make xen
make tools
make stubdom
make install-xen
make install-tools PYTHON_PREFIX_ARG=
make install-stubdom

6- Change default script for grub menu to 20_linux_xen :
cd /etc/grub.d/; mv 10_linux 50_linux

7- Modify /etc/default/grub following entry to a functionnal kernel/xen
combo (In my case it was entry 2 (Skipped 0 and 1 which were automatically
created with file xen-syms-4.1.0 and didn't boot) :
GRUB_DEFAULT=2

8- Use pciback to hide VGA (01:00.0 for my box, lspci -v) from host OS (In
my case, I had to hide and passthrough ATI audio device (01:00:1) as well) -
Note that Dom0 won't have access to VGA adapter anymore after reboot :
GRUB_CMDLINE_LINUX="xen-pciback.permissive
xen-pciback.hide=(01:00.0)(01:00.1) pci=resource_alignment=01:00.0;01:00.1"

9 - To apply changes made during steps 6, 7 and 8
update-grub

10- Add this line to your /etc/fstab :
none /proc/xen xenfs defaults 0 0

11- Add this module to your /etc/modules file :
xen-evtchn

12- Reboot, then start Xend (using SSH obviously)
reboot
/etc/init.d/xencommons start
/etc/init.d/xend start

13 - Make sure you have following settings in your guest VM config (I've
only tried passthrough with a preinstalled Win7 guest for the moment, I
didn't try to go through the whole installation process yet) :
gfx_passthru=1
pci=[ '01:00.0', '01:00.1' ]

14- Start VM with your fingers crossed

At this point, I see Windows 7 boot screen, then login screen. After
installing latest ATI/AMD drivers and rebooting, I get a BSOD.

Hopefully it can help some people getting the initial Xen VGA passthrough
setup done.
As far as I know, this patch only works with fairly recent ATI adapters.

I'm not a Xen expert in any way, so let me know if you have any idea about
what's missing or what would be the next troubleshooting steps.



IGD
=============================================
My HVM configuration file:
=================

kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
memory = 3072

name = "win7-ent-x64"
vif = [ 'bridge=eth0' ]
acpi = 1
apic = 1
#disk = [
'file:/media/204b63da-9cae-4e4d-ac98-bee4e36fec18/win7-ent-x64.img,hda,w',
'file:/media/204b63da-9cae-4e4d-ac98-bee4e36fec18/7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso,hdc:cdrom,r'
]
disk = [
'file:/media/204b63da-9cae-4e4d-ac98-bee4e36fec18/win7-ent-x64.img,hda,w',
'phy:/dev/sr0,hdc:cdrom,r' ]

device_model = 'qemu-dm'

#-----------------------------------------------------------------------------
# boot on floppy (a), hard disk (c) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
boot="cd"
sdl=0
vnc=1
vnclisten="192.168.1.2"
vncdisplay=1
vncunused=1
vncconsole=0
vncpasswd=''

#serial='pty'
#usbdevice='tablet'
# onboard
#pci = [ '00:02.0' ]
##########################
# Xen 3.5 unstable options
##########################
# nVidia Geforce 8400 GS & firewire controller & HD audio controller
#pci = [ '01:00.0','02:01.0','00:1b.0' ]
#######################
# Xen 4.0.2-rc1-pre options
#######################
# IGD & HD audio controller
pci = [ '00:02.0','00:1b.0' ]


vcpus=1
##########################
# Xen 3.5 unstable options
##########################
# No passthrough
#gfx_passthru=0
# onboard
#gfx_passthru=1
# nvidia
#gfx_passthru=2
#######################
# Xen 4.0.2-rc1-pre options
#######################
gfx_passthru=1


# Can only pass through one usb device at a time
usb=1
# USB Unity Green Mouse
#usbdevice = 'host:1bcf:0007'
# USB A1pro Black Mouse
usbdevice = 'host:15d9:0a41'
# USB Keyboard
#usbdevice = 'host:0603:00f2'
# USB Sony IC Recorder
#usbdevice = 'host:054c:0271'
# USB Lexmark X1270 Color Printer
#usbdevice = 'host:043d:00ff'
# USB Lexmark X1270 Photo Scanner
#usbdevice = 'host:043d:007d'
# USB Lexmark X1270 Generic Hub
#usbdevice = 'host:043d:007a'
# Hauppauge WinTV PVR USB2 TV Tuner
#usbdevice = 'host:2040:2400'

#tsc_native=1



My Linux bash shell script start-windows:
==========================

#!/bin/sh

set -x

# Stops the BOINC Core Client
service boinc-client stop

# Stops the Snort NIDS
service snort stop

# Stops barnyard
service barnyard stop

# Stops NTOP
service ntop stop

# Stops OSSEC HIDS
service ossec stop

# Passthrough NVIDIA graphics card
#/etc/xen/scripts/passthru-nvidia.sh
# Passthrough IGD
/etc/xen/scripts/passthru-igd.sh
# Passthrough Firewire port
#/etc/xen/scripts/passthru-firewire.sh
# Passthrough Audio Controller
/etc/xen/scripts/passthru-audio.sh

ls -ltr /sys/bus/pci/drivers/pci-stub/
sleep 5

# Start Windows XP guest domain
#xm create winxphome32
mount /dev/sdb3 /media/204b63da-9cae-4e4d-ac98-bee4e36fec18
xm create windows7ent
阅读(763) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~