# Questions about jails



## Windmill (May 4, 2016)

I read about jails from the handbook, but I'm not sure I understand much about them. How do they work? It's like using a chroot? Can I install only FreeBSD or other operative systems too? I don't nerd deep explanations, just a basic understanding, I'm not very expert about operative systems, just playing around with some FreeBSD functionalities.


----------



## kpa (May 4, 2016)

They are beefed up chroot(8)s basically with much stricter control of what the jailed process can do compared to just plain chroot. You can't run other OSes in them like they were virtual machines but running an i386 jail on an amd64 works pretty much as expected and some people have even managed to run Linux jails using the linux(4) compatibility layer.


----------



## Petr Fischer (May 5, 2016)

Subquestion (novice in jails too): is something like "cpu and io throttling" for jails in final usable state (can I control "hot" jails with 100% cpu effectively)? everything via. rctl? what about swap (just one big swap shared by all jails)?


----------



## kpa (May 5, 2016)

Correct me someone if I'm wrong but I'm under the impression that resource limiting/control works the same under jails just as it works on processes running on the host. Swap is a function of the virtual memory subsystem of the kernel and since all jails run on the same kernel the swap is shared by all jails.


----------

