So, if you’re already using bash like I am, this are the steps:
# i used /usr/jail/myjail as my first jail in FreeBSD.
export J /usr/jail/myjail
mkdir -p $J
make buildworld # run it when using jails for the first time…and wait, it’s gonna last..
make installworld DESTDIR=$J
make distribution DESTDIR=$J
mount -t devfs devfs $J/dev
Enable it on startup by editing /etc/rc.conf like this:
To start/stop your jail, use this:
/etc/rc.d/jail start myjailTo cleanly shutdown a jail, run:
/etc/rc.d/jail stop myjail
sh /etc/rc.shutdown #from inside a jailor, use jexec utility.
Some other programs you’ll probably use with jails, are found in /usr/ports/sysutils:
jailadmin, jailctl, jailutilsTo see what jails are running you can run:
jlsTo run a tcsh on a jail, run:
jexec JID tcsh…which will get you directly on that jail.