# Offline Jail Creation



## pchop6t9 (Jul 2, 2014)

*H*i *a*ll,

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


----------



## fonz (Jul 2, 2014)

That would depend on the procedure you intend to follow. More to the point: which packages are you referring to?


----------



## asteriskRoss (Jul 3, 2014)

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).
> ...



So to install the binaries from your installation CD you might do something like:

```
# 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):

```
# 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:

```
# pkg -j nameofjail add downloadedpackage.txz
```


----------



## wblock@ (Jul 3, 2014)

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.


----------



## pchop6t9 (Jul 3, 2014)

Thank you very much for your reply! `ez-jail admin install -h` works great! 

Regards,

Filipe


----------



## asteriskRoss (Jul 3, 2014)

@pchop6t9, I'm sure the forum users won't mind if I +1 myself (or should that be _++*ross;_ ?) for inspired guesswork about what you wanted :beer


----------

