Date: Mon, 15 Feb 2021 11:40:59 +0000 From: "Thomas Mueller" <mueller6722@twc.com> To: freebsd-emulation@freebsd.org Cc: JB <freebsdlists.admin@protonmail.com> Subject: Re: Linuxulator: running one's own small Linux in FreeBSD? References: <3OWRHri6YXev4KcRSoZUcPlowZ8fJeyKbDQXI_3Rak2YHuPKx9_mmN4KSvPH0s09ws0q2kG6tuwUagLbFLpE_mfpYwQ8qy-TSvO_WP6A240=@protonmail.com> <60275607.1c69fb81.18de5.04ffSMTPIN_ADDED_MISSING@mx.google.com> <CAJm2B-n3xyjht20hi=poY7tqA1Y3a26=L39aDYB7VZYSuovDSg@mail.gmail.com>
| previous in thread | raw e-mail | index | archive | help
from JB: > > 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 other 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 former: > 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. I was not aware of sysrc, see it is in FreeBSD but not NetBSD. It looks like "service mountd restart" does the same thing as "/etc/rc.d/mountd restart"; this was on NetBSD. I took a look at the man page for sysrc. I browsed the URL you gave me, might not be directly applicable to my case. I see it requires iocage (which I don't have) and debootstrap (which I never used but was aware of). Debootstrap is in FreeBSD ports but not NetBSD pkgsrc, however I don't see why one could not download the necessary files, apply the scripts, and make debootstrap outside FreeBSD ports or pkgsrc framework. I am inclined toward compatibility layer rather than jail if possible and would want to try under both FreeBSD and NetBSD. I would probably have to do chroot. Tom
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>