jails Enable linux compatibility inside a standard FreeBSD jail

Dears,
I am using a standard FreeBSD jail which is serving a nextcloud instance. For the purpose of providing ONLYOFFICE in Nextcloud in do need Linux compatibility inside the FreeBSD jail. Hence I added linux_enable=YES to rc.conf but I get the following output when trying to start the Linux service. Would be great if anyone could give a hint me.

/etc/rc.conf
Code:
linux_enable=YES

Code:
[root@nextcloud:/]# service linux start
linux does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
 
Code:
$ grep KEYWORD /etc/rc.d/linux
# KEYWORD: nojail

The most important thing this init script does is loading the kernel modules that provide the Linux-compatible syscalls etc. Jails don't have a kernel, they run on the host's kernel. If you need the linuxulator in a jail, you must enable it on the host.
 
The most important thing this init script does is loading the kernel modules that provide the Linux-compatible syscalls
It also tries to mount several filesystems (linprocfs(5) for example), a typical jail isn't allowed to mount filesystems either.
 
SirDice of course, the typical approach for a jail is to mount everything necessary from the host as well (so, if you e.g. need linprocfs, mount it, just like you might mount devfs etc....) I thought this goes without saying, but maybe not ;)
 
Thanks for your responses. Mounting of several filesystems for linux layer is also explained freebsd wiki linuxemu under 11.5.

Everything is working as expected and linux emulation is working in my jail.

/usr/jails/fstab/nextcloud.fstab
devfs /usr/jails/nextcloud/compat/linux/dev devfs rw,late 0 0
tmpfs /usr/jails/nextcloud/compat/linux/dev/shm tmpfs rw,late,size=1g,mode=1777 0 0
fdescfs /usr/jails/nextcloud/compat/linux/dev/fd fdescfs rw,late,linrdlnk 0 0
linprocfs /usr/jails/nextcloud/compat/linux/proc linprocfs rw,late 0 0
linsysfs /usr/jails/nextcloud/compat/linux/sys linsysfs rw,late 0 0
 
Back
Top