Solved linuxulator switching to non root user in the chroot to run davinci resolve

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

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



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
 
Oh, and stop messing with the compat.linux.emul_path setting. That breaks at least my ports and it's mostly meaningless for chroots.
 
the compat.linux.emul_path is not my code or something i used

i just copied this forum post to the top of my notes for reference


sorry for any confusion,
my notes are a work in progress
 
i have set security.bsd.unprivileged_chroot=1 in my /etc/sysctl.conf

and also commented out the other security settings
which came from the freebsd installer when you lock down the system,
just in case one of them was an issue

/etc/sysctl.conf

Code:
# are being run under another UID.
#security.bsd.see_other_uids=0
#security.bsd.see_other_uids=0
#security.bsd.see_other_gids=0
#security.bsd.see_jail_proc=0
#security.bsd.unprivileged_read_msgbuf=0
#security.bsd.unprivileged_proc_debug=0
# chroot
security.bsd.unprivileged_chroot=1

i then created a new ubuntu install with

Code:
sudo debootstrap --arch=amd64 --no-check-gpg jammy /compat/ubuntu

chroot with the -n option

Code:
sudo chroot -n /compat/ubuntu /bin/bash

list /bin/bash

Code:
ls -l /bin/bash

output

Code:
-rwx------+ 1 root root 1396520 Jan  6  2022 /bin/bash

same result only root has access to /bin/bash
so i cant switch to another user

i cant think i have anything else set that might be causing the issue

/etc/sysctl.conf

Code:
#
#  This file is read when going to multi-user and its contents piped thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
#

# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0
#security.bsd.see_other_uids=0
#security.bsd.see_other_gids=0
#security.bsd.see_jail_proc=0
#security.bsd.unprivileged_read_msgbuf=0
#security.bsd.unprivileged_proc_debug=0
# chroot
security.bsd.unprivileged_chroot=1
kern.randompid=1
vfs.zfs.min_auto_ashift=12
# disable bell
hw.syscons.bell=0
# user mount drives
vfs.usermount=1
# default audio output - headphones
hw.snd.default_unit=1
# use new audio devices automatically
hw.snd.default_auto=1
# dont autoreset vol to default
hw.snd.vpc_autoreset=0
# chromium
kern.ipc.shm_allow_removed=1
# change reponsiveness from server to desktop
kern.sched.preempt_thresh=224
# screen brightness
hw.acpi.video.lcd0.economy=50
hw.acpi.video.lcd0.fullpower=100
hw.acpi.video.lcd0.brightness=100
# usb keyboard media keys
hw.usb.usbhid.enable=1
 
just wondering if its an issue with the ubuntu rc.d script
cant think what else it could be

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"
 
chroot with the -n option

Code:
sudo chroot -n /compat/ubuntu /bin/bash
The whole point of unprivileged chroot is skipping the privileged (su/sudo/doas) part. In general, when you see an unfamiliar command and/or options, the first thing you should do is read the docs on what it does.
 
The whole point of unprivileged chroot is skipping the privileged (su/sudo/doas) part. In general, when you see an unfamiliar command and/or options, the first thing you should do is read the docs on what it does.
i should have mentioned i tried without sudo

Code:
chroot -n /compat/ubuntu /bin/bash

but i get

chroot: /bin/bash: Permission denied

probably because /bin/bash in the chroot has 700 permissions

is it an fstab issue perhaps

Code:
# ubuntu
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
 
having gone through most of the possibilities
i can only think the issue is perhaps with debootstrap and ubuntu jammy

the problem is even if you create another user in the chroot you cant use it
even ls will give you permission denied errors because everything has 700 permissions
 
I was right the problem is with debootstrap and jammy having 700 permissions for /bin/bash

just installed focal and the issue isnt present

create the mountpoints

Code:
sudo mkdir -p {/compat/ubuntu/dev/fd,/compat/ubuntu/dev/shm,/compat/ubuntu/home,/compat/ubuntu/tmp,/compat/ubuntu/proc,/compat/ubuntu/sys}

debootstrap focal

Code:
sudo debootstrap --arch=amd64 --no-check-gpg focal /compat/ubuntu

