Changes

Jump to: navigation, search

Installing VirtualBox 2 on a Linux Host

6,727 bytes added, 18:45, 16 March 2009
VirtualBox Linux Host Requirements
This chapter of [[VirtualBox 2 Essentials]] covers the requirements for and steps to install the full, pre-built binrary binary edition of VirtualBox on a Linux host.
VirtualBox may be installed on Linux using either Linux distribution specific package archives, or manually using a distribution neutral shell script based installer. Each of these methods will be covered in this chapter.
* '''SDL''' - Version 1.2.7 or newer of the ''libsdl'' graphics library must be installed.
AnotherIn addition, VirtualBox for Linux requires that the packages necessary to facilitate the building of Kernel modules be installed prior to installing the guest additions. This include the GNU C Compiler and kernel development sources. On Red Hat, CentOS and Fedora systems, this can be achieved by executing the following command as super user: <pre>suyum install gcc kernel-devel</pre> Another optional package is Dynamic Kernel Module Support (DKMS). As part of the installation process, VirtualBox installed installs two kernel modules (vboxdrv and vboxnetflt) onto the host system. These modules must match the running Linux kernel at all times for VirtualBox to function. This can be an issue when the host kernel is updated at any point in the future. Whilst not required to install and run VirtualBox , the presence of the DKMS package will ease the transition to future kernel updates. When installed, DKMS ensures that the VirtualBox kernel modules are rebuilt automatically when the Linux kernel is updated. Without this package, the VirtualBox kernel module will need to be rebuilt manually each time a kernel update is applied to the host system.
The DKMS package is not supported on all Linux distributions, but may be installed on those that do as follows:
== Downloading VirtualBox for Linux ==
The binary version of VirtualBox, pre-packaged for a wide variety of Linux Windows distributions , may be downloaded from the [http://www.virtualbox.org/wiki/Linux_Downloads VirtualBox web site]. Select the ''VirtualBox for Windows hosts'' package which that matches your Linux distribution (Fedora, Ubuntu, Red Hat, CentOS etc) and the target host 's hardware architecture (i386 x86 or AMD64) and download the archive to a suitable temporary location. If your Linux distribution is not listed download the appropriate archive for the ''All distributions'' option.
== Installing VirtualBox on Fedora, CentOS and Red Hat Enterprise Linux ==
su -
/etc/init.d/vboxdrv setup
</pre> An alternaive to installing VirtualBox using the graphical Software Installer tool is to install perform the installation from the command line. This can be achieved as follows: <pre># su - # rpm -ihv VirtualBox-2.1.4_42893_rhel5-1.i386.rpm Preparing... ########################################### [100%] 1:VirtualBox ########################################### [100%] Creating group 'vboxusers'. VM users must be member of that group! No precompiled module for this kernel found -- trying to build one. Messagesemitted during module compilation will be logged to /var/log/vbox-install.log. Success!</pre> As part of the installation process, a new group named ''vboxusers'' will be created on the host system. Any users which are intended to use VirtualBox must first be added to this group. This can be achieved by executing the following command: <pre># /usr/sbin/usermod -G vboxusers -a <username></pre> where ''<username>'' represents the name of the user to be added to the ''vboxusers'' group. Alternatively, users may be added to the group using the ''User Manager'' tool (accessed via the ''System->Administration->Users and Groups'' menu option. == Removing VirtualBox from a Fedora, CentOS and Red Hat Enterprise Linux Host == A VirtualBox instance installed from an RPM package may be uninstalled from the host by issuing the following command in a terminal window: <pre># rpm -e VirtualBox</pre>
== Installing VirtualBox on Ubuntu ==
 
When the download link for the Ubuntu VirtualBox installation archive is clicked, the browser will provide the option to open the archive in the ''Package Installer''. If this option is selected, the installer will appear as illustrated in the following figure:
 
 
[[Image:virtualbox_ubuntu_package_installer.jpg|Installing VirtualBox with the Ubuntu Package Installer]]
 
 
To begin the installation process, click on the ''Install Package'' button and enter your password when prompted to do so. After a short period of time, the DebConf Configuration process for VirtualBox will begin. The first screen warns that any users of VirtualBox will need to be added to the ''vboxusers'' group. The next screen asks whether the kernel modules should be built and installed on the host system. Accept the default option (compile kernel module) and click the ''Forward'' button to continue the installation. Once the installation has completed successfully, the installer will display an ''Installation Finished''. If any errors occurred during the installation, details can be found in the ''/var/log/vbox-install.log'' file.
 
An alternative to installing VirtualBox using the Package Installer is to perform the installation from the command line. Once the installation archive has been save to disk, the installation may be invoked as follows:
 
<pre>
sudo dpkg -i virtualbox-2.1_2.1.4-42893_Ubuntu_intrepid_i386.deb
</pre>
 
Before launching VirtualBox, any user which require access must be added to the ''vboxusers'' group. This can be performed by using the graphical ''Users and Groups'' tool (accessed via the ''System->Administration->Users and Groups menu option). Once invoked, click ''Unlock'', enter your password and then click on the ''Manage Groups'' button. In the ''Manage Groups'' screen, select ''vboxusers'' from the list of groups, click on ''Properties'' and in the resulting dialog select the users which are to be added to the group.
 
Alternatively, users may be added to a group from the command line by issuing the following command in a terminal window (Applications->Accessories->Terminal):
 
<pre>
sudo usermod -a -G vboxusers <username>
</pre>
 
where ''<username>'' represents the name of the user to be added to the ''vboxusers'' group.
 
== Uninstalling VirtualBox from an Ubuntu Host ==
 
An instance of VirtualBox installed from a .deb package file may be uninstalled at any time by issuing the following command in a terminal window (Applications->Accessories->Terminal):
 
<pre>
$ sudo dpkg -r virtualbox-2.1
 
(Reading database ... 210619 files and directories currently installed.)
Removing virtualbox-2.1 ...
* Stopping VirtualBox kernel module * done.
</pre>
 
== Installing VirtualBox using VirtualBox.run ==
 
To install VirtualBox on systems for which a package manager arachive is not available, a generic installer is provided in the form of the ''VirtualBox.run'' script. Note that although the script will be referred to as ''VirtualBox.run'' in this chapter, the actual name will include the architecture, version and build number of the downloaded release, for example, ''VirtualBox-2.1.4-43001-Linux_x86.run''.
 
This installation script is downloaded by selecting the appropriate download for ''All distributions'' on the VirtualBox download page. Once downloaded to a temporary directory, the installation is invoked by issuing the following command in a terminal window:
 
<pre>
sh ./VirtualBox-2.1.4-43001-Linux_x86.run install <installation path>
</pre>
 
where ''<installation path>'' represents the path to the directory where VirtualBox is to be installed. If no path is specified, the default path ''/opt/VirtualBox-<version>'' is used. The transcript from a successful installation is as follows:
 
<pre>
sh ./VirtualBox-2.1.4-43001-Linux_x86.run install
 
Verifying archive integrity... All good.
Uncompressing VirtualBox for Linux installation.......
VirtualBox Version 2.1.4 (2009-02-26T15:24:35Z) installer
Installing VirtualBox to /opt/VirtualBox-2.1.4
Building the VirtualBox kernel module
Building the VirtualBox netflt kernel module
 
VirtualBox has been installed successfully.
 
You will find useful information about using VirtualBox in the user manual
/opt/VirtualBox-2.1.4/UserManual.pdf
and in the user FAQ
http://www.virtualbox.org/wiki/User_FAQ
 
We hope that you enjoy using VirtualBox.
</pre>
 
The installation script will create the ''vboxusers'' group to which all VirtualBox users must be added. Users may be added the group using the following command either as root or using sudo:
 
<pre>
usermod -a -G vboxusers <username>
</pre>
 
where ''<username>'' represents the name of the user to be added to the ''vboxusers'' group.
 
== Removing VirtualBox using VirtualBox.run ==
 
A VirtualBox instance installed using the VirtualBox.run script may be removed at any time by issuing the following command as root user or using sudo:
 
<pre>
sh ./VirtualBox-2.1.4-43001-Linux_x86.run uninstall
</pre
1,798
edits

Navigation menu