Trying to install Ubuntu 22.04 Jammy following the instructions at https://wiki.freebsd.org/LinuxJails and https://www.micski.dk/2021/12/21/install-ubuntu-base-system-into-freebsds-linux-binary-compatibility/.
I have these lines in /boot/loader.conf:
This line in /etc/rc.conf:
Note, I don't have linux_enable="YES" in /etc/rc.conf because it would cause ampgpu not load.
There are these lines in /etc/fstab:
I have /usr/local/etc/rc.d/ubuntu, access mode 755:
When I try to run # service ubuntu start
Reboot the system doesn't help anything.
I go ahead continue the steps
It was successful. But the ubuntu is not usable because the service doesn't start.
I have these lines in /boot/loader.conf:
Code:
linux_load=”YES”
linux64_load=”YES”
fdescfs_load="YES"
linprocfs_load="YES"
tmpfs_load="YES"
linsysfs_load="YES"
Code:
ubuntu_enable=”YES”
There are these lines in /etc/fstab:
Code:
devfs /compat/ubuntu/dev devfs rw,late 0 0
linprocfs /compat/ubuntu/proc linprocfs rw,late 0 0
linsysfs /compat/ubuntu/sys linsysfs rw,late 0 0
tmpfs /compat/ubuntu/dev/shm tmpfs rw,late,size=1g,mode=1777 0 0
fdescfs /compat/ubuntu/dev/fd fdescfs rw,late,linrdlnk 0 0
/tmp /compat/ubuntu/tmp nullfs rw,late 0 0
/home /compat/ubuntu/home nullfs rw,late 0 0
Code:
#!/bin/sh
#
# PROVIDE: ubuntu
# REQUIRE: archdep mountlate
# KEYWORD: nojail
#
# This file is a modified version of /etc/rc.d/linux
# Based on the script by mrclksr:
# https://github.com/mrclksr/linux-browser-installer/blob/main/rc.d/ubuntu.in
#
. /etc/rc.subr
name="ubuntu"
desc="Enable Ubuntu chroot, and Linux ABI"
rcvar="ubuntu_enable"
start_cmd="${name}_start"
stop_cmd=":"
unmounted()
{
[ `stat -f "%d" "$1"` == `stat -f "%d" "$1/.."` -a \
`stat -f "%i" "$1"` != `stat -f "%i" "$1/.."` ]
}
ubuntu_start()
{
local _emul_path _tmpdir
load_kld -e 'linux(aout|elf)' linux
case `sysctl -n hw.machine_arch` in
amd64)
load_kld -e 'linux64elf' linux64
;;
esac
if [ -x /compat/ubuntu/sbin/ldconfigDisabled ]; then
_tmpdir=`mktemp -d -t linux-ldconfig`
/compat/ubuntu/sbin/ldconfig -C ${_tmpdir}/ld.so.cache
if ! cmp -s ${_tmpdir}/ld.so.cache /compat/ubuntu/etc/ld.so.cache; then
cat ${_tmpdir}/ld.so.cache > /compat/ubuntu/etc/ld.so.cache
fi
rm -rf ${_tmpdir}
fi
# Linux uses the pre-pts(4) tty naming scheme.
load_kld pty
# Handle unbranded ELF executables by defaulting to ELFOSABI_LINUX.
if [ `sysctl -ni kern.elf64.fallback_brand` -eq "-1" ]; then
sysctl kern.elf64.fallback_brand=3 > /dev/null
fi
if [ `sysctl -ni kern.elf32.fallback_brand` -eq "-1" ]; then
sysctl kern.elf32.fallback_brand=3 > /dev/null
fi
sysctl compat.linux.emul_path=/compat/ubuntu
_emul_path="/compat/ubuntu"
unmounted "${_emul_path}/dev" && (mount -o nocover -t devfs devfs "${_emul_path}/dev" || exit 1)
unmounted "${_emul_path}/dev/fd" && (mount -o nocover,linrdlnk -t fdescfs fdescfs "${_emul_path}/dev/fd" || exit 1)
unmounted "${_emul_path}/dev/shm" && (mount -o nocover,mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm" || exit 1)
unmounted "${_emul_path}/home" && (mount -t nullfs /home "${_emul_path}/home" || exit 1)
unmounted "${_emul_path}/proc" && (mount -o nocover -t linprocfs linprocfs "${_emul_path}/proc" || exit 1)
unmounted "${_emul_path}/sys" && (mount -o nocover -t linsysfs linsysfs "${_emul_path}/sys" || exit 1)
unmounted "${_emul_path}/tmp" && (mount -t nullfs /tmp "${_emul_path}/tmp" || exit 1)
unmounted /dev/fd && (mount -o nocover -t fdescfs fdescfs /dev/fd || exit 1)
unmounted /proc && (mount -o nocover -t procfs procfs /proc || exit 1)
true
}
load_rc_config $name
run_rc_command "$1"
When I try to run # service ubuntu start
Code:
# service ubuntu start
env: /usr/local/etc/rc.d/ubuntu: No such file or directory
I go ahead continue the steps
Code:
# pkg install debootstrap
# debootstrap --arch=amd64 --no-check-gpg jammy /compat/ubuntu
# cd /compat/ubuntu/lib64/
# rm ./ld-linux-x86-64.so.2
# ln -s ../lib/x86_64-linux-gnu/ld-2.31.so ld-linux-x86-64.so.2
It was successful. But the ubuntu is not usable because the service doesn't start.