21.5. 在VirtualBox™使用FreeBSD作为客端

VirtualBox中使用FreeBSD做为客端系统也可运作的很好,虚拟化软件可支持最常见的几个操作系统,这当然也包含FreeBSD。

VirtualBox guest additions支持以下功能:

注意:

以下指令均是在FreeBSD客端中执行。

首先,在FreeBSD客端安装emulators/virtualbox-ose-additions套件或Port,以下指令会安装Port:

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

加入下行到/etc/rc.conf

vboxguest_enable="YES"
vboxservice_enable="YES"

若有使用ntpd(8)ntpdate(8),便可关闭主机时间同步功能:

vboxservice_flags="--disable-timesync"

Xorg会自动辨识vboxvideo驱动程序,也可手动在/etc/X11/xorg.conf中输入:

Section "Device"
	Identifier "Card0"
	Driver "vboxvideo"
	VendorName "InnoTek Systemberatung GmbH"
	BoardName "VirtualBox Graphics Adapter"
EndSection

要使用vboxmouse驱动程序,可调整在/etc/X11/xorg.conf中与鼠标相关的一节:

Section "InputDevice"
	Identifier "Mouse0"
	Driver "vboxmouse"
EndSection

HAL的使用者应建立以下/usr/local/etc/hal/fdi/policy/90-vboxguest.fdi或复制自/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: chapter.xml,v 1.33 2012-03-17 04:53:52 eadler Exp $

	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>

主机和 VM 之间文件传输的共享文件夹可通过使用mount_vboxvfs进行装载来访问。可以使用 VirtualBox GUI 或通过vboxmanage在主机上创建共享文件夹。例如,在/mnt/bsdboxshare中为BSDBox虚拟机创建名为 myshare的共享文件夹,请运行:

# vboxmanage sharedfolder add 'BSDBox' --name myshare --hostpath /mnt/bsdboxshare

请注意,共享文件夹名称不得包含空格。从来宾系统内装载共享文件夹,如下所示:

# mount_vboxvfs -w myshare /mnt

本文档和其它文档可从这里下载: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

如果对于FreeBSD有问题,请先阅读 文档,如不能解决再联系 <questions@FreeBSD.org>.

关于本文档的问题请发信联系 <doc@FreeBSD.org>.