PDA

View Full Version : [ubuntu] Virtualbox virtual/physical xorg.conf problem


Chrus
August 24th, 2009, 07:57 AM
I've set my computer up to duel boot Ubuntu and Vista. I set my vista partition to run as a guest OS on a linux host using virtualbox with no major dramas.

Now im trying to set up my ubuntu partition as a guest OS on a vista host. I've got most of it working, but getting video to work is really frustrating. I can only get video working properly in the virtual machine if i comment out the drivers for my physical setup, which obviously causes problems later.

Heres my xorg.conf
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# Note that some configuration settings that could be done previously
# in this file, now are automatically configured by the server and settings
# here are ignored.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "Monitor"
Identifier "Configured Monitor"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
EndSection

Section "Module"
Load "glx"
EndSection

Section "Device"
Identifier "Configured Video Device"
Driver "nvidia"
Option "UseDisplayDevice" "DFP"
Option "NoLogo" "True"
BusID "01:00:00"
# Option "SLI" "SFR"
EndSection

Section "Device"
Identifier "Configured Video Device"
Driver "vboxvideo"
EndSection

Is there an "option" i can add that will tell it to use the vboxvideo driver in the VM and the nvidia driver when i boot the pc into ubuntu?

Cheers

Chrus
August 24th, 2009, 10:19 PM
Problem solved.

I got it working by making 2 xorg.conf files (called xorg.conf.nv and xorg.conf.vb) and running a script on startup that would pick the correct conf file and link xorg.conf to it.

Heres my script:
#!/bin/sh
## Get the videocard and put it in a variable
vga=$(lspci | grep VGA | head -n 1 | cut -d ' ' -f 5)

## the real magic comes now
if [ $vga = nVidia ] ; then
ln -sf /etc/X11/xorg.conf.nv /etc/X11/xorg.conf
elif [ $vga = InnoTek ] ; then
ln -sf /etc/X11/xorg.conf.vb /etc/X11/xorg.conf
else
echo "This system is not running on an nVidia graphics card, or inside a VirtualBox virtual machine."
fi