Jail: debian

one time
# kldload linux64 # enabled in /etc/rc.conf
pkg install -y debootstrap

create jail
export JAIL=debian
export JAILHOSTNAME=debian
export JAILDOMAIN=ahlawat.com
export JAILIP=65

iocage create -n "$JAIL" -e exec_start="/bin/true" exec_stop="/bin/true" exec_prestart="ifconfig tap65 create; ifconfig bridge1 addm tap65 up; ifconfig tap65 up; ifconfig tap65 inet6 auto_linklocal" interfaces="tap65:bridge1" ip4_addr="tap65|192.168.0.$JAILIP/24" defaultrouter="192.168.0.5" ip6_addr="tap65|2603:3024:3f6:e1::$JAILIP/64" defaultrouter6="2603:3024:3f6:e1::5" resolver="nameserver 192.168.0.5;nameserver 2603:3024:3f6:e1::5;search $JAILDOMAIN" allow_raw_sockets=1 boot=on host_hostname="$JAILHOSTNAME.$JAILDOMAIN"

debootstrap --arch=amd64 --no-check-gpg focal /mnt/iocage/jails/$JAIL/root/
echo "APT::Cache-Start 251658240;" > /mnt/iocage/jails/$JAIL/root/etc/apt/apt.conf.d/00aptitude

iocage fstab -e $JAIL

devfs           /mnt/iocage/jails/debian/root/dev      devfs           rw                      0       0
tmpfs           /mnt/iocage/jails/debian/root/dev/shm  tmpfs           rw,size=1g,mode=1777    0       0
fdescfs         /mnt/iocage/jails/debian/root/dev/fd   fdescfs         rw,linrdlnk             0       0
linprocfs       /mnt/iocage/jails/debian/root/proc     linprocfs       rw                      0       0
linsysfs        /mnt/iocage/jails/debian/root/sys      linsysfs        rw                      0       0
/tmp            /mnt/iocage/jails/debian/root/tmp      nullfs          rw                      0       0
/home           /mnt/iocage/jails/debian/root/home     nullfs          rw                      0       0

iocage fstab -l $JAIL

iocage start $JAIL

iocage console $JAIL

apt update
dpkg-reconfigure tzdata
apt install language-pack-en nano openssh-server
service ssh start
passwd # for su access
adduser ahlawat
exit

iocage set exec_start="service ssh start" debian

Notes:

ssh ahlawat@debian

ahlawat@debian:~$ uname -a
Linux debian.ahlawat.com 3.2.0 FreeBSD 12.2-RELEASE-p3 r369225 diyIT x86_64 x86_64 x86_64 GNU/Linux
ahlawat@debian:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"
ahlawat@debian:~$


https://wiki.freebsd.org/Linuxulator
# netstat commands wont work in this jail but apt/ping work
# top gives incorrect memory usage
# ping6 doesn't work, though you can ssh to jail over ipv6
# with dual stack you need to "ping -4 google.com" otherwise ping tries do an ipv6 nslookup and aborts


Showcased here is a capital and operational cost effective approach, using minimal server and networking hardware with multiple virtualized applications for Home and Business. This solution template can be easily scaled out and adapted for larger Enterprise deployments.
drop by the diyIT Matrix public room at #diyit:matrix.ahlawat.com
if you have any IT questions/feedback or to request pro bono consulting for a nonprofit

message me privately at @sharad:matrix.ahlawat.com
or email me at - sharad@ahlawat.com - pgpkey: 68DD6B89
Networking and Security Technologist.
EngineerĀ andĀ an avid Programmer.

https://sharad.ahlawat.com
strive to learn and pass on the knowledge to the next generation
one day humanity will understand the meaning of life and hopefully it will be more than ASCII 42 = "*" regex for whatever you want it to be,
and destiny is more than just a roll of a pair of dice with 42 dots (Lets nail down Quantum Entanglement)

May you Live Long (Intelligently) and Prosper and work on technology that matters.
© 2024 Sharad Ahlawat

No personal identifying data is collected or any form of analytics/metrics reported to a third-party by this website.