Those documents are obsolete, please use the Nethence Documentation
DragonflyBSD jail host configuration
On the real system which is going to host the jail guests.
Disable some daemons,
General jail settings,
Note. jail_list lists jails to be started with a simple space separator.
Note. jail_set_hostname_allow is set to yes by default (/etc/defaults/rc.conf)
Jail guest settings,
ifconfig_lnc0_alias0="inet 192.168.0.3 netmask 255.255.255.255"
Note. change the ip accordingly
Note. for ip aliases, the netmask should be /32
Note. change the network interface name/driver accordinly
Note. apply those patches to mount devfs for the jail guest (at least it's needed for dfly 2.8.2),
otherwise, without devfs, you wouldn't be able to ping,
ping: socket: Operation not permitted
nor to ps,
ps: bad namelist - no kernbase
No services other than ssh, syslog and cron should be running on the host system. Prevent sshd from listening on ip aliases,
At last, it's also recommended to file-resolve the jail guests from the host,
Note. besides, we're copying that one to guests' config later on.
Making a jail guest
Upload and extract the memstick image,
mkdir -p /mnt/memstick/
vnconfig vn0 dfly-x86_64-2.8.2_REL.img
mount /dev/vn0s1a /mnt/memstick/
Install a jail guest from the host,
mkdir -p /data/guests/jailname/
for dir in \
bin dev etc.hdd root sbin sys tmp usr var; do
cpdup /mnt/memstick/$dir $dir
mv etc.hdd/ etc
ls -ld tmp/
mkdir -p mnt/ proc/
Note. no need to copy boot/, also, it's therefore easy to recognize a jail guest without that dir.
Note. it's etc.hdd we want for the harddisk. etc itself is for the cdrom/memstick
Note. no need to MAKEDEV anymore. devfs does it for you.
Ready to go
Enable jail on the host and start the jail guest,
Get into the jail guest,
jexec 1 csh
and proceed with your usual post-installation procedure (http://pbraun.nethence.com/doc/sysutils_bsd/jail_guest.html) but eventually skip those steps;-)
cp /etc/hosts .
cp /etc/resolv.conf .
To start/stop a jail guest,
/etc/rc.d/jail stop jailname
/etc/rc.d/jail start jailname
Last update: Jan 03, 2011