這是本文件的舊版!
依照 OS 下載安裝檔。
以 debian 而言,會缺少兩個相依套件:libxalan110、libxerces27,要先安裝。
# apt-get install libxalan110 libxerces27
# dpkg -i VirtualBox_1.3.8_Debian_etch_i386.deb
因為我有自己編 kernel,過程中需要重新編譯 kernel 加入新的 module 等等的,可能會遇到問題。解決方法是之前編 kernel 的 kernel-source 要留著。
VirtualBox 會新增一個群組「vboxusers」,要去 /etc/group 將允許使用 VirtualBox 的使用者加入此群組中。
或者到「桌面」→「管理」→「使用者及群組」設定。
重新登入系統讓設定值生效。
用右邊的 Ctrl 可以解除鎖定鍵盤滑鼠。
其他跟 VMware 差不多…
開啟 Port 讓外面可連進去 Guest OS。
首先將所有 Guest OS 及 VirtualBox 關掉,不然無法設定。
下面的範例為將 Guest OS 的 TCP Port 22 導到 Host OS 的 2222,其中 Protocol 前的「guestssh」為自訂的識別名稱:
VBoxManage setextradata "Guest OS Name" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP VBoxManage setextradata "Guest OS Name" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22 VBoxManage setextradata "Guest OS Name" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
讓 Guest OS 的網路直接和 Host 的網卡接在一起。
apt-get install uml-utilities bridge-utils
其中 <username> 為登入的使用者名稱。
tunctl -t tap0 -u <username>
成功後會出現:
Set 'tap0' persistent and owned by uid xxxx
此 bridge 名稱為 br0。
brctl addbr br0
ifconfig eth0 0.0.0.0 promisc
brctl addif br0 eth0
ifconfig br0 192.168.x.x
brctl addif br0 tap0
ifconfig tap0 up
chmod 0666 /dev/net/tun
Setting → Network → Adapter0 選 HostInterface,Interface Name 填入 tap1。
Guest OS 的 IP 需和真實網卡同一個網域即可。
brctl delif br0 eth0 brctl delif br0 tap0 brctl delbr br0 ifconfig tap0 down ifconfig br0 down ifconfig eth0 down ifconfig eth0 up
comming soon……?
Port forwarding:http://www.virtualbox.org/download/1.6.2/UserManual.pdf chapter:6.4.1