# What's the least amount of stuff a jail needs to do some small practical tasks?



## gladiola (Jun 9, 2020)

Recently, I read this article on jails and vnets, listed below.  I worked through the tutorials alright.  What got my attention, though, was that there was nothing in the jails.  Nothing.  They're empty.  Most of the time, I have worked exercises and tutorials that filled out the jails with a copy of the operating system.  

REF:  https://issue.freebsdfoundation.org/publication/?i=651491&ver=html5&p=19

So, I would like to ask:  What's the least amount of files and programs that we need to provide for a jail to perform a task?  That is, can a jail have just enough memory attached to run one process, like a socket listener program, and do that?  What about a couple of processes?  What about a jail with five or six processes running among a collection of about 20 files?  

When do we need to prepare to attach a full copy of the operating system inside it?  Do we see jails with copies of the OS in there because we frequently want to attain the goal of virtualizing the whole operating system; or, if we provide a small collection of executable programs in a jail, then will they fail to run without a separate copy of the OS?  If we design jails to run programs, when do we get to the point that we begin to require a copy of the OS in there?

Just curious.  I saw a great difference in the empty jails in that FreeBSD Journal article and other tutorials, like FreeBSD Mastery:  Jails.  Any help  you might provide would be appreciated.  Thanks.


----------



## Lamia (Jun 10, 2020)

gladiola said:


> What's the least amount of files and programs that we need to provide for a jail to perform a task?


Play with some of the jail utilities out there - qjail, ezjail, etc. Compare them with vm utilities - bhyve, virtualbox, etc. 

By the way, jails, VMs and the like are from the same race.


----------



## SirDice (Jun 10, 2020)

gladiola said:


> What's the least amount of files and programs that we need to provide for a jail to perform a task?


Nothing actually. Your minimal requirements are going to be dictated by the software you want to run.


----------



## priyadarshan (Mar 8, 2022)

gladiola said:


> Recently, I read this article on jails and vnets, listed below.  I worked through the tutorials alright.  What got my attention, though, was that there was nothing in the jails.  Nothing.  They're empty.  Most of the time, I have worked exercises and tutorials that filled out the jails with a copy of the operating system.
> 
> REF:  https://issue.freebsdfoundation.org/publication/?i=651491&ver=html5&p=19



The HTML version of the magazine is now behind a registration form. One can still access each section of a given issue as PDF, though. For example, the above article would be:



			https://freebsdfoundation.org/wp-content/uploads/2020/03/Jail-vnet-by-Examples.pdf


----------



## grahamperrin@ (Mar 8, 2022)

Lamia said:


> Play with some of the jail utilities out there - qjail, ezjail, etc. Compare them with vm utilities - bhyve, virtualbox, etc.



There's a recent call for testing for sysutils/mkjail – <https://issue.freebsdfoundation.org/publication/?m=33057&i=739644&p=47&ver=html5> (January/February 2022, pages 47–48)


----------

