# Different FreeBSD versions on Host and Jail



## segfault (Nov 5, 2013)

Thanks to the awesome BSDNow.tv podcast I've become interested in delving more into ZFS/jails. My VERY limited understanding of jails dictates that the jail runs on the kernel and libraries/toolchain of the host. If the host was upgraded from Release 7 to 8 for example, the jails would automatically follow, is that correct? Is it possible to leave a jail running older versions of the kernel/toolchain/world? For example, could I have jails running FreeBSD 7, FreeBSD 9 while the host is running FreeBSD 8?

Reason I ask is that we are using a Fedora5 build machine at work to compile our legacy code on, but I need to build some code requiring (slightly) newer libraries/kernel. I am curious if FreeBSD could make this easier by using a ZFS jail for each build environment needed.


----------



## kpa (Nov 5, 2013)

Every jail is using the kernel from the host system, there's no way to use different kernel for a jail. It's unwise to mix world and kernel from different versions. The only thing that is guaranteed that you can have a slightly outdated world after booting a new kernel and you can then perform `make installworld` to update the world to match the new kernel.


----------



## SirDice (Nov 7, 2013)

There shouldn't be a problem with running an 8.x world in a jail on a 9.x host. Lower versions than the host should work but you cannot run a higher version. So a 9.x jail on an 8.x host won't work. You'd also need the appropriate COMPAT_FREEBSD8 and COMPAT_FREEBSD7 in your kernel, the GENERIC kernel should already have them.

I recently updated to 10.0 but my jails are still at 9.2. The jails run fine.


----------



## daemotron (May 29, 2014)

I just stumbled across a report explaining how someone managed to get a really outdated FreeBSD 4 jail running on a FreeBSD 10 host: http://blather.michaelwlucas.com/archives/1919.

This article also nicely describes the side effects with userland tools interacting with kernel resources (such as ps, netstat, etc.).


----------

