i have installed ubuntu jammy using the linuxulator with the steps below
but the issue is i cant switch to a non root user because everything like /bin/bash has 700 permissions
so i cant use su to switch to another user using
also i cant create another user to switch to that account
the reason i want to run as a non root user is because im trying to get Davinci Resolve installed and working on wayland on freebsd
there is a script called makeresolvedeb, and the script shouldnt really be run as root
the makeresolvedeb script convert the resolve run file into a deb you can install on ubuntu
also i dont want to run resolve as root on ubuntu, just seems wrong
i can build the deb as root and install resolve
but the issue is the resolve program files are install into /root/Documents/Davinci Resolve
i think thats the path,
the problem i think is you are going to have permission issues with files on the host
because obviously root is running with a different uid to the user on the host
i had a look at this video "Other userlands in the FreeBSD Linuxulator Charlie Li"
and it looks like you can switch to another user but i cant get it to work
chroot has a -u option to specify a user to run as but that didnt work
looking at the man page for debootstrap
i noticed the following
listing /compat/ubuntu
outputs
thats the output of debootstrap created with
which is using this option from debootstrap
so it looks like the 700 persmission on /bin/bash are related to the symlinks
would using the no-merged-usr let me switch to my user in the chroot using su
where djwilcox is the user on the freebsd host
or create another user to run resolve
ziomario managed to get resolve installed using makeresolvedeb,
but i think he forgot some of the steps to get the graphics card working
ill have to give him a nudge and see if he can join in the conversation here
maybe im missing something or havent got my head around the linuxulator
if there is anyone interested in getting davinci resolve working using the linuxulator on freebsd,
feel free to join and add any suggestions
another option for install resolve might be to use arch linux on the linuxulator,
because there is a davinci resolve package on the arch linux aur which would mean you dont have to use the makeresolvedeb script
there are 2 pacman package in the freebsd repo
which are mention in the video above
pacman output
note sure what the difference between the 2 pacman versions are
heres my notes so far,
im making progress i just need a gentle nudge in the right direction
github.com
linuxulator set up
fstab
ubuntu rc.d script
create mountpoint
enable ubuntu
start ubuntu
debootstrap
chroot into ubuntu
bash permissions
output
as you can see only bash has 700 permissions so only root is permitted
but the issue is i cant switch to a non root user because everything like /bin/bash has 700 permissions
so i cant use su to switch to another user using
Code:
su - djwilcox
also i cant create another user to switch to that account
the reason i want to run as a non root user is because im trying to get Davinci Resolve installed and working on wayland on freebsd
there is a script called makeresolvedeb, and the script shouldnt really be run as root
the makeresolvedeb script convert the resolve run file into a deb you can install on ubuntu
also i dont want to run resolve as root on ubuntu, just seems wrong
i can build the deb as root and install resolve
but the issue is the resolve program files are install into /root/Documents/Davinci Resolve
i think thats the path,
the problem i think is you are going to have permission issues with files on the host
because obviously root is running with a different uid to the user on the host
i had a look at this video "Other userlands in the FreeBSD Linuxulator Charlie Li"
and it looks like you can switch to another user but i cant get it to work
chroot has a -u option to specify a user to run as but that didnt work
Code:
sudo chroot -u djwilcox /compat/ubuntu /bin/bash
looking at the man page for debootstrap
Code:
man debootstrap
i noticed the following
Code:
--merged-usr
Create /{bin,sbin,lib}/ symlinks pointing to their counterparts
in /usr/. (Default for most variants.)
--no-merged-usr
Do not create /{bin,sbin,lib}/ symlinks pointing to their
counterparts in /usr/. (Default for the buildd variant.)
listing /compat/ubuntu
Code:
ls -l /compat/ubuntu
outputs
Code:
lrwxr-xr-x 1 root wheel 7 7 Feb 13:54 bin -> usr/bin
drwxr-xr-x 2 root wheel 2 18 Apr 2022 boot
dr-xr-xr-x 12 root wheel 512 7 Feb 13:51 dev
drwxr-xr-x 61 root wheel 125 7 Feb 13:54 etc
drwxr-xr-x 3 root wheel 3 5 Feb 18:57 home
lrwxr-xr-x 1 root wheel 7 7 Feb 13:54 lib -> usr/lib
lrwxr-xr-x 1 root wheel 9 7 Feb 13:53 lib32 -> usr/lib32
lrwxr-xr-x 1 root wheel 9 7 Feb 13:54 lib64 -> usr/lib64
lrwxr-xr-x 1 root wheel 10 7 Feb 13:53 libx32 -> usr/libx32
drwxr-xr-x 2 root wheel 2 7 Feb 13:53 media
drwxr-xr-x 2 root wheel 2 7 Feb 13:53 mnt
drwxr-xr-x 2 root wheel 2 7 Feb 13:53 opt
drwxr-xr-x 2 root wheel 2 7 Feb 13:51 proc
drwx------ 2 root wheel 6 7 Feb 14:09 root
drwxr-xr-x 4 root wheel 4 7 Feb 13:54 run
lrwxr-xr-x 1 root wheel 8 7 Feb 13:54 sbin -> usr/sbin
drwxr-xr-x 2 root wheel 2 7 Feb 13:53 srv
dr-xr-xr-x 1 root wheel 0 7 Feb 15:10 sys
drwxrwxrwt 12 root wheel 15 7 Feb 15:10 tmp
drwxr-xr-x 14 root wheel 14 7 Feb 13:53 usr
drwxr-xr-x 11 root wheel 13 7 Feb 13:53 var
[
thats the output of debootstrap created with
Code:
sudo debootstrap --arch=amd64 --no-check-gpg jammy /compat/ubuntu
which is using this option from debootstrap
Code:
--merged-usr
Create /{bin,sbin,lib}/ symlinks pointing to their counterparts
in /usr/. (Default for most variants.)
so it looks like the 700 persmission on /bin/bash are related to the symlinks
would using the no-merged-usr let me switch to my user in the chroot using su
Code:
su - djwilcox
where djwilcox is the user on the freebsd host
or create another user to run resolve
Code:
sudo debootstrap --no-merged-usr --arch=amd64 --no-check-gpg jammy /compat/ubuntu
ziomario managed to get resolve installed using makeresolvedeb,
but i think he forgot some of the steps to get the graphics card working
ill have to give him a nudge and see if he can join in the conversation here
maybe im missing something or havent got my head around the linuxulator
if there is anyone interested in getting davinci resolve working using the linuxulator on freebsd,
feel free to join and add any suggestions
another option for install resolve might be to use arch linux on the linuxulator,
because there is a davinci resolve package on the arch linux aur which would mean you dont have to use the makeresolvedeb script
there are 2 pacman package in the freebsd repo
which are mention in the video above
Code:
pkg search pacman
pacman output
Code:
archlinux-pacman-6.0.2 Package manager from Arch Linux
pacman-6.0.2 Package manager from Arch Linux
note sure what the difference between the 2 pacman versions are
heres my notes so far,
im making progress i just need a gentle nudge in the right direction
cerberus/freebsd/linuxlator-ubuntu.org at master · NapoleonWils0n/cerberus
cerberus code library. Contribute to NapoleonWils0n/cerberus development by creating an account on GitHub.
linuxulator set up
fstab
Code:
# Device Mountpoint FStype Options Dump Pass#
devfs /compat/ubuntu/dev devfs 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
linprocfs /compat/ubuntu/proc linprocfs rw,late 0 0
linsysfs /compat/ubuntu/sys linsysfs rw,late 0 0
/tmp /compat/ubuntu/tmp nullfs rw,late 0 0
/home /compat/ubuntu/home nullfs rw,late 0 0
ubuntu rc.d script
Code:
#!/bin/sh
#
# PROVIDE: ubuntu
# REQUIRE: archdep mountlate
# KEYWORD: nojail
#
# This 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"
create mountpoint
Code:
sudo mkdir -p {/compat/ubuntu/dev/fd,/compat/ubuntu/dev/shm,/compat/ubuntu/home,/compat/ubuntu/tmp,/compat/ubuntu/proc,/compat/ubuntu/sys}
enable ubuntu
Code:
sudo sysrc ubuntu_enable="YES"
start ubuntu
Code:
sudo service ubuntu start
debootstrap
Code:
sudo debootstrap --arch=amd64 --no-check-gpg jammy /compat/ubuntu
chroot into ubuntu
Code:
sudo chroot /compat/ubuntu /bin/bash
bash permissions
Code:
ls -l /bin/bash
output
Code:
-rwx------+ 1 root root 1396520 Jan 6 2022 /bin/bash
as you can see only bash has 700 permissions so only root is permitted