<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Fun with ones and zeros - freebsd</title>
<subtitle>Barry&#039;s notes on computer software and hardware</subtitle>
<link href="/blog/tags/freebsd"></link>
<updated>2026-05-20T01:51:55-07:00</updated>
<id>urn:uuid:0be75586-0f43-36d0-259f-627edadbfc12</id>
<entry>
<title>Building Sentry on FreeBSD</title>
<link href="/blog/entries/building-sentry-on-freebsd"></link>
<id>urn:uuid:e0de5827-6d50-bc92-c33e-0cc0aee0d9aa</id>
<updated>2019-05-31T10:00:00-07:00</updated>
<author><name>Barry Pederson</name>
<email>bp@barryp.org</email>
</author>
<content type="html">&lt;p&gt;So I was hoping to install the on-premise version of &lt;a href=&quot;https://sentry.io&quot;&gt;Sentry&lt;/a&gt; 9.0.0 on
my FreeBSD 11 box, but ran into a snag.  I was using the
&lt;a href=&quot;https://docs.sentry.io/server/installation/python/&quot;&gt;Installation with Python&lt;/a&gt; instructions, but it failed to build the
&lt;code&gt;semaphore&lt;/code&gt; module (another user has an &lt;a href=&quot;https://forum.sentry.io/t/issue-installing-semaphore-in-freebsd/4528&quot;&gt;error dump&lt;/a&gt; available).&lt;br /&gt;
Unfortunately the official response is: We don’t support FreeBSD.&lt;/p&gt;
&lt;p&gt;The key error seems to boil down to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;relocation R_X86_64_TPOFF32 against `a local symbol’ can not be used when 
making a shared object; recompile with -fPIC …/…/src/libsodium/.libs/libsodium.a: 
could not read symbols: Bad value cc: error: linker command failed with 
exit code 1 (use -v to see invocation) *** [randombytes] Error code 1&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So it&#039;s a libsodium error, some more digging found that sodium was a dependency
of &lt;a href=&quot;https://github.com/maidsafe/rust_sodium/tree/rust_sodium-sys-0.9.0&quot;&gt;rust_sodium&lt;/a&gt;, which nicely has the ability
&lt;a href=&quot;https://github.com/maidsafe/rust_sodium/tree/rust_sodium-sys-0.9.0#user-content-to-use-your-own-copy-of-libsodium&quot;&gt;To use your own copy of libsodium&lt;/a&gt;, with the stipulation that you&#039;re using
the same version they are.  &lt;/p&gt;
&lt;p&gt;Looking at their &lt;code&gt;rust_sodium/rust_sodium-sys/build.rs&lt;/code&gt;
shows they&#039;re using libsodium 1.0.16, and a check of the FreeBSD security/libsodium
Makefile shows the same version - so we&#039;re in business.&lt;/p&gt;
&lt;p&gt;So after building and installing the libsodium port, I tried the Sentry install
again with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;RUST_SODIUM_LIB_DIR=/usr/local/lib pip install -U sentry&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and it worked!  Overall the FreeBSD ports that need to be installed as build dependencies are:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;databases/postgresql11-client
devel/py-virtualenv@py27
graphics/jpeg
lang/rust
security/libsodium
textproc/libxml2
textproc/libxslt&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For additional runtime dependencies I&#039;ve got:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;databases/postgresql11-contrib  (Needed for citext extension)
databases/postgresql11-server
databases/redis
mail/exim
sysutils/py-supervisor&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After a long build, I got this warning (in red):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;redis-py-cluster 1.3.6 has requirement redis==2.10.6, but you&#039;ll have redis 2.10.5 which is incompatible.&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Looked at &lt;a href=&quot;https://github.com/getsentry/sentry/blob/9.0.0/requirements-base.txt&quot;&gt;https://github.com/getsentry/sentry/blob/9.0.0/requirements-base.txt&lt;/a&gt;
and found sentry wants redis &amp;lt; 2.10.6, and is OK with redis-py-cluster &amp;gt;= 1.3.4&lt;/p&gt;
&lt;p&gt;Looked at &lt;a href=&quot;https://github.com/Grokzen/redis-py-cluster/blob/1.3.4/requirements.txt&quot;&gt;https://github.com/Grokzen/redis-py-cluster/blob/1.3.4/requirements.txt&lt;/a&gt;
and found that version is OK with redis &amp;gt;= 2.10.2&lt;/p&gt;
&lt;p&gt;So the fix seems to be to downgrade redis-py-cluster slightly to a version that
sentry is OK with, and is OK with the version of redis sentry wants.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pip install -U redis-py-cluster==1.3.4&lt;/code&gt;&lt;/pre&gt;</content>
</entry>
<entry>
<title>RancherOS/ISOLinux/Syslinux on FreeBSD bhyve</title>
<link href="/blog/entries/rancheros-isolinux-syslinux-on-freebsd-bhyve"></link>
<id>urn:uuid:a217b258-34e7-9643-172a-e8e7ccbdd3e5</id>
<updated>2018-10-05T07:35:00-07:00</updated>
<author><name>Barry Pederson</name>
<email>bp@barryp.org</email>
</author>
<content type="html">&lt;p&gt;After messing with Docker on my laptop, I thought it would be interesting to setup a VM on my FreeBSD server to
run  &lt;a href=&quot;https://rancher.com/rancher-os/&quot;&gt;RancherOS&lt;/a&gt;.  I&#039;ve been using &lt;a href=&quot;https://www.freshports.org/sysutils/vm-bhyve&quot;&gt;vm-bhyve&lt;/a&gt; to manage the VMs, and have been running Ubuntu
without much problem, so I figured another Linux distro would be fine ... but ended up opening a whole can of worms
and while I did get it running eventually, I learned more about grub and booting on bhyve than I really wanted.&lt;br /&gt;
I thought I&#039;d jot down some notes here for future reference.&lt;/p&gt;
&lt;p&gt;To start with, bhyve is not a general hypervisor that can boot any PC-compatible disk or CD image you throw at it,
the way something like KVM, VMWare, or Parallels can.  It doesn&#039;t start a VM in 16-bit mode and go through an
old-school BIOS boot sequence where it reads a Master Boot Record and executes whatever&#039;s there.   It knows how
to load a FreeBSD kernel, and with &lt;a href=&quot;https://www.freshports.org/sysutils/grub2-bhyve&quot;&gt;grub2-bhyve&lt;/a&gt; it can boot disks and CDs that use Grub2 - such as Ubuntu.  &lt;/p&gt;
&lt;p&gt;Unfortunately, RancherOS doesn&#039;t use grub, instead it uses &lt;a href=&quot;https://www.syslinux.org&quot;&gt;Syslinux/ISOLinux&lt;/a&gt; on their ISO images and
harddisk installations.  When bhyve boots using the grub loader, it doesn&#039;t find any grub menu on the disk, and just
drops you into a grub command prompt.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GNU GRUB  version 2.00

Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists possible
device or file completions.

grub&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fortunately, the grub commandline is like a mini-os, with lots of abilities to look around the disks, and it
turns out manually boot things like RancherOS.  &lt;/p&gt;
&lt;p&gt;The first command to run is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;set pager=1&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;so that future commands don&#039;t just scroll off the screen.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;help&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;displays a list of commands, &lt;code&gt;help &amp;lt;command&amp;gt;&lt;/code&gt; gives a short explanation. &lt;code&gt;ls&lt;/code&gt; lets you start poking around, in this
case giving:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(cd0) (cd0,msdos1) (host)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we&#039;re getting somewhere.  Trying &lt;code&gt;ls (cd0)&lt;/code&gt; gives&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Device cd0: Filesystem type iso9660 - Label `RancherOS&#039; - Last modification time 2018-09-19 03:09:12 Wednesday, UUID 2018-09-19-03-09-12-00 - Total size 176128 sectors&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;ls -l (cd0)/&lt;/code&gt; gives &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;DIR          20180919030909 boot/
DIR          20180919030912 rancheros/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;OK, a boot directory, getting closer. &lt;code&gt;ls -l (cd0)/boot&lt;/code&gt; gives&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;170          20180919030909 global.cfg
66978212     20180919030909 initrd-v1.4.1
DIR          20180919030909 isolinux/
1373         20180919030909 linux-current.cfg
12734        20180919030909 rancher.png
5523216      20180919030909 vmlinuz-4.14.67-rancher2&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There we go, isolinux, but no grub files, no wonder it doesn&#039;t boot.  After lots and lots of messing around learning
grub, I was able to get an initial boot of the CD image from the grub&amp;gt; prompt with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;linux (cd0)/boot/vmlinuz-4.14.67-rancher2
initrd (cd0)/boot/initrd-v1.4.1
boot&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And it started!  After lots of Linux boot output  I was rewarded with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                ,        , ______                 _                 _____ _____TM
   ,------------|&#039;------&#039;| | ___ \               | |               /  _  /  ___|
  / .           &#039;-&#039;    |-  | |_/ /__ _ _ __   ___| |__   ___ _ __  | | | \ &#039;--.
  \/|             |    |   |    // _&#039; | &#039;_ \ / __| &#039;_ \ / _ \ &#039;__&#039; | | | |&#039;--. \
    |   .________.&#039;----&#039;   | |\ \ (_| | | | | (__| | | |  __/ |    | \_/ /\__/ /
    |   |        |   |     \_| \_\__,_|_| |_|\___|_| |_|\___|_|     \___/\____/
    \___/        \___/     Linux 4.14.67-rancher2

    RancherOS #1 SMP Thu Sep 13 15:37:04 UTC 2018 rancher ttyS0
    docker-sys: 172.18.42.1 eth0: 10.66.0.48 lo: 127.0.0.1
rancher login:&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Very cool, but what&#039;s the login?  Userid is &lt;code&gt;rancher&lt;/code&gt;, but there is no default password.  According to the rancher
docs, the ISO image is supposed to auto-login.  Now what?&lt;/p&gt;
&lt;p&gt;After rebooting and getting back to the grub&amp;gt; prompt, and digging around more, I found that
&lt;code&gt;cat (cd0)/boot/global.cfg&lt;/code&gt; showed:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;APPEND rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.autologin=ttyS1 rancher.autologin=ttyS1 console=tty1 console=ttyS0 console=ttyS1 printk.devkmsg=on panic=10&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ah, LInux command parameters including autologin stuff. To apply them it ended up being (again at the grub&amp;gt; prompt):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;linux (cd0)/boot/vmlinuz-4.14.67-rancher2 rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.autologin=ttyS1 rancher.autologin=ttyS1 console=tty1 console=ttyS0 console=ttyS1 printk.devkmsg=on panic=10
initrd (cd0)/boot/initrd-v1.4.1
boot&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(that commandline could probably be simplified since we can see from the banner that our VM console is ttyS0, so we
probably don&#039;t need the params relating to tty1 or ttyS1)
This time I got the cattle banner from above, and a beautiful:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Autologin default
[rancher@rancher ~]$&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A simple &lt;code&gt;sudo -s&lt;/code&gt; (not requiring a password) gives root access.  At that point you can do whatever, including
installing onto a harddisk.   &lt;/p&gt;
&lt;p&gt;To get a RancherOS harddisk installation to boot, you&#039;d have to go through similar steps with grub in exploring around
the (hd0,1) disk to find the kernel, initrd, and kernel params.  The grub commands for booting can be saved permanently
in the vm-bhyve config for this machine with &lt;code&gt;grub_runX&lt;/code&gt; lines like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;grub_run0=&quot;linux (hd0,1)/boot/vmlinuz-4.14.67-rancher2 rancher.autologin=ttyS0 printk.devkmsg=on rancher.state.dev=LABEL=RANCHER_STATE rancher.state.wait panic=10 console=tty0&quot;
grub_run1=&quot;initrd (hd0,1)/boot/initrd-v1.4.1&quot;
grub_run2=&quot;boot&quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So the full vm-bhyve config file looks like (in case you&#039;re wondering - I hate it when people give snippets of code
but don&#039;t show where it should go exactly):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;loader=&quot;grub&quot;
grub_run0=&quot;linux (hd0,1)/boot/vmlinuz-4.14.67-rancher2 rancher.autologin=ttyS0 printk.devkmsg=on rancher.state.dev=LABEL=RANCHER_STATE rancher.state.wait panic=10 console=tty0&quot;
grub_run1=&quot;initrd (hd0,1)/boot/initrd-v1.4.1&quot;
grub_run2=&quot;boot&quot;
cpu=2
memory=2048M
network0_type=&quot;virtio-net&quot;
network0_switch=&quot;public&quot;
disk0_type=&quot;virtio-blk&quot;
disk0_name=&quot;disk0&quot;
disk0_dev=&quot;sparse-zvol&quot;
uuid=&quot;7f9fc9e5-c835-11e8-a327-e03f49af0c7d&quot;
network0_mac=&quot;58:9c:fc:05:2a:04&quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With that, my VM now boots without manual intervention, even though the virtual disk doesn&#039;t use grub.&lt;/p&gt;</content>
</entry>
<entry>
<title>Mercurial escaped colors</title>
<link href="/blog/entries/mercurial-escaped-colors"></link>
<id>urn:uuid:943d1a78-9e90-7ad8-3603-4fffba8b4a14</id>
<updated>2017-06-11T10:09:00-07:00</updated>
<author><name>Barry Pederson</name>
<email>bp@barryp.org</email>
</author>
<content type="html">&lt;p&gt;After upgrading Mercurial to 4.2 on my FreeBSD 10.x boxes, there was a problem in that the mercurial color extension
was now enabled, and suddenly things like &lt;code&gt;hg status&lt;/code&gt; were showing output like&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ESC[0;34;1mM ESC[0mESC[0;34;1mpf.confESC[0m&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;after lots of digging, finally figured out it was caused by my PAGER environment variable being set to &lt;code&gt;more&lt;/code&gt;, pretty outdated.  Fixed it on-the-fly with &lt;code&gt;export PAGER=&#039;less -X&#039;&lt;/code&gt; and got nice colorized output.   Made it permanent by editing &lt;code&gt;~/.profile&lt;/code&gt; and replacing a line I had setting the PAGER with a new one:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PAGER=&#039;less -X&#039;;    export PAGER&lt;/code&gt;&lt;/pre&gt;</content>
</entry>
<entry>
<title>IPv6 World Launch Day</title>
<link href="/blog/entries/ipv6-world-launch-day"></link>
<id>urn:uuid:5e0fcd22-cd65-97c3-767f-741c960041e9</id>
<updated>2012-04-08T15:36:00-07:00</updated>
<author><name>Barry Pederson</name>
<email>bp@barryp.org</email>
</author>
<content type="html">&lt;img src=&quot;/assets/7/18/World_IPv6_launch_banner_256.png&quot; alt=&quot;IPv6 Logo&quot; style=&quot;float:left; margin-right: 2em;&quot; width=&quot;106&quot; height=&quot;226&quot;/&gt;
&lt;p&gt;I&#039;ve been working on getting this website up and running under IPv6, and it turned out to be somewhat involved.
Firstly, I signed up with Hurricane Electric&#039;s &lt;a href=&quot;http://tunnelbroker.net&quot;&gt;tunnelbroker.net&lt;/a&gt;, to get IPv6 connectivity, because my ISP
doesn&#039;t offer it yet.  Setup my own DNS servers running &lt;a href=&quot;http://www.nlnetlabs.nl/projects/nsd/&quot;&gt;nsd&lt;/a&gt;, which was a bit of a learning curve, but in the long
run I think it&#039;ll be better than working with goofy DNS managers like you&#039;d find on registrar or hosting websites.&lt;br /&gt;
NameCheap is now letting you setup IPv6 glue records right on their website (previously you had to file a support
ticket), so that made things easier.&lt;/p&gt;
&lt;p&gt;The only big glitch I ran into is that on FreeBSD, using simply&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;listen [::]:80;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to listen to both IPv4 and IPv6 didn&#039;t work.  When trying that, I found that any request coming in as IPv4 would give
weird 403 or 404 (I don&#039;t remember which) errors, where it seemed nginx just didn&#039;t know what virtual host to go to.&lt;br /&gt;
Linux doesn&#039;t seem to have that problem. Ended up using separate listen statements, as in:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;listen 80 default_server;
listen [::]:80 default_server ipv6only=on;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;for the main site, but VERY IMPORTANTLY, the remaining sites could not have the &lt;code&gt;ipv6only=on&lt;/code&gt; directive, they just
simply say &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;listen  80;
listen [::]:80;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(found that trick in this &lt;a href=&quot;http://serverfault.com/questions/277653/nginx-name-based-virtual-hosts-on-ipv6&quot;&gt;ServerFault page&lt;/a&gt;).  This also has the advantage of showing proper IPv4 IP addresses in
the logs, instead of IPv4-mapped IPv6 addresses such as &lt;code&gt;::ffff:11.22.33.44&lt;/code&gt;, so I ended up doing the same thing on a
Linux box even though it handled dual-stack by default just fine.&lt;/p&gt;
&lt;p&gt;I also for testing purposes, made aliases&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://ipv4.barryp.org/blog/&quot;&gt;http://ipv4.barryp.org/blog/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://ipv6.barryp.org/blog/&quot;&gt;http://ipv6.barryp.org/blog/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To force one protocol or the other.  When you use &lt;a href=&quot;http://barryp.org/blog/&quot;&gt;http://barryp.org/blog/&lt;/a&gt;, it&#039;s not obvious which you&#039;re
using.&lt;/p&gt;</content>
</entry>
<entry>
<title>Debian GNU/kFreeBSD in a FreeBSD Jail - part 2</title>
<link href="/blog/entries/debian-gnukfreebsd-freebsd-jail-part-2"></link>
<id>urn:uuid:491620cc-56cf-188e-41dc-4ad604e2402e</id>
<updated>2012-02-29T07:49:00-08:00</updated>
<author><name>Barry Pederson</name>
<email>bp@barryp.org</email>
</author>
<content type="html">&lt;p&gt;&lt;a href=&quot;/blog/entries/debian-gnukfreebsd-freebsd-jail&quot;&gt;Previously&lt;/a&gt; I wrote about getting Debian GNU/kFreeBSD working in a jail.  I&#039;ve worked on it a bit more, polishing things up so I&#039;ve got it working pretty seamlessly with my existing &lt;a href=&quot;http://erdgeist.org/arts/software/ezjail/&quot;&gt;ezjail&lt;/a&gt; FreeBSD jails, so everything starts automatically, and you can use the &lt;code&gt;ezjail&lt;/code&gt; commands to stop/restart the jail.  &lt;/p&gt;
&lt;p&gt;Here are a few more notes about how things got setup for my jail I named &lt;code&gt;debian&lt;/code&gt;:&lt;/p&gt;
&lt;h2&gt;Kernel Modules&lt;/h2&gt;
&lt;p&gt;In &lt;code&gt;/boot/loader.conf&lt;/code&gt;, I added these lines:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fdescfs_load=&quot;YES&quot;
linprocfs_load=&quot;YES&quot;
linsysfs_load=&quot;YES&quot;
tmpfs_load=&quot;YES&quot;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Mounting Filesystems&lt;/h2&gt;
&lt;p&gt;Created &lt;code&gt;/etc/fstab.debian&lt;/code&gt; and populated with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;linproc     /jails/debian/proc      linprocfs       rw 0 0
linsys      /jails/debian/sys       linsysfs        rw 0 0
tmpfs       /jails/debian/lib/init/rw   tmpfs       rw 0 0&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;ezjail Config&lt;/h2&gt;
&lt;p&gt;Created &lt;code&gt;/usr/local/etc/ezjail/debian&lt;/code&gt; with these contents:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export jail_debian_hostname=&quot;debian&quot;
export jail_debian_ip=&quot;127.0.0.6&quot;
export jail_debian_interface=&quot;lo0&quot;
export jail_debian_rootdir=&quot;/jails/debian&quot;
export jail_debian_mount_enable=&quot;YES&quot;
export jail_debian_devfs_enable=&quot;YES&quot;
export jail_debian_devfs_ruleset=&quot;devfsrules_jail&quot;
export jail_debian_fdescfs_enable=&quot;YES&quot;
export jail_debian_exec_start=&quot;/etc/init.d/rc 3&quot;
export jail_debian_flags=&quot;-l -u root&quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;I also tried adding an IPv6 address to the jail, and that seems to work OK&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So you can now stop/start with jail with&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;service ezjail.sh stop debian
service ezjail.sh start debian&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Connect to the jail console&lt;/h2&gt;
&lt;p&gt;If you create a symlink for &lt;code&gt;login&lt;/code&gt; (so that from the jail&#039;s POV there&#039;s a &lt;code&gt;/usr/bin/login&lt;/code&gt;, like there would be on a FreeBSD jail)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd /jails/debian/usr/bin/
ln -s ../../bin/login .&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;then you can use the &lt;code&gt;ezjail-admin&lt;/code&gt; command to get a console in the jail, with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ezjail-admin console debian&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Otherwise, I&#039;ve been using my own script to get a console (which assumes &lt;code&gt;bash&lt;/code&gt; is installed in the jail), named &lt;code&gt;/usr/local/sbin/jlogin&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/bin/sh
#
# log into a jail, running bash
#
JID=`jls | grep &quot; $1 &quot; | awk &#039;{print $1}&#039;`
exec jexec $JID env -i PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin TERM=$TERM EDITOR=$EDITOR LANG=$LANG HOME=/root bash -l&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That runs as:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;jlogin debian&lt;/code&gt;&lt;/pre&gt;</content>
</entry>
</feed>