list /compat/ubuntu

Code:
ls -l /compat/ubuntu

Code:
drwxr-xr-x   2 root wheel 120  8 Feb 14:32 bin
drwxr-xr-x   2 root wheel   2 15 Apr  2020 boot
drwxr-xr-x   4 root wheel   4  8 Feb 14:29 dev
drwxr-xr-x  59 root wheel 125  8 Feb 14:32 etc
drwxr-xr-x   2 root wheel   2  8 Feb 14:29 home
drwxr-xr-x  11 root wheel  11  8 Feb 14:32 lib
lrwxr-xr-x   1 root wheel   9  8 Feb 14:32 lib32 -> usr/lib32
drwxr-xr-x   2 root wheel   3  8 Feb 14:32 lib64
lrwxr-xr-x   1 root wheel  10  8 Feb 14:32 libx32 -> usr/libx32
drwxr-xr-x   2 root wheel   2  8 Feb 14:32 media
drwxr-xr-x   2 root wheel   2  8 Feb 14:32 mnt
drwxr-xr-x   2 root wheel   2  8 Feb 14:32 opt
drwxr-xr-x   2 root wheel   2  8 Feb 14:29 proc
drwx------   2 root wheel   4  8 Feb 14:32 root
drwxr-xr-x   7 root wheel   9  8 Feb 14:32 run
drwxr-xr-x   2 root wheel 103  8 Feb 14:32 sbin
drwxr-xr-x   2 root wheel   2  8 Feb 14:32 srv
drwxr-xr-x   2 root wheel   2  8 Feb 14:29 sys
drwxrwxrwt   2 root wheel   2  8 Feb 14:32 tmp
drwxr-xr-x  13 root wheel  13  8 Feb 14:32 usr
drwxr-xr-x  11 root wheel  13  8 Feb 14:32 var
[

list /compat/ubuntu/bin/bash

Code:
ls -l /compat/ubuntu/bin/bash

output

Code:
-rwxr-xr-x  1 root wheel 1183448 25 Feb  2020 /compat/ubuntu/bin/bash
 
shkhln tip

enter the chroot without using sudo by setting security.bsd.unprivileged_chroot=1

Code:
sudo sysctl security.bsd.unprivileged_chroot=1

you can then enter the chroot without sudo by running

Code:
chroot -n /compat/ubuntu /bin/bash

outputs

Code:
groups: cannot find name for group ID 1001
groups: cannot find name for group ID 47

freebsd wiki linux jails


"You will probably want to add users and groups with UIDs/GIDs matching the ones on the host system"

so thats the next step

echo user

Code:
echo "$USER"

ouputs my username

djwilcox


some things im not sure about

davinci resolve needs a home directory so it can install some program files under /home/username/Documents/Davinci Resolve
and access to the video files, so i presume you will have a home directory in the chroot
and copy the video files from the host home into the chroot home directory


1 compat.linux.emul_path setting

shkhln mentioned that it meaningless for chroots

"Oh, and stop messing with the compat.linux.emul_path setting. That breaks at least my ports and it's mostly meaningless for chroots."

i can run the ubuntu focal chroot without stopping the linux service and starting an ubuntu service

but since resolve needs a home directory,
dont we need to add a home directory in the freebsd fstab with nullfs

and stop the linux service and start and ubuntu service


2 handbook page on linux


my current fstab using /compat/linux

Code:
# Device        Mountpoint    FStype    Options        Dump    Pass#
/dev/gpt/efiboot0        /boot/efi    msdosfs    rw        2    2
/dev/nda0p3.eli        none    swap    sw        0    0
# linux
proc                            /proc           procfs  rw      0       0
linprocfs                       /compat/linux/proc    linprocfs    rw    0    0
linsysfs                        /compat/linux/sys    linsysfs    rw    0    0


fstab settings for ubuntu from the handbook with devices at the top

Code:
# Device        Mountpoint    FStype    Options        Dump    Pass#
/dev/gpt/efiboot0        /boot/efi    msdosfs    rw        2    2
/dev/nda0p3.eli        none    swap    sw        0    0
# linux
proc                            /proc           procfs  rw      0       0
# ubuntu
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

or can i just create a home inside the chroot without using the freebsd fstab
and not start an ubuntu service

making progress but keep hitting a few stumbling blocks
if anyone can give me a gentle nudge or hard kick in the right direction that would be great
 
i think the next step would be as follows

chroot into ubuntu with sudo and adduser
which will create the home directory

Code:
sudo chroot /compat/ubuntu /bin/bash

adduser

Code:
adduser djwilcox

make sure the users and groups with UIDs/GIDs matching the ones on the host system

then exit the chroot

Code:
exit

enter the chroot without sudo

Code:
chroot -n /compat/ubuntu /bin/bash

and that should this error message

Code:
groups: cannot find name for group ID 1001
groups: cannot find name for group ID 47
 
that make sense copy the entries the freebsd passwd to the ubuntu passwd
instead of using adduser

would it be enough to copy my user and pulseaudio from freebsd to ubuntu
or is there anything else needed

Code:
djwilcox:*:1001:1001:Daniel J Wilcox:/home/djwilcox:/usr/local/bin/zsh
pulse:*:563:563:PulseAudio System User:/nonexistent:/usr/sbin/nologin

also the paths to the zsh might need to changed for ubuntu


this is my freebsd /etc/passwd

Code:
root:*:0:0:Charlie &:/root:/bin/sh
toor:*:0:0:Bourne-again Superuser:/root:
daemon:*:1:1:Owner of many system processes:/root:/usr/sbin/nologin
operator:*:2:5:System &:/:/usr/sbin/nologin
bin:*:3:7:Binaries Commands and Source:/:/usr/sbin/nologin
tty:*:4:65533:Tty Sandbox:/:/usr/sbin/nologin
kmem:*:5:65533:KMem Sandbox:/:/usr/sbin/nologin
games:*:7:13:Games pseudo-user:/:/usr/sbin/nologin
news:*:8:8:News Subsystem:/:/usr/sbin/nologin
man:*:9:9:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
smmsp:*:25:25:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
mailnull:*:26:26:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
bind:*:53:53:Bind Sandbox:/:/usr/sbin/nologin
unbound:*:59:59:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
proxy:*:62:62:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
_pflogd:*:64:64:pflogd privsep user:/var/empty:/usr/sbin/nologin
_dhcp:*:65:65:dhcp programs:/var/empty:/usr/sbin/nologin
uucp:*:66:66:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico
pop:*:68:6:Post Office Owner:/nonexistent:/usr/sbin/nologin
auditdistd:*:78:77:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin
www:*:80:80:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
ntpd:*:123:123:NTP Daemon:/var/db/ntp:/usr/sbin/nologin
_ypldap:*:160:160:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin
hast:*:845:845:HAST unprivileged user:/var/empty:/usr/sbin/nologin
tests:*:977:977:Unprivileged user for tests:/nonexistent:/usr/sbin/nologin
nobody:*:65534:65534:Unprivileged user:/nonexistent:/usr/sbin/nologin
djwilcox:*:1001:1001:Daniel J Wilcox:/home/djwilcox:/usr/local/bin/zsh
messagebus:*:556:556:D-BUS Daemon User:/nonexistent:/usr/sbin/nologin
avahi:*:558:558:Avahi Daemon User:/nonexistent:/usr/sbin/nologin
cups:*:193:193:Cups Owner:/nonexistent:/usr/sbin/nologin
polkitd:*:565:565:Polkit Daemon User:/var/empty:/usr/sbin/nologin
colord:*:970:970:colord color management daemon:/nonexistent:/usr/sbin/nologin
pulse:*:563:563:PulseAudio System User:/nonexistent:/usr/sbin/nologin
_sndio:*:702:702:sndio privsep:/var/empty:/usr/sbin/nologin
cyrus:*:60:60:the cyrus mail server:/nonexistent:/usr/sbin/nologin
git_daemon:*:964:964:git daemon:/nonexistent:/usr/sbin/nologin
openvpn:*:301:301:OpenVPN pseudo-user:/nonexistent:/usr/sbin/nologin
mpd:*:137:137:MusicPD pseudo-user:/var/mpd:/usr/sbin/nologin
_dnscrypt-proxy:*:978:978:dnscrypt-proxy user:/var/empty:/usr/sbin/nologin
transmission:*:921:921:Transmission Daemon User:/usr/local/etc/transmission/home:/usr/sbin/nologin


and this the ubuntu /etc/passwd

Code:
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:103:106::/nonexistent:/usr/sbin/nologin
syslog:x:104:110::/home/syslog:/usr/sbin/nologin
_apt:x:105:65534::/nonexistent:/usr/sbin/nologin
 
Shell paths in /etc/passwd are used on login, probably by sudo and I think some jail utilities. In other words: no, it doesn't matter what is there.
 
cheers i have copied my user from the freebsd passwd file to the ubuntu passwd file
and copied the groups from freebsd to ubuntu

and now i dont get the errors about missing id and group
that also create a home directory in the chroot matching my username

im just installing the dependencies for resolve including nvidia drivers and cuda
which is going to take about half an hour

then i run the makeresolvedeb script to create a deb installer for resolve
and that takes about an hour

im writing down all the steps needed as i go
 
i guess you will have to copy the video files from the freebsd host into the home directory in the chroot

the reason why thats a bit of a pain is because the free version of resolve doesnt support h264
so you need to convert the footage from h264 to prores which increase the file size 10 times

so 1gig of h264 becomes 10gig of prores footage
which means copying gigs and gigs of footage in and out of the chroots home

unless im mistaken because its a chroot it cant access your home directory
or am i missing a trick
 
do you mean a nullfs mount in the freebsd fstab

/etc/fstab

Code:
/home           /compat/ubuntu/home     nullfs          rw,late                      0       0

or is it set in the chroots fstab

sorry if im being dense
 
getting this error after trying to install some packages

looks like i need to set the locale
ffs :)

