Date: Wed, 30 Nov 2011 08:00:38 +0100 From: Beat Gätzi <beat@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/162961: [PATCH] Update VirtualBox section in handbook Message-ID: <201111300700.pAU70sRR093467@marvin.chruetertee.ch> Resent-Message-ID: <201111300730.pAU7UB9Y048327@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 162961 >Category: docs >Synopsis: [PATCH] Update VirtualBox section in handbook >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Nov 30 07:30:11 UTC 2011 >Closed-Date: >Last-Modified: >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 @@ </sect3> </sect2> + + <sect2 id="virtualization-guest-virtualbox-guest-additions"> + <title>&virtualbox; Guest Additions on &os; Guest</title> + + <para>The <application>&virtualbox;</application> guest additions provide support for:</para> + + <itemizedlist> + <listitem> + <para>Clipboard sharing</para> + </listitem> + <listitem> + <para>Mouse pointer integration</para> + </listitem> + <listitem> + <para>Host time synchronization</para> + </listitem> + <listitem> + <para>Window scaling</para> + </listitem> + <listitem> + <para>Seamless mode</para> + </listitem> + </itemizedlist> + + <note> + <para>The following commands are run in the &os; guest.</para> + </note> + + <para>First, install the virtualbox-ose-additions package in the &os; guest.</para> + + <screen>&prompt.root; <userinput>cd /usr/ports/emulators/virtualbox-ose-additions && make install clean</userinput></screen> + + <para>Then, add this to <filename>/etc/rc.conf</filename>:</para> + + <programlisting>vboxguest_enable="YES" +vboxservice_enable="YES"</programlisting> + + <para>If you want to use ntpd(8) or ntpdate(8) for some reason, then you should disable host time synchronization:</para> + + <programlisting>vboxservice_flags="--disable-timesync"</programlisting> + + <para>The <command>vboxvideo_drv</command> should be recognized by <command>Xorg -configure</command>. If not, use something like this in your <filename>xorg.conf</filename> file for the <application>&virtualbox;</application> video card:</para> + + <programlisting>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</programlisting> + + <para>To use <command>vboxmouse_drv</command> please adjust the mouse section in your <filename>xorg.conf</filename> like this:</para> + + <programlisting>Section "InputDevice" + Identifier "Mouse0" + Driver "vboxmouse" +EndSection</programlisting> + + <para>HAL users should create this file at <filename>/usr/local/etc/hal/fdi/policy/90-vboxguest.fdi</filename> or copy it from <filename>/usr/local/share/hal/fdi/policy/10osvendor/90-vboxguest.fdi</filename>:</para> + + <programlisting><?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></programlisting> + </sect2> </sect1> <sect1 id="virtualization-host"> @@ -1003,7 +1100,8 @@ in <filename role="package">emulators/virtualbox-ose</filename>, and may be installed using the following commands:</para> - <screen>&prompt.root; <userinput>cd /usr/ports/emulators/virtualbox-ose</userinput> + <screen>&prompt.root; <userinput>portsnap fetch update</userinput> +&prompt.root; <userinput>cd /usr/ports/emulators/virtualbox-ose</userinput> &prompt.root; <userinput>make install clean</userinput></screen> <para>One useful option in the configuration dialog is the @@ -1028,34 +1126,10 @@ <programlisting>vboxdrv_load="YES"</programlisting> - <para>Versions of <application>&virtualbox;</application> prior to 3.1.2 - require the <filename class="directory">proc</filename> file system - to be mounted. This is not needed in recent versions, which utilize - the functions provided by the &man.sysctl.3; library.</para> + <para>If you wish to use the kernel modules that allow bridged or host-only networking, + add the following to <filename>/etc/rc.conf</filename> and reboot your computer:</para> - <para>When using an older version of the port, follow the instructions - below to make sure <filename class="directory">proc</filename> is - mounted properly:</para> - - <screen>&prompt.root; <userinput>mount -t procfs proc /proc</userinput></screen> - - <para>To allow this setting to persist reboots, the following line - is needed in <filename>/etc/fstab</filename>:</para> - - <programlisting>proc /proc procfs rw 0 0</programlisting> - - <note> - <para>If an error message similar to the following is observed - when <application>&virtualbox;</application> is run from - the terminal:</para> - - <screen>VirtualBox: supR3HardenedExecDir: couldn't read "", errno=2 cchLink=-1</screen> - - <para>The most likely culprit will be the <filename - class="directory">proc</filename> file system. Please use the - <command>mount</command> command to check whether it is mounted - properly.</para> - </note> + <programlisting>vboxnet_enable="YES"</programlisting> <para>The <groupname>vboxusers</groupname> group is created during the installation of <application>&virtualbox;</application>. @@ -1066,6 +1140,18 @@ <screen>&prompt.root; <userinput>pw groupmod vboxusers -m <replaceable>yourusername</replaceable></userinput></screen> + <para>The default permissions for /dev/vboxnetctl are restrictive. You will need to change them for bridged networking.</para> + + <para>To test it temporarily:</para> + + <screen>&prompt.root; <userinput>chown root:vboxusers /dev/vboxnetctl</userinput> +&prompt.root; <userinput>chmod 0660 /dev/vboxnetctl</userinput></screen> + + <para>To To make the permissions change permanent, add the following lines to <filename>/etc/devfs.conf</filename>: + + <programlisting>own vboxnetctl root:vboxusers +perm vboxnetctl 0660</programlisting> + <para>To launch <application>&virtualbox;</application>, either select the <guimenuitem>Sun VirtualBox</guimenuitem> 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 <ulink url="http://wiki.FreeBSD.org/VirtualBox"></ulink>.</para> </sect2> + + <sect2 id="virtualization-virtualbox-usb-support"> + <title>&virtualbox; USB Support</title> + + <note> + <para>These steps require VirtualBox 4.0.0 or later.</para> + </note> + + <para>In order to be able to read and write to USB devices, users need to be a member of the operator group.</para> + + <screen>&prompt.root; <userinput>pw groupmod operator -m <replaceable>jerry</replaceable></userinput></screen> + + <para>Then, add the following to <filename>/etc/devfs.rules</filename> (create it if it doesn't exist yet):</para> + + <programlisting>[system=10] +add path 'usb/*' mode 0660 group operator</programlisting> + + <para>To load these new rules, add the following to <filename>/etc/rc.conf</filename>:</para> + + <programlisting>devfs_system_ruleset="system"</programlisting> + + <para>Then, restart devfs:</para> + + <screen>&prompt.root; <userinput>/etc/rc.d/devfs restart</userinput></screen> + + <para>Now, you can enable USB in the guest operating system. You should be able to see the USB devices in the &virtualbox; preferences.</para> + + </sect2> + + <sect2 id="virtualization-virtualbox-host-dvd-cd-access"> + <title>&virtualbox; Host DVD/CD Access</title> + + <para>The <command>atapicam</command> kernel module needs to be loaded by adding this to <filename>/boot/loader.conf</filename>:</para> + + <programlisting>atapicam_load="YES"</programlisting> + + <para>HAL needs to run for <application>&virtualbox;</application> DVD/CD functions to work, so enable it in <filename>/etc/rc.conf</filename> and start it (if it is not already running):</para> + + <programlisting>hald_enable="YES"</programlisting> + + <screen>&prompt.root; <userinput>/usr/local/etc/rc.d/hald start</userinput></screen> + + <para>In order for users to be able to use <application>&virtualbox;</application> DVD/CD functions, they need access to <filename>/dev/xpt0</filename>, <filename>/dev/cdN</filename>, and <filename>/dev/passN</filename>. Add this to <filename>/etc/devfs.conf</filename>: + + <programlisting>perm cd0 0600 +perm xpt0 0660 +perm pass0 0660</programlisting> + </sect2> + <!-- Note: There is no working/end-user ready Xen support for FreeBSD as of 07-2010. Hide all information regarding Xen under FreeBSD. --- virtualization-virtualbox-chapter.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111300700.pAU70sRR093467>
