This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
Virtualbox in Jail
-
squiggie
- NewUser

- Posts: 3
- Joined: 16 Oct 2014 05:35
- Status: Offline
Virtualbox in Jail
I'm trying to install virtualbox inside a Jail. I'm hitting a lot of roadblocks preventing the virtualbox-ose port from compiling. Is this even possible anymore and if so, can someone point me toward a tutorial?
-
fumantsu
- Starter

- Posts: 69
- Joined: 04 Mar 2014 12:15
- Location: Athens->Brno
- Status: Offline
Re: Virtualbox in Jail
I tried also and wasn't successful with main issue the kernel modules. I don't think that you will able to install it inside a jail.
Fractal Node 304, Avoton C2550 Quad-Core Processor, 8GB RAM ECC, 4 x 4TB WD RED in mirrors , NAS4Free 9.2.0.1 build 972
-
squiggie
- NewUser

- Posts: 3
- Joined: 16 Oct 2014 05:35
- Status: Offline
Re: Virtualbox in Jail
Well I was running into an issue compiling it where it was failing on the soap builds. I did make config and disabled the webserivce part and it built successfully, but then when I created a VM and tried to start it, I kept getting errors about the kernel modules not being loaded as well.
Anyone with experience making this work that has some advice would be much appreciated.
Anyone with experience making this work that has some advice would be much appreciated.
-
dreamcat4
- experienced User

- Posts: 111
- Joined: 21 Mar 2014 21:59
- Status: Offline
Re: Virtualbox in Jail
It's not very easy to run virtualbox on nas4free and you are recommended to probably use the extension in the Extensions Sub-Forum instead.
If your builds are failing whilst compiling SOAP then there are 2 possible reasons:
1) Blocked CPU fan - your processor is overheating (past it's limit) and your computer is thermally shutting down. If it's that reason, the computer will physically shut down / power off.
2) You have run out of memory. Probably because you do not have any swap file. Then you need to create a swap file. Or upgrade (try to max out) your system RAM because RAM should be cheap enough these days. It is recommended to do both of those things.
If you run 'uname -a' you will see a SVN build revision number of the Kernel. To build a compatible kernel module(s) you should svn checkout -r that same SVN revision number of the kernel sources.
If you create a jail, you can 'kldload' the virtualbox kernel modules outside the jail and then "chroot" into the jail to have proper access to the networking devices... but if your vbox kernel modules aren't full compatible with the kernel then there is a large chance that the networking aspect will crash either virtualbox else panic (crash) the the whole system.
BTW: options VIMAGE is desirable / necessary for running virtualbox actually in a jail (as opposed to a chroot). To access network interfaces properly. However in 9.X (at least until 10) then options VIMAGE (for VNET jails) is now known not to work in combination with iSCSI (which is of course enabled in NAS4Free). So that is why I did not see the point in trying to add VBOX support in the multi-platform finch tool. That and because pfsense platform does not support options VIMAGE either.
Your best bet on nas4free platform is either use the virtualbox extension, which is still *recommended*. Else you can try to install in a jail but inevitably will be kldload'ing kernel modules, and running virtualbox from inside a chroot session instead (of the same jail folder).
If your builds are failing whilst compiling SOAP then there are 2 possible reasons:
1) Blocked CPU fan - your processor is overheating (past it's limit) and your computer is thermally shutting down. If it's that reason, the computer will physically shut down / power off.
2) You have run out of memory. Probably because you do not have any swap file. Then you need to create a swap file. Or upgrade (try to max out) your system RAM because RAM should be cheap enough these days. It is recommended to do both of those things.
If you run 'uname -a' you will see a SVN build revision number of the Kernel. To build a compatible kernel module(s) you should svn checkout -r that same SVN revision number of the kernel sources.
If you create a jail, you can 'kldload' the virtualbox kernel modules outside the jail and then "chroot" into the jail to have proper access to the networking devices... but if your vbox kernel modules aren't full compatible with the kernel then there is a large chance that the networking aspect will crash either virtualbox else panic (crash) the the whole system.
BTW: options VIMAGE is desirable / necessary for running virtualbox actually in a jail (as opposed to a chroot). To access network interfaces properly. However in 9.X (at least until 10) then options VIMAGE (for VNET jails) is now known not to work in combination with iSCSI (which is of course enabled in NAS4Free). So that is why I did not see the point in trying to add VBOX support in the multi-platform finch tool. That and because pfsense platform does not support options VIMAGE either.
Your best bet on nas4free platform is either use the virtualbox extension, which is still *recommended*. Else you can try to install in a jail but inevitably will be kldload'ing kernel modules, and running virtualbox from inside a chroot session instead (of the same jail folder).
-
squiggie
- NewUser

