FreeBSD Jail Management

Elvin Aslanov
2 min readJul 9, 2022

--

FreeBSD jails is a containerization (lightweight virtualization) technology native to FreeBSD operating system.

This is similar to Docker in the Linux world.

System Commands

  • jail(8): create (-c), remove (-r), modify (-m), and exhibit (-e) jails
  • jls(8): list (exhibit) jails in human-friendly formats
  • jexec(8): execute commands within jails

System Commands Supporting Jails

The list is quiet extensive and includes FreeBSD commands such a pgrep, pkill, killall and so on.

Configuration Files

eg. service jail MyJail console

System Calls

Controlling jails from C programming languages including the sys/jail.h header file.

Library

There’s also libjail, an included C library for jail management calling the system calls above.

  • jail(3): front-end interface library to jail system calls

Source Code

In the package jail

Knowing these frees us from relying on the third-party software such as such as eazyjail and iocage to manage jails on a FreeBSD system conveniently.

FreeBSD Jails are documented in the Chapter 15 of the FreeBSD Handbook.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Elvin Aslanov
Elvin Aslanov

Written by Elvin Aslanov

Unix and Open Source Software passionate. Currently working as Tech Support / System Administrator at a Web Hosting company. https://www.linkedin.com/in/rwp0/

Responses (1)

Write a response