From owner-freebsd-emulation@freebsd.org Mon Feb 15 11:40:47 2021 Return-Path: Delivered-To: freebsd-emulation@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0106752A6D6 for ; Mon, 15 Feb 2021 11:40:47 +0000 (UTC) (envelope-from mueller6722@twc.com) Received: from p-impout005.msg.pkvw.co.charter.net (p-impout005aa.msg.pkvw.co.charter.net [47.43.26.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DfMcF727sz4T78 for ; Mon, 15 Feb 2021 11:40:45 +0000 (UTC) (envelope-from mueller6722@twc.com) Received: from localhost ([96.28.177.163]) by cmsmtp with ESMTP id BcF2ll7YWeKjEBcF2lfSar; Mon, 15 Feb 2021 11:40:39 +0000 X-Authority-Analysis: v=2.3 cv=ALzgjvLx c=1 sm=1 tr=0 a=xqrt2BZAGHte7XHhrxJgbA==:117 a=xqrt2BZAGHte7XHhrxJgbA==:17 a=HpEJnUlJZJkA:10 a=0Q3p5KFhAAAA:8 a=NIObRGWJCemr9uD_DaAA:9 a=H6H7xLKjjQtGMdwgQydD:22 Date: Mon, 15 Feb 2021 11:40:59 +0000 From: "Thomas Mueller" To: freebsd-emulation@freebsd.org CC: JB 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> X-CMAE-Envelope: MS4wfHqjcC55O9kzeKjKuaj/xwuXoBjwA8lccHAA1XRuyQwzAOCxmJWdBKniZbZ8Z0cTuJqO26sWZbN/XMIaiFNSbv9BS8/+1o1sLIWkODGw1WH/tPUXWRxX 2Yn5SbuO2ijiTY8Lnr0YKCetxwYKK2BZ5REr4zI0VWcwzywYi+hwrR1JaCF+xP7hSN9h4MWTPtSOfSltdkDtkpCANnmJliHSAlBKlK7xFa7Vhbc6T6pKl5O6 X-Rspamd-Queue-Id: 4DfMcF727sz4T78 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mueller6722@twc.com designates 47.43.26.136 as permitted sender) smtp.mailfrom=mueller6722@twc.com X-Spamd-Result: default: False [2.20 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[twc.com]; R_SPF_ALLOW(-0.20)[+ip4:47.43.26.0/24]; RCPT_COUNT_TWO(0.00)[2]; RECEIVED_SPAMHAUS_PBL(0.00)[96.28.177.163:received]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[twc.com]; ASN(0.00)[asn:40294, ipnet:47.43.24.0/21, country:US]; RBL_DBL_DONT_QUERY_IPS(0.00)[47.43.26.136:from]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[twc.com]; SPAMHAUS_ZRD(0.00)[47.43.26.136:from:127.0.2.255]; MISSING_MID(2.50)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_CC(0.00)[protonmail.com]; MAILMAN_DEST(0.00)[freebsd-emulation] X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2021 11:40:47 -0000 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