hi, may i know what those are for? do i need them if I were to create or use jails?
yes, years ago, but I have never used or need the above when i created or used jails.Have you read ,
https://docs.freebsd.org/en/books/handbook/jails/
# zfs list -r zroot/usr/jail | grep '15.0-'
zroot/usr/jail/15.0-base 557M 1.74T 557M /usr/jail/15.0-base
zroot/usr/jail/15.0-base-jail 518M 1.74T 518M /usr/jail/15.0-base-jail
zroot/usr/jail/15.0-min 130M 1.74T 130M /usr/jail/15.0-min
zroot/usr/jail/15.0-min-jail 88.7M 1.74T 88.7M /usr/jail/15.0-min-jail
Which method are you using to make the jails? I haven't tried the handbook way, but it looks to be the most manual way available. I personally use bastille, but the other instructions from the projects can be found here: https://docs.freebsd.org/en/books/handbook/jails/#jail-managers-and-containersskhal
Would you kindly give me the step-by-step as to how you created those populated datasets, please? The handbook is not helpful and nor have Google searches or even AI inquiries been of any help.
I've been stymied by repeated "pkg: Error opening the trusted directory /usr/share/keys/pkg/trusted" errors of various flavors.
Thank you.
I'm curiouse myself.skhal
Would you kindly give me the step-by-step as to how you created those populated datasets, please?
-r (--rootdir) to specify where to install the packages, and pkg-install(8) -r ( --repository) to specify the package repository to fetch the packages from.pkg -r /usr/jail/15.0-base-jail install -r FreeBSD-base FreeBSD-set-base-jail
I've been stymied by repeated "pkg: Error opening the trusted directory /usr/share/keys/pkg/trusted" errors of various flavors.
pkg requires some missing files in the jail, just copy them directly into the jail.mkdir -p "$path_to_jail"/usr/share/keys/pkg/trusted
cp /usr/share/keys/pkg/trusted/* "$path_to_jail"/usr/share/keys/pkg/trusted/
mkdir -p "$path_to_jail"/var/db/pkg
cp -r /var/db/pkg/repos "$path_to_jail"/var/db/pkg/
pkgbase jails currently:pkg -r "$path_to_jail" install -y FreeBSD-set-minimal-jail
FreeBSD-set-base-jail you get a bigger jail than with FreeBSD-set-minimal-jail ~ > zfs list -r zroot/jails/basejail
NAME USED AVAIL REFER MOUNTPOINT
zroot/jails/basejail 561M 7.86G 561M /usr/local/jails/basejail
~ >
~ > zfs list -r zroot/jails/minimaljail
NAME USED AVAIL REFER MOUNTPOINT
zroot/jails/minimaljail 132M 7.86G 132M /usr/local/jails/minimaljail
Just to be clear, I did not invent anything I mostly borrowed ideas from the the wiki page and this how-to.Thank you, gotnull. That seems to work. It is SIGNIFICANTLY different than anything else I've read and thank you.
For my usageNow to figure out when to use the minimal jail vs the basejail in production.
FreeBSD-set-basejail is my go to.FreeBSD-set-minimal-jail seems for very specific case, command like sysrc doesn't work for example and I bet many other things are missing too.-- create a dataset
# zfs create zroot/jail/template/$(freebsd-version)
-- Copy pkg(8) keys to access repositories
# mkdir -vp /jail/template/$(freebsd-version)/usr/share/keys
# cp -vrn /usr/share/keys/pkg* /jail/template/$(freebsd-version)/usr/share/keys/
-- Prepare file hierarchy for pkg(8) database
# mkdir -vp /jail/template/$(freebsd-version)/var/db/pkg/repos
-- Mount tmpfs(4) for metadata cache:
# mount -vt tmpfs tmpfs /jail/template/$(freebsd-version)/var/db/pkg/repos
-- Install minimal set of packages designed for jails
# pkg -r /jail/template/15.0-minimal install FreeBSD-set-minimal-jail
-- verify work
# chroot /jail/template/$(freebsd-version)/ freebsd-version -u
15.0-RELEASE