jails Setting up a (Devuan) Linux jail on FreeBSD : if fails to connect to the network inside the jail

Hello.

I'm trying to configure a Devuan Linux jail on FreeBSD,following tnis tutorial :

https://forums.freebsd.org/threads/setting-up-a-debian-linux-jail-on-freebsd.68434/

what I did right now is explained in the summing up section :

4 - Summing up
  • Set up Linux compatibility. Usually you only have to add: linux_enable="YES"
    to /etc/rc.conf.
  • Optionally set up a dedicated section for your jail. When using ZFS then creating a new dedicated filesystem is definitely a good idea.
  • Install sysutils/debootstrap.
  • Bootstrap your system: # debootstrap --foreign --arch=amd64 stable /path/to/jail http://deb.devuan.org/merged/
    • Obviously replace amd64 for i386 on 32bit machines!
  • Mount linux file systems, for best results add these to a dedicated "jail fstab" like /etc/fstab.devuan.
    • mount -t linprocfs none /path/to/jail/proc
    • mount -t linsysfs none /path/to/jail/sys
    • mount -t tmpfs none /path/to/jail/tmp
  • Enter your new system to finish up:
    • chroot /path/to/jail /bin/bash
    • dpkg --force-depends -i /var/cache/apt/archives/*.deb
    • dpkg --configure --pending
  • Make sure that only base-files and sysvinit-core are partially configured: # dpkg -l | grep -v ^ii
    .
    • Their status should be iF.
    • If there is a problem try to forcefully reinstall the package: # dpkg --force-all -i /path/to/package
      .
  • Check that everything works by installing a package: # apt-get install man-db
    .
  • Set up your jail by adding the following to /etc/jail.conf:

Code:
devuan {
host.hostname = "devuan.jail";
interface = lo0;
ip4.addr = 127.0.0.5;
path = /path/to/jail;
exec.start = "/etc/init.d/rc 3";
exec.stop = "/etc/init.d/rc 0";
persist;

mount.devfs;
mount.fstab = /etc/fstab.devuan;

allow.mount;
allow.mount.devfs;
}



  • Start your new jail using: # jail -c devuan
    .
  • Access the console using # jexec devuan /bin/bash
    .

Unfortunately I'm not connected on the network inside the devuan jail and I don't understand why :

Code:
mario@marietto:/usr/home/marietto # jail -c devuan

devuan: created
Using makefile-style concurrent boot in runlevel 3.
dmesg: read kernel buffer failed: Operation not permitted
Starting enhanced syslogd: rsyslogdmknod: /dev/xconsole: Operation not supported
chown: cannot access '/dev/xconsole': No such file or directory
rsyslogd: cannot create '/dev/log': Operation not supported [v8.2102.0 try https://www.rsyslog.com/e/2176 ]
rsyslogd: imuxsock does not run because we could not aquire any socket  [v8.2102.0]
rsyslogd: activation of module imuxsock failed [v8.2102.0]
rsyslogd: imklog: cannot open kernel log (/proc/kmsg): No such file or directory.
rsyslogd: activation of module imklog failed [v8.2102.0 try https://www.rsyslog.com/e/2145 ]
.
Starting periodic command scheduler: cron.

mario@marietto:/usr/home/marietto # jexec devuan /bin/bash

mario@devuan:/# apt update

Err:1 http://deb.devuan.org/merged chimaera InRelease
Temporary failure resolving 'deb.devuan.org'
Err:2 http://deb.devuan.org/merged chimaera-updates InRelease
Temporary failure resolving 'deb.devuan.org'
Err:3 http://deb.devuan.org/merged chimaera-security InRelease
Temporary failure resolving 'deb.devuan.org'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://deb.devuan.org/merged/dists/chimaera/InRelease  Temporary failure resolving 'deb.devuan
.org'
W: Failed to fetch http://deb.devuan.org/merged/dists/chimaera-updates/InRelease  Temporary failure resolving 'de
b.devuan.org'
W: Failed to fetch http://deb.devuan.org/merged/dists/chimaera-security/InRelease  Temporary failure resolving 'd
eb.devuan.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

this is not a problem of wrong resolv.conf file,because I've fixed it with this :

Code:
# Generated by resolvconf
search homenet.telecomitalia.it
nameserver 192.168.1.1
#nameserver 127.0.0.1
options edns0

I have also tried to change these parameters :

Code:
interface = lo0;
ip4.addr = 127.0.0.5;

with these :

Code:
interface = em0;
ip4.addr = 192.168.1.7;

inside the file /etc/jail.conf,but still does not work.


my network interfaces are configured like you can see below on FreeBSD :


Code:
mario@marietto:/usr/home/marietto # ifconfig

em0: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=4810099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
ether e0:d5:5e:e2:1f:22
inet 192.168.1.6 netmask 0xffffff00 broadcast 192.168.1.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
inet 127.0.0.5 netmask 0xffffffff
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 58:9c:fc:10:ff:b7
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: epair1a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 8 priority 128 path cost 2000
member: tap3 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 7 priority 128 path cost 2000000
member: tap2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 6 priority 128 path cost 2000000
member: tap1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 5 priority 128 path cost 2000000
member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 4 priority 128 path cost 2000000
member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 1 priority 128 path cost 2000000
groups: bridge
nd6 options=9<PERFORMNUD,IFDISABLED>

tap0: flags=8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 58:9c:fc:10:ff:8e
groups: tap
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

tap1: flags=8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 58:9c:fc:10:ff:e9
groups: tap
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

tap2: flags=8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 58:9c:fc:10:ff:d7
groups: tap
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>


tap3: flags=8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 58:9c:fc:10:ff:c7
groups: tap
media: Ethernet autoselect
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

epair1a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: buster-eth0
options=8<VLAN_MTU>
ether 02:df:bb:23:7e:0a
inet 192.168.2.2 netmask 0xffffff00 broadcast 192.168.2.255
groups: epair
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
 
Last edited:
solution :

/etc/jail.conf

Code:
devuan {
host.hostname = "devuan.jail";
interface = tap0;
ip4.addr = 192.168.1.7;
path = /opt/jails/devuan;
exec.start = "/etc/init.d/rc 3";
exec.stop = "/etc/init.d/rc 0";
persist;

mount.devfs;
mount.fstab = /etc/fstab.devuan;

allow.mount;
allow.mount.devfs;
}

and inside the jail :

/etc/resolv.conf

Code:
# Generated by resolvconf
search homenet.telecomitalia.it
nameserver 192.168.1.1

#nameserver 127.0.0.1
options edns0
 
This is the latest error to fix :

Code:
Preconfiguring packages ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "it",
LC_ALL = (unset),
LANG = "it_IT.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
 
This is a Linux problem, isn't it? Why didn't you show the command you typed?

Anyway, try locale-gen it_IT.UTF-8.


Btw.:
 
Thanks. it worked. Anyway,I'm wondering if I can have a graphical desktop manager within the jail with devuan. Is this off topic,taking in consideration that here there are some components that are related to FreeBSD only,like the jails,the linuxulator ? When some time ago,has been created the tutorial about how to configure the devuan jail it wasn't intended as off-topic,right ? It seems to me that it is a cross topic (50% FreeBSD + 50% Linux)...
 
Last edited:
Back
Top