- Posts: 3
- Joined: 16 Oct 2014 05:35
- Status: Offline
Re: Virtualbox in Jail
I was thinking this might be the case so I'm going to explore this option. I'm having some issues creating a swapfile though. Not to diverge too much from the topic but when I follow https://www.freebsd.org/doc/handbook/ad ... space.html to create a swapfile and use it, I get an error:dreamcat4 wrote: 2) You have run out of memory. Probably because you do not have any swap file. Then you need to create a swap file. Or upgrade (try to max out) your system RAM because RAM should be cheap enough these days. It is recommended to do both of those things.
Code: Select all
mdconfig: ioctl(/dev/mdctl): Device busyCode: Select all
mdconfig -a -t vnode -f /usr/swap0 -u 2 && swapon /dev/md2-
dreamcat4
- experienced User

- Posts: 111
- Joined: 21 Mar 2014 21:59
- Status: Offline
Re: Virtualbox in Jail
# To create a zfs swapfile as it's own zfs dataset
#https://forums.freebsd.org/viewtopic.php?&t=31861
# as root, on a zfs pool
zfs create -o org.freebsd:swap=on -o checksum=off -V 2G pool0/swap
swapon /dev/zvol/pool0/swap
# To create conventional swapfile regular file (as a real file)
swapfile=/mnt/pool0/var/.swap0
dd if=/dev/zero of=$swapfile bs=1M count=2048
chmod 0600 $swapfile
cat > /mnt/pool0/sbin/swap-postinit <<- "EOF"
#!/bin/sh
swapfile=/mnt/pool0/var/.swap0
mdconfig -a -t vnode -f $swapfile -u 9 && swapon /dev/md9
EOF
#https://forums.freebsd.org/viewtopic.php?&t=31861
# as root, on a zfs pool
zfs create -o org.freebsd:swap=on -o checksum=off -V 2G pool0/swap
swapon /dev/zvol/pool0/swap
# To create conventional swapfile regular file (as a real file)
swapfile=/mnt/pool0/var/.swap0
dd if=/dev/zero of=$swapfile bs=1M count=2048
chmod 0600 $swapfile
cat > /mnt/pool0/sbin/swap-postinit <<- "EOF"
#!/bin/sh
swapfile=/mnt/pool0/var/.swap0
mdconfig -a -t vnode -f $swapfile -u 9 && swapon /dev/md9
EOF
-
fsbruva
- Advanced User

- Posts: 378
- Joined: 21 Sep 2012 14:50
- Status: Offline
Re: Virtualbox in Jail
The reason you can't run or build it in a jail is because the jail is already a paravirtualized environment. That's like trying to run a Windows virtual machine, and then trying to run virtualbox inside that VM! It's like dividing by zero... you'll end up tearing a hole in the universe.
Seriously: Jails, by design, have significant limits placed on them and their processes, especially with regard to kernel access. Virtualbox, by design, needs to have nearly unrestricted kernel access so that it can load the modules necessary to create the virtual machine abstraction layer.
TL,DR; Use the extension - VirtualBox is jail incompatible!
Seriously: Jails, by design, have significant limits placed on them and their processes, especially with regard to kernel access. Virtualbox, by design, needs to have nearly unrestricted kernel access so that it can load the modules necessary to create the virtual machine abstraction layer.
TL,DR; Use the extension - VirtualBox is jail incompatible!