freebsd-update on jails

Jeffrey Smith jeffrey.smith at futurecis.com
Wed Apr 30 09:36:34 UTC 2008


On Wed, 2008-04-30 at 00:08 +0200, Jeremie Le Hen wrote:
> Hi Jeffrey,
> 
> On Sun, Apr 20, 2008 at 03:49:39PM -0400, Jeffrey Smith wrote:
> >   I previously posted a howto to use zfs to manage jails.  The first
> 
> Could you remind us the URL of this howto please?
> 
> Thanks.
> Regards,

I posted it here to this list, looking for recommendations.
The only update I have for it is that freebsd-update doesn't work
as ZFS doesn't yet support chflags.  Other than that I am very happy
with this setup.  Can't wait for ZFS to mature to the point for this
to work flawlessly.

Here it is again




                               ZFS Jails


#zpool create pool

#zfs create -o mountpoint=jails pool/jails

#zfs create pool/jails/jailbase

#mkdir -p /jails/7.0-RELEASE/base /jails/7.0-RELEASE/man pages

#cd /jails/7.0-RELEASE/base


NOTE: Files can also be copied from Disc1 cdrom

#ftp ftp.freebsd.org:/pub/FreeBSD/releases/amd64/7.0-RELEASE/base/


ftp>mget *

ftp>cd ../manpages

ftp>lcd ../manpages

ftp>mget *

ftp>exit


#export DESTDIR=/jails/jailbase

#sh install.sh

#cd ../manpages

#sh install.sh

#export DESTDIR=””

#mkdir -p /jails/jailbase/usr/ports

#mount_nullfs /usr/ports /jails/jailbase/usr/ports

#touch /jails/jailbase/etc/fstab

#cp /etc/resolv.conf /jails/jailbase/etc


#vi /etc/rc.conf


#

# Jail Defaults

#

jail_enable=”YES”

jail_set_hostname_allow=”NO”

jail_interface=”bge0”

jail_devfs_enable=”YES”

jail_list=”jailbase”


#

# jailbase.example.org

#

jail_jailbase_hostname=”jailbase.example.org”

jail_jailbase_ip=”192.168.0.50”

jail_jailbase_rootdir=”/jails/jailbase”


:wq


#/etc/rc.d/jail start

#jls

#jexec 1 tcsh

#set autolist


NOTE: freebsd-update does not work, as ZFS does not support chflags.
	looking for a work around

Install ports or package that all jails will require, such as bash and
vim-lite


#exit


Back to host

#zfs snapshot pool/jails/jailbase at YYYYMMDD#

#zfs clone pool/jails/jailbase at YYYYMMDD# pool/jails/ns

#zfs clone pool/jails/jailbase at YYYYMMDD# pool/jails/mail

#zfs clone pool/jails/jailbase at YYYYMMDD# pool/jails/www

#vi /etc/rc.conf


...snip...

jail_list=”jailroot ns mail www”

...snip...


#

# ns.example.org

#

jail_ns_hostname=”ns.example.org”

jail_ns_ip=”192.168.0.51”

jail_ns_rootdir=”/jails/ns”


#

# mail.example.org

#

jail_mail_hostname=”mail.example.org”

jail_mail_ip=”192.168.0.52”

jail_ns_rootdir=”/jails/mail”


#

# www.example.org

#

jail_www_hostname=”www.example.org”

jail_www_ip=”192.168.0.53”

jail_www_rootdir=”/jails/www”


:wq


#/etc/rc.d/jail start

#jls




More information about the freebsd-jail mailing list