# VirtualBox headless inside a Jail?



## minimike (Feb 18, 2011)

Hi

I don't know if it's possible, so why I'm asking. It is possible to run VirtualBox inside a jail? For networking I could give VIMAGE a try. But I am not sure if I need more.

Kind regards,
Darko.


----------



## da1 (Feb 20, 2011)

Haven't tried it myself but don't see any reason why not.


----------



## tty23 (Aug 2, 2011)

Hi minimike,

I want to try the same. Did you succeed?

Are there any pitfalls to avoid?

Thanks

Johannes


----------



## kalw (Jul 24, 2012)

Hi there,

Not quite clean but post mortem here are the steps used to make it work 


On the jail host :

	* make vbox kernel module :  %make -C /usr/ports/emulators/virtualbox-ose-kmod install clean

	* load it : %/usr/local/etc/rc.d/vboxnet start

	* mount src dir used to build module on jail used : %mount -t nullfs /usr/src /path/to/my/jail/basejail/usr/src

	* allow sysv  : %echo "jail_sysvipc_allow=\"YES\"" | tee -a /etc/rc.conf

	* unhide devices needed by vbox on jail : 
	%diff /usr/src/etc/defaults/devfs.rules /etc/defaults/devfs.rules
	34a35,36
	> add path vboxdrv0 unhide
	> add path vboxnetctl unhide

	* start or restart jail . 

In the jail :

	* edit virtualbox-ose Makefile to avoid the build of module by commenting the RUN_DEPENDS line

	* build vbox : make -C /usr/ports/emulators/virtualbox-ose install clean


----------

