Since many people ask me on how to simplify the Setupprocess of a jail I have a few hints.
Code: Select all
Do what you whant.
Don't blame me if something f_* up.
# zfs create -o mountpoint=/jails zm/jails
# mkdir /jails/files
# mkdir /jails/proto
# cd /jails/files
# fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/`uname -m`/`uname -r | cut -d- -f1-2`/base.txz
# cd /jails/files
# tar xvf base.txz -C /jails/proto
# cp /etc/resolv.conf /jails/proto/etc/
# jail -c path=/jails/proto \
name=proto \
host.hostname=proto.fantaranch.tld \
ip4.addr=192.168.1.112 \
interface=bge0 \
mount.devfs \
persist
see man jail for additional settings like mounting drives.
http://www.freebsd.org/cgi/man.cgi?query=jail&manpath=FreeBSD+9.1-RELEASE
# jls
JID IP Address Hostname Path
1 192.168.1.112 proto.fantaranch.tld /jails/proto
# jexec proto hostname
proto.fantaranch.tld
Autostart of "proto" jail
Open WebUI
- System|Advanced|Command scripts
- Add Command with "+"
Command = /usr/sbin/jail -c path=/jails/proto name=proto host.hostname=proto.fantaranch.tld ip4.addr=192.168.1.112 interface=bge0 mount.devfs persist
Type = PostInit


