Offline Jail Creation

Hi all,

Does anyone know how to create the base jail without an internet connection? What directory do I need to store the packages for the base jail creation?

Regards,

Filipe
 
That would depend on the procedure you intend to follow. More to the point: which packages are you referring to?
 
To expand on @fonz's answer, it is certainly possible to set up a jail without an Internet connection, using the compiled binaries from your FreeBSD installation media or by compiling from the source files also on your FreeBSD installation media. You mentioned a "base jail", so I'm guessing you might be using the sysutils/ezjail port to install and administer your jails.

The ezjail-admin man page has information on how to do both of these:
ezjail-admin install
This function sub-command is normally run once in the life of the ezjail environment. It allocates the direc- tory structure used by ezjail and populates the base jail using the minimal distribution set from a FreeBSD FTP server.
[...]
See also ezjail-admin update to install the base jail from source, as well as a method to update the base jail using freebsd-update(8).
The following options are available:
[...]
−h host
Set the remote host to fetch FreeBSD distribution sets from. If absent the default host ftp.FreeBSD.org is used. Variable: “$ezjail_ftphost”.
It is possible to install from the disc1 CDRom, or an extracted -RELEASE directory, by specify- ing the host argument as file://path/to/source.[...]
[...]

ezjail-admin update
Updates ezjail’s basejail, or in the −b or −i case, install a FreeBSD world from source to be used as base- jail.
Exactly one of the following operand must be specified:
−b Build a world from source and install it as the (updated) basejail. “make buildworld; make
installworld” by default using the sources located at /usr/src (but see the −s option).

So to install the binaries from your installation CD you might do something like:
Code:
# mount -t cd9660 /dev/cd0 /mnt
# ezjail-admin install -h file:///mnt/usr/freebsd-dist

To compile from the FreeBSD source files, which you had the option to include during your FreeBSD installation (if so it will be at /usr/src):
Code:
# ezjail-admin update -b

If you need to install applications from the ports collection, you will need to download these over an Internet connection. However, compiled packages can be installed on a machine without a connection and ports can be compiled and installed locally if you have obtained all of the required distribution files (again downloaded via the Internet). This would be quite a lengthy post in order to explain it fully and like @fonz, I'm not sure exactly what it is that you want. Once you have downloaded a binary package, it can be installed locally with something like:
Code:
# pkg -j nameofjail add downloadedpackage.txz
 
Last edited by a moderator:
If you built the host from source and the populated /usr/obj/ is still present, ezjail-admin update -i does a make installworld in the basejail.
 
Back
Top