FreeBSD Jails

July 24th, 2007

After some serious fun with OpenVZ, I've been reading about FreeBSD jails. I really need to read the jail manual.

And a page about BSD jails:,

which links to:, also very good.

OK, trying out the first build. I'm using the shell script example they provide on the man page:

cd /usr/src
mkdir -p $D
make world DESTDIR=$D
make distribution DESTDIR=$D
mount_devfs devfs $D/dev

Jails are working out very nicely. I'm pleased with the ability to run jailed FreeBSD in a jail because I'm sure as I learn the toolset I'll make some mistakes!

I'm planning to use OpenVZ on linux, and jails on FreeBSD. :-)

UPDATE: The second link referenced above has a great tip for duplicating BSD jails. I'll reproduce it here for convenience:

mkdir /usr/jail/new
cd /usr/jail/old
tar -cpf - . | tar -C /usr/jail/new -xpf -

Hmmm, just tried to start lighttpd after enabling /usr/local/etc/rc.d/lighttpd but I'm getting this error:

2007-08-02 04:28:07: (network.c.159) socket failed: Protocol not supported 

Found the answers I was looking for here: lighttpd on freebsd - (network.c.159) socket failed: Protocol not supported

That page is in a foreign language, so in a nutshell it says that you need to comment out ipv6 from /usr/local/etc/lighttpd.conf and specify your ip address instead of using I was unable to use port 80 so instead I used port 8088. I'll try and figure that one out too.

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022