This page details the ongoing effort of porting VirtualBox to FreeBSD. If you would like to help please have a look at the VirtualBox ToDo.

Want to help testing latest VirtualBox versions? You can find a description of how to use the development repository at https://redports.org/~virtualbox/.

There is also a chapter about VirtualBox on FreeBSD in the Handbook.


Contact

The following individuals are reachable on IRC #freebsd-vbox or Mailinglist freebsd-emulation (at) FreeBSD.org


Installing VirtualBox

VirtualBox is already quite stable on FreeBSD but it is a complex piece of software so you should regularly update to the latest patch release. If you have problems with the emulators/virtualbox-ose port or want to use a well tested VirtualBox version you can try the emulators/virtualbox-ose-legacy port.

Update your ports tree:

# portsnap fetch update

Build and install virtualbox:

# cd /usr/ports/emulators/virtualbox-ose && make install clean

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 add this to /etc/rc.conf and reboot the machine afterwards:

vboxnet_enable="YES"

Add all users that need virtualbox to the vboxusers group:

# pw groupmod vboxusers -m yourusername

USB support

Your users need to be in the operator group and need read and write permissions to the USB device.

# pw groupmod operator -m jerry

Add the following to /etc/devfs.rules (create if it doesn't exist):

[system=10]
add path 'usb/*' mode 0660 group operator

To load these new rule add the following to /etc/rc.conf:

devfs_system_ruleset="system"

Then restart devfs to load the new rules:

# /etc/rc.d/devfs restart

Now you can enable USB for the guest and should be able to see the USB devices in the VirtualBox preferences.

Host DVD/CD access

atapicam kernel module needs to be loaded via /boot/loader.conf:

atapicam_load="YES" 

HAL has to run at the moment so enable it in /etc/rc.conf and start it if not yet done:

hald_enable="YES"

# /usr/local/etc/rc.d/hald start

Your account needs permissions to access /dev/xpt0, /dev/cdN and /dev/passN so add this to /etc/devfs.conf:

perm cd0 0660
perm xpt0 0660
perm pass0 0660 


Installing Guest Additions for FreeBSD guests

For FreeBSD guests within VirtualBox please install emulators/virtualbox-ose-additions in the FreeBSD guest.

They provide support for:

Install virtualbox-ose-additions in the FreeBSD guest:

 # cd /usr/ports/emulators/virtualbox-ose-additions && make install clean

Add this to /etc/rc.conf in the FreeBSD guest:

vboxguest_enable="YES"
vboxservice_enable="YES"

If you want to use ntpd(8) or ntpdate(8) for some reason then you should disable host time synchronization:

vboxservice_flags="--disable-timesync"

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"
EndSection

To 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 or copy it from /usr/local/share/hal/fdi/policy/10osvendor/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>

VirtualBox (last edited 2012-06-06 09:07:42 by BernhardFroehlich)