Code:
Error: /dev/null:1: The key "/usr/bin/aspell" is unknown.

Processing triggers for dictionaries-common (1.28.1) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
aspell-autobuildhash: processing: en [en-common].
Error: /dev/null:1: The key "/usr/bin/aspell" is unknown.
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
P
 
running locale in the ubuntu chroot

Code:
locale

outputs

Code:
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

which i what i have set on the freebsd host

in the ubuntu chroot i edited /etc/default/locale

Code:
vi /etc/default/locale

and added the code above

then ran locale-gen

Code:
locale-gen

when i try and install these packages

Code:
apt install nvidia-driver-535 nvidia-cuda-toolkit ocl-icd-opencl-dev libglu1-mesa libfuse2 initramfs-tools

i get more errors

Code:
root@pollux:/# apt install nvidia-driver-535 nvidia-cuda-toolkit ocl-icd-opencl-dev libglu1-mesa libfuse2 initramfs-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
libfuse2 is already the newest version (2.9.9-3).
libglu1-mesa is already the newest version (9.0.1-1build1).
ocl-icd-opencl-dev is already the newest version (2.2.11-1ubuntu1).
nvidia-cuda-toolkit is already the newest version (10.1.243-3).
initramfs-tools is already the newest version (0.136ubuntu6.7).
nvidia-driver-535 is already the newest version (535.154.05-0ubuntu0.20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
9 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_COLLATE = "C",
        LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)
