Page 1 of 1

disable vbox additions *temporarily* while booting

Posted: 2. Nov 2010, 15:15
by normanzb
hi folks

I installed dual system (win 7 and ubuntu 10.10) on my machine each on different partition, however I would like my ubuntu can be ran in virtual box when I already logged into win 7, I meant, i want ubuntu can be booted either *natively* or *guestly*, so I created vmdk that points to rawdisk and it works great for me,

but after installed virtual box addtions, I cannot booting ubuntu *natively* , while logging it shows a message "Guest PCI device not found".

so is it possibly to disable vboxadd while booting natively? should i modify the grub.cfg? or maybe loads the vbox additions service manually? any point will be appreicated.

Re: disable vbox additions *temporarily* while booting

Posted: 2. Nov 2010, 22:13
by Sasquatch
You can see if there is an init script or something and remove that from the start-up. This can be done with 'update-rc.d -f <init name> remove' as root. Then create your own script that checks for the environment it runs on and call the init script you disabled if it matches, passing the start, stop and reload parameters to the init script as if it was called normally.

Re: disable vbox additions *temporarily* while booting

Posted: 9. Feb 2011, 20:49
by waltj
I'm try to do the exact same thing. I have a bootable linux (Ubuntu) partition and would like to use the guest additions while accessing this partition through VirtualBox in Windows 7. However, once the guest additions are installed the Ubuntu partition will not boot properly outside of VirtualBox (standalone). I can manually install and uninstall the guest additions based on whether I'm using VirtualBox or not. But I'd rather to detect whether booting in VirtualBox and then enable the guest addtions if so. I don't know how to do this. Can anyone help with this?

Re: disable vbox additions *temporarily* while booting

Posted: 10. Feb 2011, 23:14
by Sasquatch
Like I said above, write an init script that checks if it runs in a VM or not. There are plenty of bash and shell script examples that let you check for certain values to exist and execute things when you get a match. For example, check what video card you have through lspci.

Code: Select all

if [ lspci | grep VGA | grep nVidia ] ; then
  echo "this is a direct boot, because I found an nVidia video card"
else
  echo "this is probably the VM, couldn't detect an nVidia video card"
fi