From beat@FreeBSD.org Wed Nov 30 07:26:40 2011 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95B08106566B for ; Wed, 30 Nov 2011 07:26:40 +0000 (UTC) (envelope-from beat@FreeBSD.org) Received: from marvin.chruetertee.ch (marvin.chruetertee.ch [217.150.245.55]) by mx1.freebsd.org (Postfix) with ESMTP id 3718C8FC08 for ; Wed, 30 Nov 2011 07:26:39 +0000 (UTC) Received: from _HOSTNAME_ (107-3.3-85.cust.bluewin.ch [85.3.3.107]) (authenticated bits=0) by marvin.chruetertee.ch (8.14.4/8.14.3) with ESMTP id pAU70sRR093467 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO) for ; Wed, 30 Nov 2011 07:00:54 GMT (envelope-from beat@FreeBSD.org) Received: by _HOSTNAME_ (sSMTP sendmail emulation); Wed, 30 Nov 2011 08:00:38 +0100 Message-Id: <201111300700.pAU70sRR093467@marvin.chruetertee.ch> Date: Wed, 30 Nov 2011 08:00:38 +0100 From: Beat Gätzi Reply-To: Beat Gätzi To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: [PATCH] Update VirtualBox section in handbook X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 162961 >Category: docs >Synopsis: [handbook] [patch] Update VirtualBox section in handbook >Confidential: no >Severity: non-critical >Priority: low >Responsible: manolis >State: closed >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Nov 30 07:30:11 UTC 2011 >Closed-Date: Fri Dec 02 17:38:03 UTC 2011 >Last-Modified: Fri Dec 02 17:38:03 UTC 2011 >Originator: Beat Gätzi >Release: FreeBSD 9.0-CURRENT i386 >Organization: >Environment: System: FreeBSD daedalus.network.local 9.0-CURRENT FreeBSD 9.0-CURRENT #5 r217615M: Thu Jan 20 01:02:35 CET 2011 root@daedalus.network.local:/usr/obj/usr/src/sys/GENERIC i386 >Description: - Attached patch updates the VirtualBox section of the virtualisation chapter in the handbook. This work was done by Eric Newberry during the Google Code-In contest so please give him the credit for this update: https://google-melange.appspot.com/gci/task/view/google/gci2011/7137268 >How-To-Repeat: >Fix: --- virtualization-virtualbox-chapter.patch begins here --- --- chapter.old.sgml 2011-11-26 11:38:34.000000000 -0700 +++ chapter.sgml 2011-11-26 18:06:03.000000000 -0700 @@ -969,6 +969,103 @@ + + + &virtualbox; Guest Additions on &os; Guest + + The &virtualbox; guest additions provide support for: + + + + Clipboard sharing + + + Mouse pointer integration + + + Host time synchronization + + + Window scaling + + + Seamless mode + + + + + The following commands are run in the &os; guest. + + + First, install the virtualbox-ose-additions package in the &os; guest. + + &prompt.root; cd /usr/ports/emulators/virtualbox-ose-additions && make install clean + + Then, add this to /etc/rc.conf: + + 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 file for the &virtualbox; 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 file at /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> + @@ -1003,7 +1100,8 @@ in emulators/virtualbox-ose, and may be installed using the following commands: - &prompt.root; cd /usr/ports/emulators/virtualbox-ose + &prompt.root; portsnap fetch update +&prompt.root; cd /usr/ports/emulators/virtualbox-ose &prompt.root; make install clean One useful option in the configuration dialog is the @@ -1028,34 +1126,10 @@ vboxdrv_load="YES" - Versions of &virtualbox; prior to 3.1.2 - require the proc file system - to be mounted. This is not needed in recent versions, which utilize - the functions provided by the &man.sysctl.3; library. + If you wish to use the kernel modules that allow bridged or host-only networking, + add the following to /etc/rc.conf and reboot your computer: - When using an older version of the port, follow the instructions - below to make sure proc is - mounted properly: - - &prompt.root; mount -t procfs proc /proc - - To allow this setting to persist reboots, the following line - is needed in /etc/fstab: - - proc /proc procfs rw 0 0 - - - If an error message similar to the following is observed - when &virtualbox; is run from - the terminal: - - VirtualBox: supR3HardenedExecDir: couldn't read "", errno=2 cchLink=-1 - - The most likely culprit will be the proc file system. Please use the - mount command to check whether it is mounted - properly. - + vboxnet_enable="YES" The vboxusers group is created during the installation of &virtualbox;. @@ -1066,6 +1140,18 @@ &prompt.root; pw groupmod vboxusers -m yourusername + The default permissions for /dev/vboxnetctl are restrictive. You will need to change them for bridged networking. + + To test it temporarily: + + &prompt.root; chown root:vboxusers /dev/vboxnetctl +&prompt.root; chmod 0660 /dev/vboxnetctl + + To To make the permissions change permanent, add the following lines to /etc/devfs.conf: + + own vboxnetctl root:vboxusers +perm vboxnetctl 0660 + To launch &virtualbox;, either select the Sun VirtualBox item from your graphic environment's menu, or type the following in a @@ -1081,6 +1167,55 @@ visit the relevant page in the &os; wiki, at . + + + &virtualbox; USB Support + + + These steps require VirtualBox 4.0.0 or later. + + + In order to be able to read and write to USB devices, users need to be a member of the operator group. + + &prompt.root; pw groupmod operator -m jerry + + Then, add the following to /etc/devfs.rules (create it if it doesn't exist yet): + + [system=10] +add path 'usb/*' mode 0660 group operator + + To load these new rules, add the following to /etc/rc.conf: + + devfs_system_ruleset="system" + + Then, restart devfs: + + &prompt.root; /etc/rc.d/devfs restart + + Now, you can enable USB in the guest operating system. You should be able to see the USB devices in the &virtualbox; preferences. + + + + + &virtualbox; Host DVD/CD Access + + The atapicam kernel module needs to be loaded by adding this to /boot/loader.conf: + + atapicam_load="YES" + + HAL needs to run for &virtualbox; DVD/CD functions to work, so enable it in /etc/rc.conf and start it (if it is not already running): + + hald_enable="YES" + + &prompt.root; /usr/local/etc/rc.d/hald start + + In order for users to be able to use &virtualbox; DVD/CD functions, they need access to /dev/xpt0, /dev/cdN, and /dev/passN. Add this to /etc/devfs.conf: + + perm cd0 0600 +perm xpt0 0660 +perm pass0 0660 + +