Goals:
- Compile and enable virtualbox.
- Headless windows client mainly for remote desktop access
- Try out a web interface called phpvirtualbox
- FreeBSD Release 8 is running on a P4 3Ghz HT with approx 3Gig ram. (Nothing impressive, really)
- Server has several network cards and is VLAN enabled. Server is not running any firewall.
- Apache 2.2 and php5.
- The version of virtualbox in ports collection today (March, 2011) is the virtualbox-ose 3.2.12_1. This version do NOT have the VRDP protocol implemented. This version is equiped with the former vnc head solution, which has to be enabled before compiling.
- Virtualbox puts your hosts in the respective users home directories. I want them somewhere else.
- My hosts are not started automatically. Let's make cron do the job.
- Update your ports collection
- Go to /usr/ports/emulators/virtualbox-ose and do a make config. Enable DBUS, VNC and WEBSERVICE before doing the make install clean.
- You dont need to be root to run a guest. Just add your user to the vboxusers group.
- To force virtualbox to store it's files in an alternative location, add VBOX_USER_HOME=/usr/local/virtualbox/ or your directory of choice to one of your startup script. make sure this directoy belongs to the user or the vboxusers group and has adequate permissions set.
- Return to ports collection, /usr/ports/www/phpvirtualbox/, and do the make install clean. I assume you have Apache2.2 and php5.
- Implement the following in your alias directive of httpd.conf and reload apache:
- Alias /phpvirtualbox /usr/local/www/phpvirtualbox/
AcceptPathInfo On
<Directory /usr/local/www/phpvirtualbox>
AllowOverride None
Order Allow,Deny
Allow from all
</Directory> - Modify /usr/local/www/phpvirtualbox/config.php and add your username and no password.
- Execute, as your user, the following command; this will inhibit password protection. My system is on my local network so the security threat is minimal.
- VBoxManage setproperty websrvauthlibrary null
- You should now be able to run vboxwebsrv in your cli and point your browser towards http://server/phpvirtualbox. Break the vboxwebsrv when you're done.
- Use the web gui to manage the details of your guests.
- To start your guest through cron, add the folowing to crontab with crontab -e;
- VBOX_USER_HOME=/usr/local/virtualbox/hamster
- @reboot /usr/local/bin/VBoxManage startvm "guest01" --type headless
- To list your vm's, run VBoxManage list vms or VBoxManage list runningvms.
- To start a guest with vnc-head, run VBoxHeadless --vnc --vncpass secret guest01
- To kill your guest, run VBoxManage controlvm guest01 poweroff
Last edit: 2011-03-28
Thord Matre