mkjl: easily create a FreeBSD Debian GNU/k FreeBSD – ArchBSD under FreeBSD jails.

Clear All
I developed a small script without pretensions, that allows to easily create jails of FreeBSD, Debian GNU/kFreeBSD and ArchBSD type on a FreeBSD host. It is written in sh but is not competitive with ezjail or vmrc. On the other hand it saves no time if your need is easily deploy other than FreeBSD jails.

You will need to install the following packages (from pkgng or ports):

Perl5 (for debootstrap)
debootstrap (for debian template)
Pacman (for the archbsd template)
git (to retrieve mkjl, optional)
rsync (mkjl dependency)

And to rotate the jails Debian, you will need to load the modules fdescfs and linprocfs.
Installation of the prerequisites

Installation of packages:

# pkg update & pkg install git perl5 debootstrap rsync pacman

Load modules for Debian:

# kldload fdescfs
# kldload linprocfs

Or, in a persistent manner:

# echo fdescfs_load = “YES” > /boot/loader.conf
# echo linprocfs_load = “YES” > /boot/loader.conf

Recovery of
With git:

# git clone

Without git:

Just with the archive compressed:

fetch – No.-verify-peer


Use the following syntax:

#./ $name $template

For example, to a jail of type ArchBSD named www:

#./ www t_archbsd

Then you’ve to edit /etc/jail.conf to declare your jails. A jail.conf.example file is provided but you can also help you in this article…
Available templates

t_freebsd10: FreeBSD 10-RELEASE
t_debian7: Debian GNU/kFreeBSD Wheezy
t_debian8: Debian GNU/kFreeBSD Jessie
t_archbsd: ArchBSD