Monday, 1 July 2019

virtualbox - extending xorg.conf to account for a boot from virtual box


i have a ubuntu10.10/win7 dual boot. i use win7 as a host for virtual box and run the existing ubuntu in virtual box.


when i installed vb additions and extensions, the xorg.conf file got overwritten.


depending on how i would boot (natively or through virtual machine) i have to change xorg.conf file manually. is there a way to make it automatic? putting both configs into xorg.conf file didn't work.


i filed a ticket couple days ago http://www.virtualbox.org/ticket/8360 but got no response. i'm sure there is a quick fix for this. any ideas??? i documented my experience (if u need more details) here: http://kirilligum.wordpress.com/2011/02/17/run-existing-linux-ubuntu-10-10-partition-in-virtualbox-under-host-windows-7-system-on-thinkpad-x201t/



Answer



Create a script in /etc/init.d that runs during boot that detects whether or not it's running in a VirtualBox VM, and install the appropriate xorg.conf. Something similar to this should work:


if [ `dmidecode -s system-product-name` = "VirtualBox" ]
then
cp /etc/X11/xorg.conf.vbox /etc/X11/xorg.conf
else
cp /etc/X11/xorg.conf.real /etc/X11/xorg.conf
fi

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...