Setting up nvidia-dkms-535 (535.154.05-0ubuntu0.20.04.1) ...
update-initramfs: deferring update (trigger activated)
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Removing old nvidia-535.154.05 DKMS files...
/usr/sbin/dkms: line 242: /dev/fd/62: No such file or directory
grep: /proc/cpuinfo: No such file or directory

------------------------------
Deleting module version: 535.154.05
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-535.154.05 DKMS files...
grep: /proc/cpuinfo: No such file or directory
It is likely that 5.15.0 belongs to a chroot's host
Building for 5.4.0-171-generic
Building for architecture x86_64
/usr/sbin/dkms: line 2102: /dev/fd/62: No such file or directory
/usr/sbin/dkms: line 2033: /dev/fd/62: No such file or directory
dpkg: error processing package nvidia-dkms-535 (--configure):
 installed nvidia-dkms-535 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of nvidia-driver-535:
 nvidia-driver-535 depends on nvidia-dkms-535 (<= 535.154.05-1); however:
  Package nvidia-dkms-535 is not configured yet.
 nvidia-driver-535 depends on nvidia-dkms-535 (>= 535.154.05); however:
  Package nvidia-dkms-535 is not configured yet.

dpkg: error processing package nvidia-driver-535 (--configure):
 dependency problems - leaving unconfigured
