Documentation by Dysphunkional
A jail is FreeBSD way of putting a portion of a system behind restrictions so that the jailed software can’t access the rest of the system. This is sort of like having a virtual machine running the same OS as the host but with almost no performance overhead. Jails are also how plugins are implemented on a FreeNAS server. Jails are similar to Linux Containers (LXC) and Solaris Zones.
“Jails are like chroot on steroids.”
Logging into a Jail
To log into a jail you first need to get to the command prompt of the host system. You can do that by connecting to the server using a ssh client like PuTTy or by selecting Shell in the FreeNAS WebUI.
Frist you need to find out the ID of the jail by running the jls command
You should see a table like this:
JID IP Address Hostname Path 1 10.1.0.12 Testing /mnt/vol0/jails/Testing 2 10.1.0.13 Production /mnt/vol0/jails/Production
jexec ID command
where ID is the JID from the output of the jls command and command is the name of the shell you want to use in the jail. tcsh is installed by default so you can use that until you install another shell. I prefer bash. So if I wanted to log into my Testing jail using tcsh I would use the command:
jexec 1 tcsh
If I wanted to log into my Production jail using bash I would use the command:
jexec 2 bash