February 19, 2026 · Engineering
BSDulator Phase 3: VNET Networking is Live
Phase 3 of BSDulator development is complete. The headline feature: virtual network isolation using Linux network namespaces to emulate FreeBSD's VNET functionality.
How VNET Works in Lochs
When you create a jail with the vnet parameter, BSDulator:
- Creates a Linux network namespace (
/var/run/netns/bsdjail_<jid>) - Creates a veth pair —
veth0_j<jid>on the host,eth0inside the jail's namespace - Attaches the host end to a bridge interface (
bsdjail0at10.0.0.1/24) - Assigns the requested IP to
eth0inside the jail namespace - Sets up a default route through the bridge gateway
Host System +-------------------------------------------------+ | bsdjail0 (bridge) - 10.0.0.1/24 | | | | | +-- veth0_j1 <--> eth0 (jail1 netns) | | | 10.0.0.10/24 | | | | | +-- veth0_j2 <--> eth0 (jail2 netns) | | 10.0.0.20/24 | +-------------------------------------------------+
What We Verified
Full host-to-jail connectivity: ping 10.0.0.10 from the host reaches the jail. Full jail-to-jail connectivity: ip netns exec bsdjail_1 ping 10.0.0.20 works. Cleanup on jail removal properly tears down the veth pair, removes the namespace, and detaches from the bridge.
Also in Phase 3
- IP address assignment:
ip4.addrparameter parsing injail_set()with support for multiple comma-separated IPs - Enhanced jls: Verbose output with
cpuset.id, proper IP display - Enhanced jexec:
-llogin shell flag,-U/-uuser flags (parsed, credential handling viacredsyncsyscall 596) - FreeBSD 15 syscalls:
__realpathat(574, stub) andcredsync(596, emulated) - Compatibility checker:
scripts/check_compat.shverifies kernel version, namespace support, ptrace availability, required commands, and networking setup
Usage
# Create jail with virtual network
sudo ./bsdulator ./freebsd-root/libexec/ld-elf.so.1 \
./freebsd-root/usr/sbin/jail \
-c name=myjail path=./freebsd-root ip4.addr=10.0.0.10 vnet persist
# Verify connectivity
ping 10.0.0.10
# List jails
sudo ./bsdulator ./freebsd-root/libexec/ld-elf.so.1 \
./freebsd-root/usr/sbin/jls -v
# Execute in jail
sudo ./bsdulator ./freebsd-root/libexec/ld-elf.so.1 \
./freebsd-root/usr/sbin/jexec 1 /bin/sh
# Clean removal
sudo ./bsdulator ./freebsd-root/libexec/ld-elf.so.1 \
./freebsd-root/usr/sbin/jail -r 1