Paul Waldo wrote:
Hi
all,
I'm exporting my nVidia video card to one of my domUs. It works great,
but I am unable to get a console on the dom0. I'm assuming this is
because the video card is in use by the domU. Does this make sense
and, if so, can I solve this by adding abother PCI video card and
connecting the monitor to that? Thanks for helping!
Paul
Hi all,
I have receive numerous requests for how I did this, so I'm glad to
give back!
I do have to provide a caveat, so don't get your hopes up yet... My
setup is that I have a 4 CPU Xeon box. It is a big, loud, hot unit, so
it is in the computer closet. I am using a low-end machine on my desk
as a fancy xterminal. The idea is that KDE runs on the Xen box, and I
interact with it via the open source version of NX from nomachine.com,
running on my low-end machine. NX allows desktop sharing as well as
sound and printers to be seamlessly piped to the desktop box. The only
thing I haven't figured out is how to get peripherals attached to the
desktop box (like a CF card reader or a USB DVD writer) to be
automatically recognized on the Xen box... The idea behind getting the
domU to use the nVidia card is not necessarily for games and such,
although that may work OK...
So anyway, here is what I did to make this all work:
The first thing to do is hide the video card from the dom0. Here is
the stanza from my GRUB menu.lst:
title Xen 3.1 / Ubuntu 7.10, kernel 2.6.22-14-xen
root (hd0,0)
kernel /xen-3.1.gz dom0_mem=262144
module /vmlinuz-2.6.22-14-xen root=/dev/mapper/hydra-root ro
xencons=xvc console=xvc0 console=tty1 pciback.hide=(05:00.0)
module /initrd.img-2.6.22-14-xen
quiet
The key here is "pciback.hide=(05:00.0)". The number
is obtained using the lspci command on dom0:
root@hydra:~# lspci|grep -i nvidia
05:00.0 VGA compatible controller: nVidia Corporation NV38GL [Quadro FX
1300] (rev a2)
So, once the changes are made to the GRUB config, reboot the machine. Be
prepared to SSH into the box, as you won't get a console!!! The
reason for this is that as far as the dom0 is concerned, the video card
doesn't exist. Actually, it may not be that dire. IIRC, I was still
able to get a console at this point, and it is the next step that
prevented the console. I know my memory, and would not rely on it too
much if I were you. Just make sure that sshd is running before you do
any of this... :-)
OK, so now the video card has been unshackled from the dom0. How do
you get a domU to claim it? Here is my domU's config file:
#
# Configuration file for the Xen instance gutsy, created
# by xen-tools 3.5 on Mon Nov 5 13:39:24 2007.
#
#
# Kernel + memory size
#
kernel = '/boot/vmlinuz-2.6.22-14-xen'
ramdisk = '/boot/initrd.img-2.6.22-14-xen'
memory = '1024'
vcpus = '4'
extra = 'xencons=xvc'
pci = ['05:00.0']
#
# Disk device(s).
#
root = '/dev/sda1 ro'
disk = [ 'file:/root/domains/gutsy/disk.img,sda1,w',
'file:/root/domains/gutsy/swap.img,sda2,w' ]
#
# Hostname
#
name = 'gutsy'
#
# Networking
#
dhcp = 'dhcp'
vif = [ '' ]
#
# Behaviour
#
on_reboot = 'restart'
on_crash = 'restart'
The key line here is "pci = ['05:00.0']".
This tells the domU to claim the video card. Reboot the domU and you
should then be able to see the video card:
$ lspci
00:00.0 VGA compatible controller: nVidia Corporation NV38GL [Quadro FX
1300] (rev a2)
At this point, you can use it just like a normal machine. Change your
driver in xorg.conf from "nv" to "nvidia", "apt-get install
nvidia-glx-new" to get the nVidia drivers, maybe do a reboot, and you
are up and running!
As pointed out in the caveat, I DO NOT get graphical output from the
video card, nor am I even able to log into the box from the console. I
am going to try putting an additional PCI video card into the machine
for console logins, but I'm pretty happy with the setup.
Feel free to let me know if you have questions, and by all means let me
know if you have success. Good luck!
Paul
|