View Single Post
Old 12-03-09, 05:53 PM   #84
LewC
Registered User
 
Join Date: Dec 2009
Posts: 1
Default Re: Nvidia support for Xen

xen supports using external devices so you can direct access the device(s) including graphics cards as the video shows, follow the youtube link to his blog and take his software specs down then follow this (he buried it deep within a forum archive the spaz)
Quote:
Linux bash shell scripts for PCI device passthrough:

(1) passthru-nvidia.sh

#!/bin/sh
echo "10de 06e4" > /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

(2) passthru-firewire.sh

#!/bin/sh
echo "11c1 5811" > /sys/bus/pci/drivers/pci-stub/new_id
echo "0000:02:01.0" > /sys/bus/pci/devices/0000:02:01.0/driver/unbind
echo "0000:02:01.0" > /sys/bus/pci/drivers/pci-stub/bind

#Unload firewire driver
rmmod firewire_ohci
rmmod firewire_core

(3) passthru-audio.sh

#!/bin/sh
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

rmmod snd_hda_intel


Windows XP Home Edition SP3 32-bit HVM virtual machine configuration
file /etc/xen/winxphome32:

#import os, re
#arch = os.uname()[4]
#if re.search('64', arch):
# arch_libdir = 'lib64'
#else:
# arch_libdir = 'lib'

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

# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
#shadow_memory = 8
name = "winxphome32"
vif = [ 'bridge=eth0' ]
acpi = 1
apic = 1
disk = [ 'phy:/dev/virtualmachines/winxphome32,hda,w',
'phy:/dev/sr0,hdc:cdrom,r' ]

#device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
#device_model = '/usr/' + 'lib' + '/xen/bin/qemu-dm'
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' ]
# nVidia Geforce 8400 GS & firewire controller & HD audio controller
pci = [ '01:00.0','02:01.0','00:1b.0' ]
vcpus=2
# No passthrough
#gfx_passthru=0
# onboard
#gfx_passthru=1
# nvidia
gfx_passthru=2

# 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'

All-in-one script to call the above-mentioned scripts and HVM config:

#!/bin/sh

# Stops the BOINC Core Client
service boinc-client stop

# Passthrough NVIDIA graphics card
/etc/xen/scripts/passthru-nvidia.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 10

# Start Windows XP guest domain
xm create winxphome32
this is not a comprehensive guide however it should work with a little common sense
LewC is offline   Reply With Quote