POSTS
VirtualBox-OSE on FrreeBSD 免x11
參考 http://d.hatena.ne.jp/wittro/20100617/1276782079
cd /usr/src
make build32 install32;
ldconfig -v -m -R /usr/lib32
cd /usr/ports/emulators/virtualbox-ose
make install clean
=============================================================================
VirtualBox was installed.
You need to load the vboxdrv kernel module via /boot/loader.conf:
vboxdrv_load="YES"
For bridged networking please add the following line to your /etc/rc.conf:
vboxnet_enable="YES"
Reboot the machine to load the needed kernel modules.
You also have to add all users to your vboxusers group in order to use vbox.
% pw groupmod vboxusers -m jerry
Running VirtualBox as non-root user may fail with a fatal error
NS_ERROR_FACTORY_NOT_REGISTERED. In this case delete /tmp/.vbox-*-ipc file.
Check wiki page for known issues and troubleshooting:
http://wiki.freebsd.org/VirtualBox
Please report any problems to emulation@. Thanks!
=============================================================================
弄個shell-script 來產生 虛擬機器設定
#!/bin/csh -f
set vm=winxp
set mem=1024
set cpu=1
#HD
set size=10000
#set dvdiso=`pwd`/windows7.iso
set dvdiso=/raid5/virtualbox/windowsXPSP3r.iso
# /root/.VirtualBox/Machines/
VBoxManage createvm -name $vm -register
VBoxManage modifyvm $vm --memory $mem --cpus $cpu --vram 32
VBoxManage modifyvm $vm --acpi on --ioapic on
VBoxManage modifyvm $vm --nic1 bridged --bridgeadapter1 bge0
VBoxManage modifyvm $vm --nictype1 82540EM
VBoxManage modifyvm $vm --vrdp on --cableconnected1 on --boot1 dvd
VBoxManage createvdi --filename ${vm}.vdi --size $size --format VDI --variant Standard
VBoxManage storagectl $vm --name ide --add ide --controller PIIX4
VBoxManage storageattach $vm --storagectl ide --port 0 --device 0 --type hdd --medium ${vm}.vdi
VBoxManage storageattach $vm --storagectl ide --port 1 --device 0 --type dvddrive --medium $dvdiso
#VBoxVRDP --startvm $vm
#VBoxManage storageattach $vm --storagectl ide --port 1 --device 0 --type dvddrive --medium /usr/local/lib/virtualbox/additions/VBoxGuestAdditions.iso
#VBoxVRDP --startvm $vm
執行 5900 vnc的port vnc的密碼123456
VBoxHeadless -n -m 5900 -o 123456 -s winxp -w 1024 -h 768
很方便 還可搞個私人雲端XDDD (其實只是lab)
效能上比之前用QEMU好上太多太多~~
- * *2011-02-14補充:
在安裝virtualbox-ose的時候一定要選上WEBSERVICE選項,後面安裝的phpvirtualbox的時候需要用到。
啟動vboxwebsrv
$ vboxwebsrv
安裝phpvirtualbox
$ cd /usr/ports/www/phpvirtualbox && make install clean
$ VBoxManage setproperty websrvauthlibrary null
然後在Nginx或Apache中配置站點,目錄指向/usr/local/www/phpvirtualbox目錄
在瀏覽器中輸入http://localhost/phpvirtualbox就可以開始安裝配置Virtualbox了。
Clone VM export
$ VBoxManage export winxp -o winxp.ovf (08-02 08:10)
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully exported 1 machine(s).
$ VBoxManage import winxp.ovf --vsys 0 --vmname winxp2