VirtualBox notes

From Noah.org
Revision as of 13:51, 6 March 2015 by Root (Talk | contribs) (Mac OS X fix)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Install Guest Additions

This is the equivalent of VMware or Parallels Tools. Under VirtualBox application menu go to: "Devices | Install Guest Additions...". This will cause a virtual CD-ROM ISO to be mounted on your guest Linux system. From inside the guest you just run a simple installer script:

$ sudo su -
# cd /media/cdrom0
# ./VBoxLinuxAdditions-x86.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox 2.0.2 Guest Additions for Linux installation.........................................................................................................................................................................................
VirtualBox 2.0.2 Guest Additions installation
Attempt to remove old DKMS modules...
Done.
Building the VirtualBox Guest Additions kernel module...
Building the shared folder support kernel module...
Installing the VirtualBox Guest Additions...

Successfully installed the VirtualBox Guest Additions.
You must restart your guest system in order to complete the installation.
# shutdown -r now

Restart the guest and then you should have seamless mouse interaction. Cut and paste between Host and Guest works, but I've found it can be confusing. Next you just need to update your /etc/X11/xorg.conf to get full screen video support.

Guest video resolution

Edit /etc/X11/xorg.conf and replace the file with the following. You can try other resolutions besides 1024x768 and 1280x1024. Mode "1440x900" is for a 17" MacBook Pro and mode "1680x1050" is for a 22" Dell E228WFP display.

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

Section "Monitor"
  Identifier "Configured Monitor"
EndSection

Section "Screen"
  Identifier "Default Screen"
  Device "VirtualBox graphics card"
  Monitor "Generic Monitor"
  DefaultDepth 24
  SubSection "Display"
    Depth 24
    Modes "1024x768" "1280x1024" "1440x900" "1680x1050"
  EndSubSection
EndSection

Restart the guest.

For reference, the default xorg.conf file looks like this:

Section "Device"
    Identifier  "Configured Video Device"
EndSection

Section "Monitor"
    Identifier  "Configured Monitor"
EndSection

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


ERROR: Kernel driver not installed (rc=-1908)

When attempting to start a guest you may see the following error message (in either Mac OS X or Linux):

Kernel driver not installed (rc=-1908)

Make sure the kernel module has been loaded successfully.

Afterwards the guest status will show a red - with the message Aborted.

This usually happens after you upgrade the host OS or kernel.

Mac OS X fix

If you see this while running under Mac OS X then quickest fix is to run this command:

sudo kextload /Library/Extensions/VBoxDrv.kext/

If this does not work then you probably got a message like this (probably you don't have /Library/Extensions/VBoxDrv.kext):

/Library/Extensions/VBoxDrv.kext failed to load - (libkern/kext) not found; check the system/kernel logs for errors or try kextutil(8).

No matter what error your get then try running the following command to correct the problem.:

sudo /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh restart

Linux fix

If you have this problem while running VirtualBox under Linux then try running:

/etc/init.d/vboxdrv setup

For Ubuntu Linux you may also want to install the 'dkms package' to help avoid this problem in the future.

sudo apt-get install linux-headers-$(uname -r)
sudo dpkg-reconfigure virtualbox-dkms  
sudo modprobe vboxdrv

The following does the same, but completely reinstalls virtualbox-dkms. You may have to restart the host machine using this method.

sudo apt-get install linux-headers-$(uname -r)
sudo apt-get remove virtualbox-dkms
# You may want to even PURGE the package. This removes all the old config files, too.
#sudo apt-get purge virtualbox-dkms
sudo apt-get install virtualbox-dkms
sudo modprobe vboxdrv