VirtualBox
VirtualBox is a software that allows the user to run a Guest Operating System inside of the Host Operating System, without having to reboot.
Contents |
Terminology
Host Operating System - the computer you are actually working on. (ie. Gentoo Linux)
Guest Operating System - the operating system you want to install or have installed within the VirtualBox emulation environment. (ie. You want to use MS Windows from within your Gentoo Linux box.)
VirtualBox Guest Additions - drivers for the Guest Operating system. These drivers provide smoother operation with the Host operating system compared to the standard drivers installed by the Guest operating system.
Installation
You can choose between a source based package (app-emulation/virtualbox) and a binary package (app-emulation/virtualbox-bin). The binary version is available so 64bit no-multilib users can use VirtualBox, too. The binary package contains some extensions which are not available in the source package. To get identical functionality with the source package, emerge it with the extensions USE flag being enabled.
The qt4 USE flag controls installation of the graphical user interface (GUI) which is enabled by default.
| USE flag | Default | Recommended | Description |
|---|---|---|---|
| additions | Yes | Yes | Install Guest System Tools ISO |
| alsa | No | Yes | Adds support for media-libs/alsa-lib (Advanced Linux Sound Architecture) |
| doc | No | Adds extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally | |
| extensions | No | Yes | Install extension module packages |
| headless | No | Build without any graphic frontend | |
| java | No | No | Adds support for Java |
| opengl | Yes | Adds support for OpenGL (3D graphics) | |
| pam | No | Yes | Adds support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip |
| pulseaudio | No | Adds support for PulseAudio sound server | |
| python | No | Adds optional support/bindings for the Python language | |
| qt4 | Yes | Yes | Adds support for the Qt GUI/Application Toolkit version 4.x |
| sdk | Yes | Enable building of SDK | |
| vboxwebsrv | No | No | Build and install the VirtualBox webservice |
| vnc | No | Enable VNC (remote desktop viewer) support |
root # emerge --ask app-emulation/virtualbox
Or
| USE flag | Default | Recommended | Description |
|---|---|---|---|
| additions | Yes | Yes | Install Guest System Tools ISO |
| chm | Yes | Install kchmviewer binary to enable online help (in MS CHM format) | |
| headless | No | Install without any graphic frontend | |
| python | No | Adds optional support/bindings for the Python language | |
| rdesktop-vrdp | No | Install the rdesktop client integration | |
| sdk | No | Enable building of SDK | |
| vboxwebsrv | No | No | Install the VirtualBox webservice |
root # emerge --ask app-emulation/virtualbox-binWindows Guests
Enable the additions USE flag when installing VirtualBox on the host system to get the ISO image which contains all necessary Windows guest drivers.
Linux Guests
If you want to run Gentoo as a guest system simply run
root # emerge --ask app-emulation/virtualbox-guest-additionsin the Gentoo guest system.
If you want to install other Linux distributions as guest system please refer either to the distribution's documentation on how to install the drivers needed by VirtualBox or consult the official VirtualBox documentation at [1].
Running
Users will not be able to run and use VirtualBox if they are not a member of the "vboxusers" group.
root # gpasswd -a <user> vboxusersChanges will not take effect until the user re-logins.
Load the required driver module from app-emulation/virtualbox-modules:
root # modprobe vboxdrvOptional modules:
root # modprobe vboxnetadp
root # modprobe vboxnetfltUsage
There are many options which can influence behavior and performance of your virtual machines. If you don't know what these options are doing, leave them to their defaults. You can even make your virtual machines unbootable when setting wrong options.
Here's a list of save to use options:
- Host I/O cache can savely be enabled for all virtual storage controllers.
- In case your host system's CPU supports hardware virtualization, enable the 'VT-x/AMD-V' option. It can drastically increase performance of your virtual machines.
Performance Problems
Microsoft Windows Guest
- Do not enable APIC for Microsoft Windows guests! VirtualBox also has a bad habit of enabling this option at it's own will. The fix is to select the System Processor Driver (ie. ACPI Uniprocessor PC) and manually upgrade (change) to the Advanced Configuration and Power Interface (ACPI) PC. Shutdown (not reboot), restart VirtualBox and ensure APIC is off, then boot the guest. As usual, always make a backup before playing with Windows. NoteNot true for all Windows operating systems. Windows XP and Windows7 play nice with APIC as long as they got installed with APIC being enabled.
- Using a SATA controller, it is necessary to choose the right driver version from Intel's SATA drivers. Using a wrong version will cause performance problems along with blue screen errors! Refer to [2] for a list of working SATA drivers.
- Slow performance using SATA driver? Only use the SATA controller interface for the hard disk. Remove any CDROMs from the SATA controller and place them onto a IDE Controller.NoteThis can be a problem of wrong SATA-driver version, too.
- When installing the VirtualBox Guest Additions into your Windows operating system, do not select to enable Direct3D (experimental) option as this will cause resizing problems and other anomalies. Also, you need to install the Guest Additions from Safe Mode.
- Don't use the ICH9 chipset with Windows. It's still considered experimental. It can cause temporary freezes of the whole VM when used with Windows7. [3]
Linux Guest
- When running Gentoo as a guest system make sure you start the virtualbox-guest-additions init script during bootup.
See also
- phpVirtualBox - Web-based administration utility (PHP)
External resources
- vboxweb_rb - Web-based administration utility (Ruby)