This will explain how to install and configure VirtualBox to run on your Crunchbang system.
There are two version of VirtualBox to choose from:
There is a webpage that details the differences between the two editions, but here is a quick listing of the differences:
This HOWTO will be using the PUEL edition because I need to have USB support in my virtual machines, and the OSE version does not support USB.
There are a number of ways to install VirtualBox onto your system.
Using apt-get
Graphical installation
Command Line installation
By far the easiest ways to install VirtualBox (and any other software) is by using apt-get in Terminal Emulator.
Open up Terminal Emulator (Openbox Menu > Terminal Emulator)
At the prompt, type:
$sudo nano /etc/apt/sources.list
or
$gksu gedit /etc/apt/sources.list
Enter your password.
You will need to add the appropriate line to your
/etc/apt/sources.list file:
deb http://download.virtualbox.org/virtualbox/debian intrepid non-free ## #! 08.10
deb http://download.virtualbox.org/virtualbox/debian hardy non-free ## #! 08.04
deb http://download.virtualbox.org/virtualbox/debian gutsy non-free ## #! 07.10
Put the line that corresponds to your version of Crunchbang in your file, either by retyping it or copying and pasting it. Then save the file.
You will need to install the Sun public key to your system. You can do that with one command:
$wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -
You will need to update your repositories with the new addition that you made, so go back to
Terminal Emulator and type:
$sudo apt-get update
Now to install virtualbox with apt get, type:
$sudo apt-get install virtualbox-2.1
That will run the installer and get VirtualBox 2.1 installed on your system. There are some additional steps to get it configured that will be later in the document.
This method is the next easiest method to install VirtualBox onto your system.
Make sure that you have gdebi installed on your system.
$sudo apt-get install gdebi
-
Go to your download location.
Double-click the .deb package that you downloaded. (virtualbox-2.1_2.1.0-41146_Ubuntu_intrepid_i386.deb at the time of writing.)
Click the 'Install Package' button in Package Installer
Enter your password
Click the 'Forward' button on the Creating group 'vboxusers' box.
Click 'Close' when the installer finishes.
Close Package Installer
Add yourself to the 'vboxusers' group
Go to Users/Groups (Openbox Menu > System > Users/Group)
Click on the 'Unlock' button
Enter your password and hit the 'Authenticate' button
Select your USERNAME and hit the 'Properties' button
Select the 'User Privileges' tab
Click in the box next to 'Use VirtualBox' and hit 'OK'
Close 'Users/Groups'
Logout/Login for the Group changes to take effect
You are ready to start up VirtualBox.
Bring up a Run dialog box
Openbox Menu > Run Program
Press ALT-F2
Type 'VirtualBox'
Accept the Personal Use and Evaluation License (PUEL) by scrolling all the way down and pressing the 'I Agree' button
Register your VirtualBox
Make some virtual machines!
This method is the most advanced method to install VirtualBox onto your system.
Make sure that you have gdebi installed on your system.
$sudo apt-get install gdebi
-
Install VirtualBox to your system:
Open up Terminal Emulator (Openbox Menu > Terminal Emulator)
Navigate to where your download is located.
Use gdebi to install the package:
$sudo gdebi virtualbox-2.1*.deb
Enter your password.
Say 'Y' to question about installing software package
Hit 'OK' to the Creating group 'vboxusers'
Add yourself to the 'vboxusers' group with the command:
$sudo gpasswd -a USERNAME vboxusers
Logout/Login for the group change to take effect
You are ready to start up VirtualBox.
Bring up a Run dialog box
Openbox Menu > Run Program
Press ALT-F2
Type 'VirtualBox'
Accept the Personal Use and Evaluation License (PUEL) by scrolling all the way down and pressing the 'I Agree' button
Register your VirtualBox
Make some virtual machines!
Getting USB support working is a little harder with the Intrepid release, but still rather easy.
Open up Terminal Emulator (Openbox menu > Terminal Emulator)
Type in the following:
$gksu gedit /etc/init.d/mountdevsubfs.sh
Add the following lines to the END of the do_start() function:
#
# Magic to make /proc/bus/usb work
#
# These following 4 lines were uncommented to make USB devices avabilable in vmware
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb
Save the file and REBOOT your system.
When you go back into VirtualBox settings for one of your virtual machines, you should see an entry for USB present.
There are different ways to install Guest Additions; here's a quick one:
Boot your CrunchBang machine in VirtualBox
Make sure you have installed the following packages: linux-headers-generic build-essential
In VirtualBox, click Devices/Install Guest Additions - this will mount the virtual Guest Additions 'CD' image
Open a terminal and type sudo thunar - after entering your password, it will bring up the Thunar file manager with root/sudo access.
Browse to the VBOXADDITIONS_* virtual CD that should now be visible in the left column of Thunar
Click (or double-click, depending on your settings) on the appropriate file. For 32-bit CrunchBang, you'd currently use VBoxLinuxAdditions-x86.run
A terminal will open and begin the installation. After it's complete it'll ask you to 'Press Return to close this window . . .'
Restart CrunchBang and you should be good to go.
You can, of course, install via terminal as well, but this may be a touch easier for those with terminal-phobia.