Setting up libfprint-2-2:amd64 (1:1.90.2+tod1-0ubuntu1~20.04.10) ...
/bin/df: cannot read table of mounted file systems: No such file or directory
No apport report written because the error message indicates its a followup error from a previous failure.
Failed to scan devices: No such file or directory
dpkg: error processing package libfprint-2-2:amd64 (--configure):
 installed libfprint-2-2:amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of fprintd:
 fprintd depends on libfprint-2-2 (>= 1:1.90.1); however:
  Package libfprint-2-2:amd64 is not configured yet.

dpkg: error processing package fprintd (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpam-fprintd:amd64:
 libpam-fprintd:amd64 depends on fprintd (= 1.90.9-1~ubuntu20.04.1); however:
  Package fprintd is not configured yet.

dpkg: error processing package libpam-fprintd:amd64 (--configure):
 dependency problems - leaving unconfigured
Setting up openjdk-8-jre-headless:amd64 (8u392-ga-1~20.04) ...
/bin/df: cannot read table of mounted file systems: No such file or directory
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
the java command requires a mounted proc fs (/proc).
dpkg: error processing package openjdk-8-jre-headless:amd64 (--configure):
 installed openjdk-8-jre-headless:amd64 package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of ca-certificates-java:
 ca-certificates-java depends on default-jre-headless | java8-runtime-headless; however:
  Package default-jre-headless is not installed.
  Package java8-runtime-headless is not installed.
  Package openjdk-8-jre-headless:amd64 which provides java8-runtime-headless is not configured yet.

dpkg: error processing package ca-certificates-java (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of openjdk-8-jre:amd64:
 openjdk-8-jre:amd64 depends on openjdk-8-jre-headless (= 8u392-ga-1~20.04); however:
  Package openjdk-8-jre-headless:amd64 is not configured yet.

dpkg: error processing package openjdk-8-jre:amd64 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of nvidia-visual-profiler:
 nvidia-visual-profiler depends on openjdk-8-jre; however:
  Package openjdk-8-jre:amd64 is not configured yet.

dpkg: error processing package nvidia-visual-profiler (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Processing triggers for initramfs-tools (0.136ubuntu6.7) ...
Processing triggers for libc-bin (2.31-0ubuntu9.14) ...
Errors were encountered while processing:
 nvidia-dkms-535
 nvidia-driver-535
 libfprint-2-2:amd64
 fprintd
 libpam-fprintd:amd64
 openjdk-8-jre-headless:amd64
 ca-certificates-java
 openjdk-8-jre:amd64
 nvidia-visual-profiler
E: Sub-process /usr/bin/dpkg returned an error code (1)
r

if you ever needed a reminder of why your using freebsd and not linux this is a good example

/proc is empty in the chroot

makes me think that i do need to run the ubuntu service and change mount points in the freebsd fstab
 
the nvidia-driver should be installed in this way :

Code:
TMPDIR=/home/user/TMP ./NVIDIA-Linux-x86_64-535.146.02.run \
    --install-compat32-libs \
    --no-nvidia-modprobe --no-backup --no-kernel-module \
    --no-x-check --no-nouveau-check \
    --no-cc-version-check --no-kernel-module-source \
    --no-check-for-alternate-installs \
    --install-libglvnd --skip-depmod --no-systemd
 
are you downloading the nvidia drivers from the site
rather using the version in apt

i have set up resolve with the nvidia drivers from apt without any issues

i think the problem im having is twofold

1 setting the locale

2 that /proc is empty in the chroot
 
think i fixed the locale problem by running

Code:
dpkg-reconfigure locales

in the chroot and selecting my locale as the system default

running locale now doesnt return any errors

have to figure out the /proc issue next
 
Back
Top