Is it possible to run Linux devuan on freebsd headless (chroot / vm)?

Hello,

I have a AMD Ryzen 8 core, with good power. However I would like to run linux on it, on a chroot base rootfs.
Meaning using the classic base, without adding more crap. chroot is king.

Is it possible ?

best regards
 
You might be able to get something "devuan like" going in a linux jail; however, this will not be linux - it will be running on FreeBSD's linux emulation layer.
see https://wiki.freebsd.org/LinuxJails

If you don't mind an "opaque" disk image, you could use bhyve() to get an actual vm going. There's a bunch of helper tools to set this up, if you don't want to do it on your own - sysutils/vm-bhyve for example. It'll run headless, but you'll be able to use vnc to connect to its console.
 
you mean the kernel freebsd is running on rootfs, of Linux. It is compatible in terms of binary?
kernel freebsd with a rootfs linux?
 
What is this Linux jail? Is this actually a FreeBSD jail running Linux?
The terminology is not consistent here. In general, a so-called “Linux-Jail” on FreeBSD is not an actual jail – which would mean something using the well-known FreeBSD jail infrastructure, e.g. jls, jexec, etc. – but rather a chroot-environment in /compat/linux.

However, turning /compat/linux into a genuin jail is easily possible.
 
which would mean something using the well-known FreeBSD jail infrastructure,
 
The terminology is not consistent here. In general, a so-called “Linux-Jail” on FreeBSD is not an actual jail – which would mean something using the well-known FreeBSD jail infrastructure, e.g. jls, jexec, etc. – but rather a chroot-environment in /compat/linux.

However, turning /compat/linux into a genuin jail is easily possible.
Actually, I believe you get pretty close to a full jail - if you replace some of the network related binaries, you can even get your own vnet:

I've used this with great success in the past. It starts like a regular jail, you use jexec to run linux binaries on demand. You seem to get jail-based process separation just like with a FreeBSD jail.
Then again, maybe someone with a bit more insight into the source code wants to chime in on whether all jail related boundaries are actually properly working in this context?
 
Hi

I did get the amd64 rootfs of devuan. Is the error due to amd64/ i686 incompatibility?
Code:
root@bsd:/ramdisk2/ROOTFS # chroot .
chroot: /bin/csh: Exec format error
root@bsd:/ramdisk2/ROOTFS # uname -a

root@bsd:/ramdisk2/ROOTFS # uname -a
FreeBSD bsd 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:04:45 UTC 2021     [email]root@releng1.nyi.freebsd.org[/email]:/usr/obj/usr/src/i386.i386/sys/GENERIC  i386
 
Don't try to to run 64 bit code on an 32 bit OS, that's not possible. You can run 32 bit code on a 64 bit OS though. Why are you running a 32 bit OS on a CPU that's capable of running 64 bit?

And keep in mind that 13.0-RELEASE is end-of-life and not supported anymore.
 
I just tried DEVUAN 686 ... so x86 but error is still same:
Code:
root@bsd:/ramdisk2/ROOTFS # chroot .
ELF binary type "0" not known.
ELF binary type "0" not known.
chroot: /bin/csh: Exec format error
 
chroot: /bin/csh: Exec format error
This might be caused by a common mistake: you won't have csh in your chroot shell. You need to specify an alternative (linux) shell. You will also need to make sure, that linux compatibility is available (relevant kernel modules need to be loaded):
Code:
service linux onestart
chroot /path/to/jail /bin/bash
 
Back
Top