# Copying a jail to a standalone system



## balanga (Mar 16, 2019)

If I've used a jail to prototype a system, can I then copy that jail to a standalone system?

I'm referring to userland, although I would want to include any configuration in /etc or /boot.


----------



## thogard (Mar 16, 2019)

The jail image won't have enough stuff to boot as it is missing the boot loader, possible some drivers and maybe the disk partitioning.  You can do an install of the same version on the standalone system, then copy over all the other files or look at the bsdinstall scripts in /usr/libexec/bsdinstall/.  The auto gets run on a full install and it partitions the disk and installs the proper boot loader and asks more config questions.  The bsdinstall jail does much less.  If you compare auto and jail, its easy to see what you might need to fix up.

Have you considered building your standalone system as a jail host and run just one jail in it?


----------



## SirDice (Mar 19, 2019)

balanga said:


> If I've used a jail to prototype a system, can I then copy that jail to a standalone system?


Document what you installed, which configuration files you modified and why the change was needed. Then use the documentation to do a clean install on the stand-alone system. Preferably done by somebody else (so your documentation is verified too).


----------



## D-FENS (Mar 19, 2019)

You can run in the jail:

```
freebsd-update IDS
```

This will show you all the files that are different from the standard installation (all modified files).
You can install a fresh OS on the standalone system and then just copy the modified files from the command above.

Also, to make sure the system boots, merge files like /etc/rc.conf, /etc/sysctl.conf and /boot/loader.conf carefully, don't simply overwrite them.


----------

