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>

本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/

若有 FreeBSD 方面疑問,請先閱讀 FreeBSD 相關文件,如不能解決的話,再洽詢 <questions@FreeBSD.org>。

關於本文件的問題,請洽詢 <doc@FreeBSD.org>。