This page details the ongoing effort of porting VirtualBox to FreeBSD.
VirtualBox has been committed to the FreeBSD portstree. There is also a chapter about VirtualBox on FreeBSD in the Handbook.
Contact
The following individuals are reachable on #fbsd-mentors, irc.unixfreunde.de, or Mailinglist freebsd-emulation(at)FreeBSD.org
- decke
- dhn
- beat
- miwi
- nox
Update VirtualBox to 3.1.2
Port renaming:
- Port has been renamed to virtualbox-ose to reflect that we are using the OSE version.
- A seperate port for the kernel modules has been created: virtualbox-ose-kmod
- A seperate port for guest additions for FreeBSD guests has been created: virtualbox-ose-additions
How to upgrade:
- Update your ports tree:
# portsnap fetch update
- Build the new ports:
# cd /usr/ports/emulators/virtualbox-ose-kmod && make # cd ../virtualbox-ose && make
- If build was ok, deinstall old port
# pkg_delete virtualbox-\*
- Install new port:
# cd ../virtualbox-ose-kmod && make install clean # cd ../virtualbox-ose && make install clean
Virtualbox 3.1.2 no longer requires procfs. If no other program requires /proc mounted you could remove /proc from /etc/fstab.
Please load the virtualbox kernel module via /boot/loader.conf:
vboxdrv_load="YES"
If you are using the kernel modules for bridged or host-only networking remove vboxnetflt or vboxnetadp entries from /boot/loader.conf and add this to /etc/rc.conf and reboot the machine afterwards:
vboxnet_enable="YES"
Guest Additions for FreeBSD guests:
For FreeBSD guests within VirtualBox please try the new guest additions port. Install virtualbox-ose-additions in the FreeBSD guest:
# portsnap fetch update # cd /usr/ports/emulators/virtualbox-ose-additions && make install clean
Add this to /etc/rc.conf in the FreeBSD guest:
vboxguest_enable="YES"
The vboxvideo_drv should be recognized by Xorg -configure. If not, use something like this in your xorg.conf for the video card:
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
### [arg]: arg optional
Identifier "Card0"
Driver "vboxvideo"
VendorName "InnoTek Systemberatung GmbH"
BoardName "VirtualBox Graphics Adapter"
BusID "PCI:0:2:0"
EndSectionTo use vboxmouse_drv please adjust the mouse section in your xorg.conf like this:
Section "InputDevice"
Identifier "Mouse0"
Driver "vboxmouse"
EndSection- HAL users should create this in /usr/local/etc/hal/fdi/policy/90-vboxguest.fdi:
<?xml version="1.0" encoding="UTF-8"?>
<!--
# Sun VirtualBox
# Hal driver description for the vboxmouse driver
# $Id: 90-vboxguest.fdi 21412 2009-07-08 21:18:57Z vboxsync $
Copyright (C) 2008-2009 Sun Microsystems, Inc.
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify it under the terms of the GNU
General Public License (GPL) as published by the Free Software
Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
Clara, CA 95054 USA or visit http://www.sun.com if you need
additional information or have any questions.
-->
<deviceinfo version="0.2">
<device>
<match key="info.subsystem" string="pci">
<match key="info.product" string="VirtualBox Guest Service">
<append key="info.capabilities" type="strlist">input</append>
<append key="info.capabilities" type="strlist">input.mouse</append>
<merge key="input.x11_driver" type="string">vboxmouse</merge>
<merge key="input.device" type="string">/dev/vboxguest</merge>
</match>
</match>
</device>
</deviceinfo>To use clipboard sharing works start VBoxClient in the guest and use Ctrl + C to copy something in the guest or the host:
# VBoxClient --clipboard
Known Issues
Kernel panic when loading/unloading the module (see ports/139188 and ports/143676 or search the mailing lists for a lot of similar reports).
Build fails if kernel, userland and/or src are not in sync: (see here or here)
VIMAGE kernel option freeze system with bridged networking (see here)
Some features are available in the OSE edition of VirtualBox:
- USB
- RDP
Known Issues in previous versions of the port
If one of this problem occure, please consider updating to the latest version of the VirtualBox port:
Build fails if openssl is installed from ports (see here).
This should no longer be a problem with VirtualBox 3.0.51.r22902_2 Makefile Revision 1.11 and up
Launching virtual machine on 8.0-BETA2/amd64 instantly panic the system (see here)
Panic when starting Windows XP guest on CURRENT (see here -> workaround)
Some ATI users report problems with GLX support (see here).
After updating host OS and rebuilding virtualbox the host freeze after starting guest OS with graphical user interface. -> Update libGL and its dependents: portmaster -r libGL-\* (see here).
Updating virtualbox with portmaster may fail. In this case update virtualbox manually: cd /usr/ports/emulators/virtualbox/ && make && make deinstall && make install
- This should no longer be a problem with portmaster versions 2.12 and up
Bridged networking doesn't work with a wireless interface (see here and here)
If you cannot launch VirtualBox, even using root:
Launch VirtualBox
- If it fails open top(1)
In top(1) you should see 2(!) processes "VirtualBox"
- Kill one of them.
- The other one should start
Hints
Host DVD/CD access
atapicam kernel module needs to be loaded
- HAL has to run at the moment
Permissions to access /dev/xpt0, /dev/cdN and /dev/passN
the example config of /etc/devfs.conf:
perm cd0 0660 perm xpt0 0660 perm pass0 0660
the example config of /boot/loader.conf:
vboxdrv_load="YES" atapicam_load="YES"
Bridged Networking
With VirtualBox 3.0.51 load the modules vboxnetflt and vboxnetadp (in that order, after the kernel has booted, eg, via /etc/rc.local)
# not done via loader, kernel init required first kldload vboxnetflt vboxnetadp
Starting with VirtualBox 3.1.2 you could use a rc.d start script to load the network related kernel modules. Add this to /etc/rc.conf:
vboxnet_enable="YES"
- select Bridged Adapter in the Network tab
- select your physical adapter to bridge to
If the VM will not start up with an "Unable to create" error, unload both vboxnet modules again and reload them. There is a kernel initialization race that breaks pre-loading these modules. Loading the modules from /boot/loader.conf will usually not work.
Troubleshooting
- Make sure your running kernel, world and src are in sync
- AMD64 users explicitly need COMPAT_IA32 in their kernel config
- On versions prior to 3.1.2 /proc should be mounted via /etc/fstab
- Make sure the guest virtualbox-ose-additions port is not installed and loaded on the host machine (virtualbox-ose-additions port is only for FreeBSD guests)
- The vboxdrv kernel module should be loaded via /boot/loader.conf
- Make sure your user is in the vboxusers group
Disable VT-x (should no longer be a problem with VirtualBox 3.1.2)
- Disable BIOS setting "Virtual Machine Manager functions"
Visualisation problems? Set environment variable XLIB_SKIP_ARGB_VISUALS=1 prior to start VirtualBox.