jails Ubuntu chroot not working

I tried to set ubuntu as the default linux chroot after changing the settings in /etc/rc.conf

Code:
...
#linux_enable="YES" (yes this is commented out)
ubuntu_enable="YES"
...

and setting
compat.linux.emul_path: /compat/ubuntu

The output of
Code:
kldstat | grep linux
16    2 0xffffffff83501000     be88 linux_common.ko
25    2 0xffffffff8373a000     5220 linuxkpi_gplv2.ko

But trying to chroot into ubuntu doesn't work
Code:
sudo chroot /compat/ubuntu /bin/bash
Password:
ELF binary type "0" not known.
ELF binary type "0" not known.
chroot: /bin/bash: Exec format error

What is wrong and how do I fix it to make ubuntu the default linux emulator?
 
Maybe you should actually load the linux(4) kernel module?
Doesn't ubuntu_enable="YES" offer the same functionality? I was under the impression (perhaps mistaken) that it's purpose was to use ubuntu as base linuxator by enabling it and changing emul_path
 
Don't know where you got that from but that is not a normal service.
 
Don't know where you got that from but that is not a normal service.
Thanks - this worked - although it doesn't solve the issue I was trying to solve with trying to install a ubuntu compatible software here https://forums.freebsd.org/threads/...ng-despite-linux-compatibility-enabled.89846/

EDIT : SirDice actually it's from this link about compat
Some notes before starting it. You need to choose which LINUX_COMPAT are you using on FreeBSD. You can not use both the default CentOS based layer under /compat/linux and another one with Ubuntu based layer under /compat/ubuntu for example. To use the Ubuntu based layer the script will set the compat.linux.emul_path variable to /compat/ubuntu dir. Also under the /etc/rc.conf variable linux_enable=YES will be replaced by ubuntu_enable=YES one.
 
Bump: How does one get ubuntu compatible binaries to be installed?

After setting /etc/rc.cof
Code:
#linux_enable="YES" (yes this is commented out)
ubuntu_enable="YES"
and setting compat.linux.emul_path: /compat/ubuntu
and getting my linux binaries
kldstat | grep linux
16 4 0xffffffff83501000 be88 linux_common.ko
25 2 0xffffffff8373a000 5220 linuxkpi_gplv2.ko
41 1 0xffffffff837a7000 31a80 linux.ko
42 1 0xffffffff837d9000 2dca0 linux64.ko


I can log into chroot now using
Code:
sudo chroot /compat/ubuntu /bin/bash
However, I can't seem to install ubuntu compatible binaries (after changing base from linux to ubuntu) onto the system as expected.

Anyone knows what's wrong?
 
Maybe you can try this.
Hey! thanks - not sure I want to install browsers - but it seems like I have most of the settings properly set (ubuntu_enable, emul_path) ... or do you reckon I'm missing something?
You have actually installed Ubuntu using sysutils/debootstrap, right?
I think so ... it's been a while ... is there a way to double check?

PS : fwiw when doing
Bash:
ls -al /compat/linux
it shows certain directories translating to others (using "->" symbol to point to libraries,etc) , however when doing
Bash:
ls -al /compat/ubuntu
it doesn't show the translations ... wonder if that's indicative of something not right? 🤔
 
Back
Top