It's is a linux jail running on FreeBSD.What is this Linux jail? Is this actually a FreeBSD jail running Linux?
The terminology is not consistent here. In general, a so-called “Linux-Jail” on FreeBSD is not an actual jail – which would mean something using the well-known FreeBSD jail infrastructure, e.g.What is this Linux jail? Is this actually a FreeBSD jail running Linux?
jls
, jexec
, etc. – but rather a chroot-environment in /compat/linux
./compat/linux
into a genuin jail is easily possible.which would mean something using the well-known FreeBSD jail infrastructure,
Actually, I believe you get pretty close to a full jail - if you replace some of the network related binaries, you can even get your own vnet:The terminology is not consistent here. In general, a so-called “Linux-Jail” on FreeBSD is not an actual jail – which would mean something using the well-known FreeBSD jail infrastructure, e.g.jls
,jexec
, etc. – but rather a chroot-environment in/compat/linux
.
However, turning/compat/linux
into a genuin jail is easily possible.
jexec
to run linux binaries on demand. You seem to get jail-based process separation just like with a FreeBSD jail.root@bsd:/ramdisk2/ROOTFS # chroot .
chroot: /bin/csh: Exec format error
root@bsd:/ramdisk2/ROOTFS # uname -a
root@bsd:/ramdisk2/ROOTFS # uname -a
FreeBSD bsd 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr 9 04:04:45 UTC 2021 [email]root@releng1.nyi.freebsd.org[/email]:/usr/obj/usr/src/i386.i386/sys/GENERIC i386
This might be caused by a common mistake: you won't have csh in your chroot shell. You need to specify an alternative (linux) shell. You will also need to make sure, that linux compatibility is available (relevant kernel modules need to be loaded):chroot: /bin/csh: Exec format error
service linux onestart
chroot /path/to/jail /bin/bash