Linuxulator: running one's own small Linux in FreeBSD?

JB freebsdlists.admin at protonmail.com
Sun Feb 14 01:13:03 UTC 2021


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, February 13, 2021 2:25 AM, Thomas Mueller <mueller6722 at twc.com> wrote:

> So I guess Linux service is restarted by "service linux restart"?

# service | grep List
-l      List all scripts in /etc/rc.d and /usr/local/etc/rc.d

# service -l | grep ux
linux

The `service' command controls the rc script that starts the service.


> kldstat on my Freebsd showed only linux.ko, linus_common.ko and linux64.ko .

Those modules won't be loaded until you start the `linux' service with 'linux_mounts_enable' enabled (or you mount them yourself with fstab, manually, or another script):

sysrc linux_mounts_enable=YES


> I had not yet actually attempted to run my small Linuxes in FreeBSD or NetBSD, not ready yet.
>
> I still would need such things as init scripts, proc fs, /etc/fstab and other configuration files.

The target directory can be empty (in the case of the default emulation path, '/compat/linux') when starting the service. It doesn't actually "start" your guest OS. I don't know what your plans are, but running Linux inside a jail is different than using the compatibility layer. It sounds like you want the latter:

https://www.harshadsharma.com/posts/2020/12/ubuntu-bionic-on-freebsd-with-iocage-managed-jails/


> FreeBSD Handbook online is not sufficiently detailed.

Sadly, documentation has lagged behind the high pace of OS development. But, better that than a slow pace of development.


More information about the freebsd-emulation mailing list