NapoleonWils0n / davinci-resolve-freebsd-jail

Davinci Resolve install on Freebsd using an Ubuntu Jail
3 stars 1 forks source link

+STARTUP: show2levels

[[https://www.blackmagicdesign.com/uk/products/davinciresolve][DaVinci Resolve]] installed in a Ubuntu Mantic Jail on Freebsd

Features

+begin_quote

Nvidia and Cuda enabled

Audio routed from the jail to the host using a pulseaudio socket for zero latency

Video directory from the Freebsd host mounted inside the home directory in the jail

Opened using a Desktop entry on Freebsd

+end_quote

Note: you may need to adjust the Render speed, which can be found in the Render page in the file tab

the default Render speed is set to maximum, you may need to drop the value down to 10 depending on the amount of ram on your system

[[assets/screenshot/screenshot.png]]

Horizontal Rule


** Freebsd *** System Requirements to run Davinci Resolve

+begin_quote

16 GB of system memory. 32 GB when using Fusion. \ GPU: Discrete with at least 2GB VRAM, supporting OpenCL 1.2 or CUDA 11.

+end_quote

Horizontal Rule


*** Clone the DaVinci Resolve Freebsd git repository

Clone this repository by running the following command

+begin_src sh

git clone https://github.com/NapoleonWils0n/davinci-resolve-freebsd-jail.git

+end_src

Horizontal Rule


*** Tree listing

Tree list of the DaVinci Resolve Freebsd git repository

+begin_example

. ├── README.org ├── assets │   ├── apt │   │   └── apt-installed.txt │   └── screenshot │   └── screenshot.png ├── freebsd │   ├── etc │   │   ├── devfs.rules │   │   ├── jail.conf │   │   └── jail.conf.d │   │   └── ubuntu.conf │   ├── home │   │   └── username │   │   ├── .config │   │   │   └── pulse │   │   │   ├── .config │   │   │   │   └── pulse │   │   │   └── default.pa │   │   └── .local │   │   └── share │   │   └── applications │   │   └── davinci-resolve.desktop │   └── usr │   └── local │   ├── bin │   │   └── resolve │   ├── etc │   │   └── doas.conf │   └── share │   └── debootstrap │   └── scripts │   ├── lunar │   └── mantic └── ubuntu ├── etc │   ├── apt │   │   └── sources.list │   ├── default │   │   └── locale │   ├── fstab │   └── modprobe.d │   └── blacklist-nvidia-nouveau.conf ├── home │   └── username │   ├── .config │   │   ├── gpu │   │   │   └── dummy-uvm.so │   │   └── pulse │   │   └── client.conf │   ├── .zshenv │   └── .zshrc └── usr └── local └── bin └── wrapper-resolve

36 directories, 21 files

+end_example

Horizontal Rule


*** Freebsd Nvidia and Cuda

Make sure Nvidia and Cuda is set up on the Freebsd host

+begin_src sh

sudo pkg install nvidia-driver linux-nvidia-libs libc6-shim libvdpau-va-gl libva-nvidia-driver

+end_src

run nv-sglrun nvidia-smi

+begin_src sh

nv-sglrun nvidia-smi

+end_src

nv-sglrun nvidia-smi output

+begin_example

shim init +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.146.02 Driver Version: 535.146.02 CUDA Version: 12.2 |

+end_example

Horizontal Rule


*** debootstrap install

Install debootstrap which we use to create an ubuntu jail on freebsd

[[https://wiki.debian.org/Debootstrap][Debootstrap - Debian Wiki]]

[[https://docs.freebsd.org/en/books/handbook/linuxemu/][Linux Binary Compatibility]]

+begin_src sh

sudo pkg install debootstrap

+end_src

Horizontal Rule


*** doas install

[[https://man.freebsd.org/cgi/man.cgi?query=doas.conf&sektion=5&format=html][doas.conf man page]]

Install doas so we enter the jail without being prompted for a password

+begin_src sh

sudo pkg install doas

+end_src

Edit the doas.conf file and change username to your username on freebsd

Path to the doas.conf on freebsd

+begin_example

/usr/local/etc/doas.conf

+end_example

doas.conf

Path to doas.conf in this repository

+begin_example

davinci-resolve-freebsd-jail/freebsd/usr/local/etc/doas.conf

+end_example

+begin_src conf

permit user

permit keepenv :username

jail

permit nopass :username cmd jexec

root as root

permit nopass keepenv root as root

+end_src

Horizontal Rule


*** freebsd devfs.rules

+begin_example

/etc/devfs.rules

+end_example

+begin_src conf

[ubuntu_jail=7] add include $devfsrules_hide_all add include $devfsrules_unhide_basic add include $devfsrules_unhide_login add path 'mixer' unhide add path 'dsp' unhide add path 'dri' unhide add path 'drm' unhide add path 'nvidia' unhide add path 'speaker' unhide

+end_src

after adding the devfs rules reboot

*** jail config

enable jails

+begin_src sh

sudo sysrc jail_enable="YES" sudo sysrc cloned_interfaces="lo1" sudo sysrc ifconfig_lo1_aliases="inet 10.10.0.1-12/24"

+end_src

+begin_example

/etc/rc.conf

+end_example

+begin_src conf

jail_enable="YES" cloned_interfaces="lo1" ifconfig_lo1_aliases="inet 10.10.0.1-12/24"

+end_src

** Setting Up the Jail Directory Tree *** zroot/jails

create the zroot/jails zfs dataset and set the mountpoint

+begin_src sh

sudo zfs create zroot/jails sudo zfs set mountpoint=/usr/local/jails zroot/jails

+end_src

***** zroot/jails/linux

create the zroot/jails/linux zfs dataset and set the mountpoint

+begin_src sh

sudo zfs create zroot/jails/linux sudo zfs set mountpoint=/usr/local/jails/linux zroot/jails/linux

+end_src

***** zroot/jails/linux/ubuntu

create the zroot/jails/linux/ubuntu zfs dataset and set the mountpoint

+begin_src sh

sudo zfs create zroot/jails/linux/ubuntu sudo zfs set mountpoint=/usr/local/jails/linux/ubuntu zroot/jails/linux/ubuntu

+end_src

***** /etc/jail.conf

create the /etc/jail.conf file if it doesn't exist

+begin_example

/etc/jail.conf

+end_example

add the following code to the jail.conf file to include \ files with a .conf extension in the /etc/jail.conf.d/ directory

+begin_src conf

startup/logging

exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; exec.consolelog = "/var/log/jailconsole${name}.log";

+end_src

***** /etc/jail.conf.d/ubuntu.conf

create the /etc/jail.conf.d/ directory

+begin_src sh

sudo mkdir -p /etc/jail.conf.d/

+end_src

+begin_example

/etc/jail.conf.d/ubuntu.conf

+end_example

+begin_src sh

ubuntu {

hostname/path

host.hostname = "${name}";
path = "/usr/local/jails/linux/${name}";

# permissions
allow.raw_sockets;
exec.clean;
persist;
sysvmsg=inherit;
sysvsem=inherit;
sysvshm=inherit;
enforce_statfs=1;

# permissions
devfs_ruleset=7;

# network
ip4.addr="lo1|10.10.0.5/24";

# mount
# mount.fstab="/usr/local/jails/linux/ubuntu/etc/fstab";
mount += "devfs           $path/dev      devfs           rw                      0       0";
mount += "tmpfs           $path/dev/shm  tmpfs           rw,size=1g,mode=1777    0       0";
mount += "fdescfs         $path/dev/fd   fdescfs         rw,linrdlnk             0       0";
mount += "linprocfs       $path/proc     linprocfs       rw                      0       0";
mount += "linsysfs        $path/sys      linsysfs        rw                      0       0";
mount += "/tmp            $path/tmp      nullfs          rw                      0       0";
mount += "/home           $path/home     nullfs          rw                      0       0";

# mount the video directory from the host to the jail after creating it
#mount += "/home/username/video $path/home/username/video  nullfs rw      0       0";
# uncomment the line below for the xdg runtime directory for wayland after creating it
#mount += "/var/run/xdg/djwilcox $path/run/user/1001  nullfs rw            0       0";

}

+end_src

*** pf.conf

+begin_src sh

/etc/pf.conf:

+end_src

nat for jail

+begin_src sh

nat on $int_if from {lo1:network} to any -> ($int_if) antispoof log quick for { lo $int_if } label "block_spoofing"

+end_src

full pf.conf example

+begin_src conf

=========================================================================

variables, macro and tables

=========================================================================

int_if="ue0" # usb to ethernet adaptor

int_if="bge0" # thunderbolt to ethernet adaptor

int_if="wlan0" # ralink usb wifi

vpn_if="tun0" # vpn interface all_networks="0.0.0.0/0" vpn_network="$vpn_if:network" tcp_services = "{ ntp, 6881 }" # tcp services - torrent udp_services = "{ ntp, 6882 }" # udp services - torrent icmp_types = "{ echoreq, unreach }" tcp_state="flags S/SA keep state" udp_state="keep state"

table { $all_networks, !self, !$int_if:network } # internet

table { $int_if:network, !self } # lan network

table { self } # self table { 0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 169.254.0.0/16 \ 172.16.0.0/12 192.0.0.0/24 192.0.2.0/24 224.0.0.0/3 \ 192.168.0.0/16 198.18.0.0/15 198.51.100.0/24 \ 203.0.113.0/24 } # broken networks

=========================================================================

global policy

=========================================================================

set block-policy drop set loginterface $int_if set fingerprints "/etc/pf.os" set skip on lo0 scrub in all fragment reassemble no-df max-mss 1440

nat jail

nat on $int_if from {lo1:network} to any -> ($int_if) antispoof log quick for { lo $int_if } label "block_spoofing"

=========================================================================

block

=========================================================================

block log all # block log all block return out quick inet6 all tag IPV6 # block ipv6 block in quick inet6 all tag IPV6 # block ipv6

block broken networks - turned off for synergy

block in quick from { no-route urpf-failed } to any tag BAD_PACKET

=========================================================================

anchors

=========================================================================

emerging threats - anchor

anchor "emerging-threats"

load anchor "emerging-threats" from "/etc/pf.anchors/emerging-threats"

openvpn - anchor

anchor "openvpn"

=========================================================================

traffic tag

=========================================================================

icmp

pass inet proto icmp all icmp-type $icmp_types keep state tag ICMP

Allow the tcp and udp services defined in the macros at the top of the file

pass in on $int_if inet proto tcp from any to ($int_if) port $tcp_services $tcp_state tag TCP_IN pass in on $int_if inet proto udp from any to ($int_if) port $udp_services $udp_state tag UDP_IN

outbound traffic

block out on $int_if all pass out quick on $int_if all modulate state

+end_src

*** Start linux

Use sysrc to set linux_enable="YES" in your /etc/rc.conf

+begin_src sh

sudo sysrc linux_enable="YES"

+end_src

or you can edit your

+begin_example

/etc/rc.conf

+end_example

start linux

+begin_src sh

sudo service linux start

+end_src

**** fstab add proc

edit your fstab and add proc

+begin_example

/etc/fstab

+end_example

fstab

+begin_src conf

proc /proc procfs rw 0 0

+end_src

Horizontal Rule


*** Ubuntu rc.d script

debootstrap has a collection of scripts to install different version of debian and ubuntu

The debootstrap scripts are installed in this location of freebsd

+begin_example

/usr/local/share/debootstrap/scripts

+end_example

Ubuntu Jammy is the latest version of ubuntu including as a script with debootstrap

However there seems to be a bug with ubuntu jammy installed in a jail on freebsd that sets the permission of a lot of binaries and libraries in the ubuntu jail to 700

Which means that only the root user can execute the binaries and libaries \ so you would have to run GUI applications as root

I copied one of the existing debootstrap files and added the Lunar and Mantic version of Ubuntu to the file which we will use later to install Ubuntu Mantic which doesn't have the persmissions bug

Lunar and Mantic script in this repository

Path to the lunar script in this repository

+begin_example

davinci-resolve-freebsd-jail/freebsd/usr/local/share/debootstrap/scripts/lunar

+end_example

Copy the lunar script from the repository to the debootstrap scripts directory

+begin_src sh

sudo cp davinci-resolve-freebsd-jail/freebsd/usr/local/share/debootstrap/scripts/lunar /usr/local/share/debootstrap/scripts

+end_src

Path to the mantic script in this repository

+begin_example

davinci-resolve-freebsd-jail/freebsd/usr/local/share/debootstrap/scripts/mantic

+end_example

Copy the mantic script from the repository to the debootstrap scripts directory

+begin_src sh

sudo cp davinci-resolve-freebsd-jail/freebsd/usr/local/share/debootstrap/scripts/mantic /usr/local/share/debootstrap/scripts

+end_src

+begin_src conf

case $ARCH in amd64|i386) case $SUITE in gutsy|hardy|intrepid|jaunty|karmic|lucid|lunar|mantic|maverick|natty|oneiric|precise|quantal|raring|saucy|utopic|vivid|wily|yakkety|zesty) default_mirror http://old-releases.ubuntu.com/ubuntu ;; ) default_mirror http://archive.ubuntu.com/ubuntu ;; esac ;; sparc) case $SUITE in gutsy) default_mirror http://old-releases.ubuntu.com/ubuntu ;; ) default_mirror http://ports.ubuntu.com/ubuntu-ports ;; esac ;; *) default_mirror http://ports.ubuntu.com/ubuntu-ports ;; esac mirror_style release download_style apt finddebs_style from-indices variants - buildd fakechroot minbase keyring /usr/local/share/keyrings/ubuntu-archive-keyring.gpg

if doing_variant fakechroot; then test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" fi

case $ARCH in alpha|ia64) LIBC="libc6.1" ;; kfreebsd-) LIBC="libc0.1" ;; hurd-) LIBC="libc0.3" ;; *) LIBC="libc6" ;; esac

case $SUITE in gutsy|hardy|intrepid|jaunty|karmic|lucid|lunar|mantic|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic|disco|eoan|focal|groovy|hirsute) ;; *)

impish+ will use zstd compression, check if supported

    dpkg_zstd="$(dpkg-deb --help 2>/dev/null | grep ' zstd,' || :)"
    if [ -z "$EXTRACTOR_OVERRIDE" ] && [ -z "$dpkg_zstd" ]; then
        info CHOSENEXTRACTOR "%s uses zstd compression, setting --extractor=ar option" "$SUITE"
        export EXTRACTOR_OVERRIDE=ar
    fi
;;

esac

work_out_debs () { required="$(get_debs Priority: required)"

if doing_variant - || doing_variant fakechroot; then
    #required="$required $(get_debs Priority: important)"
    #  ^^ should be getting debconf here somehow maybe
    base="$(get_debs Priority: important)"
elif doing_variant buildd; then
    base="apt build-essential"
elif doing_variant minbase; then
    base="apt"
fi

if doing_variant fakechroot; then
    # ldd.fake needs binutils
    required="$required binutils"
fi

case $MIRRORS in
    https://*)
    case "$CODENAME" in
        gutsy|hardy|intrepid|jaunty|karmic|lucid|lunar|mantic|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty)
        base="$base apt-transport-https ca-certificates"
        ;;
        *)
        base="$base ca-certificates"
        ;;
    esac
    ;;
esac

# do not install usrmerge in fresh bootstraps
# but do print it for germinate to accept it into minimal
if [ "$WHAT_TO_DO" = "finddebs printdebs kill_target" ]; then
    case "$CODENAME" in
        # "merged-usr" blacklist for past releases
        gutsy|hardy|intrepid|jaunty|karmic|lucid|lunar|mantic|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic|disco|eoan|focal|groovy)
        ;;
        hirsute)
            # keep hirsute buildd chroots split-usr to allow for escape hatch
            if ! doing_variant buildd; then
                if [ -z "$MERGED_USR" ] || [ "$MERGED_USR" = "yes" ]; then
                    base="$base usrmerge"
                fi
            fi
            ;;
        *)
            # all future series post hirsute use merged-usr in buildd chroots too
            if [ -z "$MERGED_USR" ] || [ "$MERGED_USR" = "yes" ]; then
                base="$base usrmerge"
            fi
            ;;
    esac
fi

}

first_stage_install () { case "$CODENAME" in

"merged-usr" blacklist for past releases

    gutsy|hardy|intrepid|jaunty|karmic|lucid|lunar|mantic|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic)
        [ -z "$MERGED_USR" ] && MERGED_USR="no"
        ;;
    disco|eoan|focal|groovy)
        # see https://bugs.debian.org/838388
        EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k"
        ;;
    hirsute)
        # keep hirsute buildd chroots split-usr to allow for escape hatch
        if [ -z "$MERGED_USR" ]; then
            if doing_variant buildd; then
                MERGED_USR="no"
            else
                MERGED_USR="yes"
            fi
        fi
        # see https://bugs.debian.org/838388
        EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k"
        ;;
    *)
        # all future series post hirsute use merged-usr in buildd chroots too
        [ -z "$MERGED_USR" ] && MERGED_USR="yes"
        # see https://bugs.debian.org/838388
        EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k"
        ;;
esac

setup_merged_usr
extract $required

mkdir -p "$TARGET/var/lib/dpkg"
: >"$TARGET/var/lib/dpkg/status"
: >"$TARGET/var/lib/dpkg/available"

setup_etc
if [ ! -e "$TARGET/etc/fstab" ]; then
    echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
    chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
fi

setup_devices

    if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then
    setup_proc_symlink
fi

}

second_stage_install () { in_target /bin/true

setup_dynamic_devices

x_feign_install () {
    local pkg="$1"
    local deb="$(debfor $pkg)"
    local ver="$(in_target dpkg-deb -f "$deb" Version)"

    mkdir -p "$TARGET/var/lib/dpkg/info"

    echo \

"Package: $pkg Version: $ver Maintainer: unknown Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"

    touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
}

x_feign_install dpkg

x_core_install () {
    smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
}

p () {
    baseprog="$(($baseprog + ${1:-1}))"
}

if ! doing_variant fakechroot; then
    setup_proc
    in_target /sbin/ldconfig
fi

DEBIAN_FRONTEND=noninteractive
DEBCONF_NONINTERACTIVE_SEEN=true
export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN

baseprog=0
bases=7

p; progress $baseprog $bases INSTCORE "Installing core packages" #1
info INSTCORE "Installing core packages..."

p; progress $baseprog $bases INSTCORE "Installing core packages" #2
ln -sf mawk "$TARGET/usr/bin/awk"
x_core_install base-passwd
x_core_install base-files
p; progress $baseprog $bases INSTCORE "Installing core packages" #3
x_core_install dpkg

if [ ! -e "$TARGET/etc/localtime" ]; then
    ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
fi

if doing_variant fakechroot; then
    install_fakechroot_tools
fi

p; progress $baseprog $bases INSTCORE "Installing core packages" #4
x_core_install $LIBC

p; progress $baseprog $bases INSTCORE "Installing core packages" #5
x_core_install perl-base

p; progress $baseprog $bases INSTCORE "Installing core packages" #6
rm "$TARGET/usr/bin/awk"
x_core_install mawk

p; progress $baseprog $bases INSTCORE "Installing core packages" #7
if doing_variant -; then
    x_core_install debconf
fi

baseprog=0
bases=$(set -- $required; echo $#)

info UNPACKREQ "Unpacking required packages..."

exec 7>&1

smallyes '' |
    (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages.  This will be attempted up to five times." "" \
    dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) |
    dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING

info CONFREQ "Configuring required packages..."

if doing_variant fakechroot && [ -e "$TARGET/var/lib/dpkg/info/initscripts.postinst" ]
then
    # fix initscripts postinst (no mounting possible, and wrong if condition)
    sed -i '/dpkg.*--compare-versions/ s/\<lt\>/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst"
fi

echo \

"#!/bin/sh exit 101" > "$TARGET/usr/sbin/policy-rc.d" chmod 755 "$TARGET/usr/sbin/policy-rc.d"

mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
echo \

"#!/bin/sh echo echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" chmod 755 "$TARGET/sbin/start-stop-daemon"

if [ -x "$TARGET/sbin/initctl" ]; then
  mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL"
  echo \

"#!/bin/sh if [ \"\$1\" = version ]; then exec /sbin/initctl.REAL \"\$@\"; fi echo echo \"Warning: Fake initctl called, doing nothing\"" > "$TARGET/sbin/initctl" chmod 755 "$TARGET/sbin/initctl" fi

setup_dselect_method apt

smallyes '' |
    (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
    dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) |
    dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING

baseprog=0
bases="$(set -- $base; echo $#)"

info UNPACKBASE "Unpacking the base system..."

setup_available $required $base
done_predeps=
while predep=$(get_next_predep); do
    # We have to resolve dependencies of pre-dependencies manually because
    # dpkg --predep-package doesn't handle this.
    predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps")
    # XXX: progress is tricky due to how dpkg_progress works
    # -- cjwatson 2009-07-29
    # This step sometimes fails due to some missing functionality in Linuxulator.  Just ignore it.
    set +e
    p; smallyes '' |
    in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep)
    rc=$?
    base=$(without "$base" "$predep")
    done_predeps="$done_predeps $predep"

    if [ $rc != 0 ]; then
        warning FREEBSD_00 "Applying FreeBSD-specific workaround..."
        # ... for "Failed to mount /etc/machine-id: Bad address" with Focal.
        in_target truncate -s0 /var/lib/dpkg/info/systemd.postinst
        in_target dpkg --configure systemd
    fi
    set -e
done

if [ -n "$base" ]; then
    smallyes '' |
        (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages.  This will be re-attempted up to five times." "" \
        dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) |
        dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING

    info CONFBASE "Configuring the base system..."

    # This step sometimes fails due to some missing functionality in Linuxulator.  Just ignore it.
    set +e
    smallyes '' |
        (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages.  This will be re-attempted up to five times." "" \
        dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
        dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
    set -e
fi

if [ -x "$TARGET/sbin/initctl.REAL" ]; then
    mv "$TARGET/sbin/initctl.REAL" "$TARGET/sbin/initctl"
fi
mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
rm -f "$TARGET/usr/sbin/policy-rc.d"

echo \

"# Workaround for Linuxulator missing mremap(2) support; without it,

apt(8) fails like this:

E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start.

APT::Cache-Start 251658240;" >> "$TARGET/etc/apt/apt.conf.d/00freebsd"

progress $bases $bases CONFBASE "Configuring base system"
info BASESUCCESS "Base system installed successfully."

}

+end_src

Horizontal Rule


*** Create the mount points for Ubuntu

Create necessary mount points for the Ubuntu jail

+begin_example

/usr/local/jails/linux/ubuntu

+end_example

+begin_src sh

sudo mkdir -p {/usr/local/jails/linux/ubuntu/dev/fd,/usr/local/jails/linux/ubuntu/dev/shm,/usr/local/jails/linux/ubuntu/home,/usr/local/jails/linux/ubuntu/tmp,/usr/local/jails/linux/ubuntu/proc,/usr/local/jails/linux/ubuntu/sys}

+end_src

Horizontal Rule


**** debootstrap install Ubuntu

Use debootstrap with the Mantic script we created earlier as well the url

+begin_example

http://archive.ubuntu.com/ubuntu/

+end_example

to the Ubuntu archive with Lunar and Mantic and install Ubuntu into this location on Freebsd

+begin_example

/usr/local/jails/linux/ubuntu

+end_example

debootstrap Ubuntu Mantic

+begin_src sh

sudo debootstrap --arch=amd64 --no-check-gpg mantic /usr/local/jails/linux/ubuntu http://archive.ubuntu.com/ubuntu/

+end_src

Horizontal Rule


*** getpwnam

+begin_src sh

cd /usr/local/jails/linux/ubuntu/etc

+end_src

switch to root

+begin_src sh

su -m

+end_src

+begin_src sh

cat passwd | sed -r 's/(:[x|]:)([0-9]+:[0-9]+:)/::\2:0:0:/g' > master.passwd

+end_src

+begin_src sh

pwd_mkdb -d ./ -p master.passwd

+end_src

*** jail start

start the ubuntu jail

+begin_src sh

doas service jail onestart ubuntu

+end_src

check the jail is running

+begin_src sh

doas jls

+end_src

*** enter jail

+begin_src sh

doas jexec ubuntu /bin/bash

+end_src

** Ubuntu set up *** dns nameserver

+begin_src sh

echo nameserver 8.8.8.8 > /etc/resolv.conf

+end_src

*** Set correct timezone inside the jail

You will now be logged in as root inside the jail

+begin_src sh

printf "%b\n" "0.0 0 0.0\n0\nUTC" > /etc/adjtime

+end_src

Install sudo

+begin_src sh

apt install sudo

+end_src

For some reason sudo is necessary here, otherwise it fails.

Run dpkg-reconfigure tzdata with sudo

+begin_src sh

sudo dpkg-reconfigure tzdata

+end_src

Horizontal Rule


*** Fix APT package manager

Run the following command as root

+begin_src sh

printf "APT::Cache-Start 251658240;" > /etc/apt/apt.conf.d/00aptitude

+end_src

Horizontal Rule


*** Enable more repositories:

Edit the apt sources.list and add more repositories \ [trusted=yes] is needed for lunar and mantic

Freebsd path to the sources.list in the jail

+begin_example

/usr/local/jails/linux/ubuntu/etc/apt/sources.list

+end_example

Path to the sources.list in the jail

+begin_example

/etc/apt/sources.list

+end_example

+begin_src conf

deb [trusted=yes] http://archive.ubuntu.com/ubuntu/ mantic main restricted universe multiverse deb [trusted=yes] http://archive.ubuntu.com/ubuntu/ mantic-updates main restricted universe multiverse deb [trusted=yes] http://archive.ubuntu.com/ubuntu/ mantic-security main restricted universe multiverse

+end_src

Horizontal Rule


*** apt update

Run the following commands as root to update and upgrade Ubuntu

+begin_src sh

apt update

+end_src

Upgrade

+begin_src sh

apt upgrade

+end_src

Horizontal Rule


*** Set locale

+begin_src sh

/etc/default/locale

+end_src

+begin_src sh

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=

+end_src

Run the following commands as root

locale-gen

+begin_src sh

locale-gen

+end_src

dpkg-reconfigure locales

+begin_src sh

dpkg-reconfigure locales

+end_src

Horizontal Rule


*** Shell install

Install the shell our user is going to use \ it must match the shell set in the ubuntu /etc/passwd file which we will set up

Run the following command as root

+begin_src sh

apt install zsh pulseaudio

+end_src

Horizontal Rule


*** Copy user and group from Freebsd to Ubuntu

We can just copy the settings for our user from Freebsd passwd file

+begin_example

/etc/passwd

+end_example

to the passwd file on Ubuntu

+begin_example

/usr/local/jails/linux/ubuntu/etc/passwd

+end_example

**** Freebsd /etc/passwd

+begin_example

username:*:1001:1001:USER NAME:/home/username:/usr/local/bin/zsh

+end_example

We also need to check that the shell path is correct \ change zsh path to /bin/zsh in the jail

Freebsd passwd

+begin_src sh

username:*:1001:1001:USER NAME:/home/username:/usr/local/bin/zsh

+end_src

**** ubuntu passwd

Host path

+begin_example

/usr/local/jails/linux/ubuntu/etc/passwd

+end_example

jail path

+begin_example

/etc/passwd

+end_example

+begin_src sh

username:*:1001:1001:USER NAME:/home/djwilcox:/bin/zsh

+end_src

Check your user and group on freebsd

+begin_src sh

id

+end_src

Output

+begin_src sh

uid=1001(username) gid=1001(username) groups=1001(username),0(wheel),5(operator),44(video),47(realtime)

+end_src

**** copy the group from freebsd to ubuntu

Freebsd /etc/group

+begin_src conf

username:*:1001:

+end_src

Ubuntu /etc/group

+begin_src conf

username:*:1001:

+end_src

Horizontal Rule


*** Add user to groups in the jail

Add the user we created to groups in the jail \ replace username with the username you created

Run the following command as root

+begin_src sh

usermod -a -G adm username usermod -a -G cdrom username usermod -a -G sudo username usermod -a -G dip username usermod -a -G plugdev username usermod -a -G users username usermod -a -G video username usermod -a -G audio username usermod -a -G pulse username usermod -a -G pulse-access username

+end_src

edit the jails group file

+begin_example

vi /etc/group

+end_example

comment out the root entry and create a new wheel entry, replace username with your username

+begin_src conf

wheel:*:0:root,username

root:x:0:

+end_src

Horizontal Rule


*** sudo set up

Run the following command as root

Edit the sudoers file with visudo

+begin_src sh

visudo

+end_src

Add your user to the sudoers file, change username to your username

+begin_src sh

username ALL=(ALL:ALL) ALL

+end_src

Horizontal Rule


*** passwd

Create a passwd for your user, replace username with your username

Run the following command as root

+begin_src sh

passwd username

+end_src

Horizontal Rule


*** create the home username directory

change username to your username

+begin_src sh

mkdir -p /home/username

+end_src

+begin_src sh

chown username:username username

+end_src

*** Couldnt resolve hostname fix

Add your hostname from the jail to the hosts file in the ubuntu jail \ to stop errors when using sudo saying couldnt resolve hostname

Path to the hosts in the jail

+begin_example

vi /etc/hosts

+end_example

hosts

+begin_src conf

127.0.0.1 hostname

+end_src

+begin_src conf

127.0.0.1 localhost 127.0.0.1 ubuntu ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters

+end_src

Horizontal Rule


*** Switch to out user with su

switch to your user in the jail \ replace username with your username

+begin_src sh

su - username

+end_src

Horizontal Rule


*** Build essential

Verify the system has build tools such as make, gcc installed

Install build-essential for gcc

+begin_src sh

sudo apt install build-essential

+end_src

Horizontal Rule


*** ffmpeg install

+begin_src sh

sudo apt install ffmpeg

+end_src

Horizontal Rule


*** user-dirs.dirs

create directories in the home directory

+begin_src sh

mkdir -p "${HOME}"/{desktop,documents,downloads,video}

+end_src

set the xdg directories to the directories we just created

+begin_src sh

vi ~/.config/user-dirs.dirs

+end_src

+begin_src sh

enabled=False XDG_DESKTOP_DIR="$HOME/desktop" XDG_DOCUMENTS_DIR="$HOME/documents" XDG_DOWNLOAD_DIR="$HOME/downloads" XDG_VIDEOS_DIR="$HOME/video"

+end_src

*** Create the XDG_RUNTIME_DIR directory

Create the XDG_RUNTIME_DIR directory in the jail

+begin_src sh

sudo mkdir -p /var/run/user/"$(id -u)"

+end_src

Chown the directory

+begin_src sh

sudo chown -R "${USER}":"$(id -u)" /var/run/user/"$(id -u)"

+end_src

Chmod the directory

+begin_src sh

sudo chmod 700 /var/run/user/"$(id -u)"

+end_src

Horizontal Rule


*** stop the jail and edit the jail config

exit the jail

+begin_src sh

exit exit

+end_src

stop the ubuntu jail

+begin_src sh

doas service jail onestop ubuntu

+end_src

edit the ubuntu.conf jail config and uncomment the video and xdg directories

+begin_example

/etc/jail.conf.d/ubuntu.conf

+end_example

+begin_src sh

ubuntu {

hostname/path

host.hostname = "${name}";
path = "/usr/local/jails/linux/${name}";

# permissions
allow.raw_sockets;
exec.clean;
persist;
sysvmsg=inherit;
sysvsem=inherit;
sysvshm=inherit;
enforce_statfs=1;

# permissions
devfs_ruleset=7;

# network
ip4.addr="lo1|10.10.0.5/24";

# mount
# mount.fstab="/usr/local/jails/linux/ubuntu/etc/fstab";
mount += "devfs           $path/dev      devfs           rw                      0       0";
mount += "tmpfs           $path/dev/shm  tmpfs           rw,size=1g,mode=1777    0       0";
mount += "fdescfs         $path/dev/fd   fdescfs         rw,linrdlnk             0       0";
mount += "linprocfs       $path/proc     linprocfs       rw                      0       0";
mount += "linsysfs        $path/sys      linsysfs        rw                      0       0";
mount += "/tmp            $path/tmp      nullfs          rw                      0       0";
mount += "/home           $path/home     nullfs          rw                      0       0";

# mount the video directory from the host to the jail after creating it
mount += "/home/username/video $path/home/username/video  nullfs rw      0       0";
# uncomment the line below for the xdg runtime directory for wayland after creating it
mount += "/var/run/xdg/djwilcox $path/run/user/1001  nullfs rw            0       0";

}

+end_src

*** start the ubuntu jail

+begin_src sh

doas service jail onestart ubuntu

+end_src

enter the jail

+begin_src sh

doas jexec ubuntu /bin/sh

+end_src

switch to our user replace username with your username

+begin_src sh

su - username

+end_src

*** Nvidia download

Download the linux version matching the version on the freebsd host \ the version must match exactly or it won't work

[[https://www.nvidia.com/Download/Find.aspx?lang=en-us]]

Download link for 535.146.02

[[https://www.nvidia.com/download/driverResults.aspx/216728/en-us/]]

Download link for 550.54.14

[[https://www.nvidia.com/download/driverResults.aspx/218826/en-us/]]

Horizontal Rule


*** Nvidia driver install

on the freebsd host move the nvidia installer to the video directory which should be mounted in the jail, so you can cd to the video directory in the jail and install the driver

chmod the Nvidia run file

+begin_src sh

chmod +x NVIDIA-Linux-x86_64-550.54.14.run

+end_src

Install the Nvidia driver

+begin_src sh

sudo ./NVIDIA-Linux-x86_64-550.54.14.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

+end_src

Horizontal Rule


*** Nvidia-cuda-toolkit

Install the nvidia-cuda-toolkit

+begin_src sh

sudo apt install nvidia-cuda-toolkit ocl-icd-opencl-dev libglu1-mesa libfuse2 initramfs-tools

+end_src

Horizontal Rule


*** Blacklist Nouveau Nvidia driver

+begin_src sh

sudo mkdir -p /etc/modprobe.d

+end_src

Copy the blacklist-nvidia-nouveau.conf file from the repository to the jail

+begin_example

sudo vi /etc/modprobe.d/blacklist-nvidia-nouveau.conf

+end_example

+begin_src conf

blacklist nouveau options nouveau modeset=0

+end_src

Horizontal Rule


*** update-initramfs

+begin_src sh

sudo update-initramfs -u

+end_src

Horizontal Rule


*** wayland packages

+begin_src sh

sudo apt install libinput-tools wayland-protocols libwlroots11 libwlroots-dev libxkbcommon0 qtwayland5 qt6-wayland wayland-utils adwaita-qt qt5ct libnvidia-egl-wayland1

+end_src

*** zsh shell config

We need to set some enviormental variables in our shell config

Copy the zshrc config from this reposiory to the jail

+begin_src sh

cp davinci-resolve-freebsd-jail/ubuntu/home/username/.zshrc /usr/local/jails/linux/ubuntu/home/"${USER}"

+end_src

Copy the zshenv config from this reposiory to the jail

+begin_src sh

cp davinci-resolve-freebsd-jail/ubuntu/home/username/.zshenv /usr/local/jails/linux/ubuntu/home/"${USER}"

+end_src

***** zshrc

We create a blank .zshrc file \ otherwise zsh will complain that theres is no config file

+begin_src sh

~/.zshrc

add your zsh code below

+end_src

***** zshenv

shell path

Set the shell path to include resolve bin directory \ this allows us to type resolve

+begin_example

resolve

+end_example

Instead of the full path to open Davinci Resolve in the jail

+begin_example

/opt/resolve/bin/resolve

+end_example

+begin_src conf

~/.zshenv

for ZSH

case "$OSTYPE" in freebsd*)

Path

typeset -U PATH path path=("$path[@]") export PATH

XDG_RUNTIME_DIR

export XDG_RUNTIME_DIR=/var/run/xdg/"${USER}"

wayland - uncomment to use wayland

export WAYLAND_DISPLAY=wayland-0 export QT_QPA_PLATFORM=wayland export GDK_BACKEND=wayland

x11 - comment out to use wayland

export DISPLAY=unix:0

export QT_QPA_PLATFORM=xcb

export GDK_BACKEND=x11

;; linux*) typeset -U PATH path path=("/opt/resolve/bin" "$path[@]") export PATH

XDG_RUNTIME_DIR

export XDG_RUNTIME_DIR="/run/user/id -u"

dummy-uvm.so for access to the gpu

export LD_PRELOAD="${HOME}"/.config/gpu/dummy-uvm.so:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0:/usr/lib/x86_64-linux-gnu/libgio-2.0.so:/usr/lib/x86_64-linux-gnu/libgmodule-2.0.so export __NV_PRIME_RENDER_OFFLOAD=1 export __GLX_VENDOR_LIBRARY_NAME=nvidia

wayland - uncomment to use wayland

export WAYLAND_DISPLAY=wayland-0

export QT_QPA_PLATFORM=wayland

export GDK_BACKEND=wayland

x11 - comment out to use wayland

export DISPLAY=unix:0 export QT_QPA_PLATFORM=xcb export GDK_BACKEND=x11 ;; esac

xdg directories

export XDG_CONFIG_HOME="$HOME/.config" export XDG_CACHE_HOME="$HOME/.cache" export XDG_DATA_HOME="$HOME/.local/share"

qt5

export QT_QPA_PLATFORMTHEME=qt5ct

+end_src

Horizontal Rule


*** xorriso and fakeroot install

Install fakeroot and xorriso for makeresolvedeb

+begin_src sh

sudo apt install fakeroot xorriso

+end_src

Horizontal Rule


*** Davinci Resolve download

On the Freebsd host

Go to the Davinci Resolve website and click the \ "Davinci Resolve Free Download Now" link

[[https://www.blackmagicdesign.com/products/davinciresolve/][Davinci Resolve]]

then click the Linux download link for either the Free version or the paid Studio version \ you will then need to register on the site with an email address

Once you have submitted the form the Davinci Resolve zip file will start to download, \ the zip file has a file size of 2.4 gigabytes so may take an hour or so to download

Copy the Davinci Resolve zip from your downloads folder to your video directory which is mounted in the jail

Horizontal Rule


*** makeresolvedeb download

On the Freebsd host download the makeresolvedeb script

[[https://www.danieltufvesson.com/makeresolvedeb][makeresolvedeb]]

Copy the makeresolvedeb_1.6.4_multi.sh.tar.gz from the freebsd host to the home directory in the jail \

+begin_src sh

cp -rv makeresolvedeb_1.6.4_multi.sh.tar.gz /usr/local/jails/linux/ubuntu/home/"${USER}"

+end_src

Horizontal Rule


*** makeresolvedeb create deb file

Make sure you have entered the jail by running

+begin_src sh

doas jexec ubuntu /bin/bash

+end_src

Switch to out user in the jail, \ replace username with your username

+begin_src sh

su - username

+end_src

Install zip

+begin_src sh

sudo apt install zip

+end_src

Unzip the resolve zip

+begin_src sh

unzip DaVinci_Resolve_19.0_Linux.zip

+end_src

Extract the makeresolvedeb.tar.gz file

+begin_src sh

tar zxvf makeresolvedeb_1.7.2_multi.sh.tar.gz

+end_src

then run makeresolvedeb

+begin_src sh

./makeresolvedeb_1.7.2_multi.sh DaVinci_Resolve_19.0.1_Linux.run

+end_src

This may take about an hour

*** Install liblog4cxx-dev

+begin_src sh

sudo apt install liblog4cxx-dev

+end_src

Horizontal Rule


*** DaVinci Resolve deb install

+begin_src sh

sudo dpkg -i davinci-resolve_19.0.1-mrd1.7.2_amd64.deb

+end_src

or

+begin_src sh

sudo apt install davinci-resolve_19.0.1-mrd1.7.2_amd64.deb

+end_src

Horizontal Rule


** Pulseaudio set up * Freebsd ** default.pa

Use the pulseaudio default.pa config file to create a pulseaudio socket in the /tmp directory

The /tmp directory is mounted in the jail and allows us to route the audio from the jail to the host

Copy the default.pa from this repository to

+begin_example

~/.config/pulse/default.pa

+end_example

+begin_src sh

cp davinci-resolve-freebsd-jail/freebsd/home/username/.config/pulse/default.pa "${HOME}/.config/pulse"

+end_src

+begin_src conf

!/usr/local/bin/pulseaudio -nF

include default.pa and override

.include /usr/local/etc/pulse/default.pa

jail

.ifexists module-esound-protocol-unix.so load-module module-esound-protocol-unix .endif load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket

+end_src

Horizontal Rule


* Ubuntu ** client.conf

Full path to the client.conf from freebsd to the jail

+begin_example

/usr/local/jails/linux/ubuntu/home/username/.config/pulse/client.conf

+end_example

client.conf path in the jail

+begin_example

~/.config/pulse/client.conf

+end_example

Copy client.conf from this repository into the jail

+begin_src sh

cp davinci-resolve-freebsd-jail/ubuntu/home/username/.config/pulse/client.conf /usr/local/jails/linux/ubuntu/home/"${USER}"/.config/pulse

+end_src

+begin_src conf

This file is part of PulseAudio.

#

PulseAudio is free software; you can redistribute it and/or modify

it under the terms of the GNU Lesser General Public License as published by

the Free Software Foundation; either version 2 of the License, or

(at your option) any later version.

#

PulseAudio is distributed in the hope that it will be useful, but

WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

General Public License for more details.

#

You should have received a copy of the GNU Lesser General Public License

along with PulseAudio; if not, see http://www.gnu.org/licenses/.

Configuration file for PulseAudio clients. See pulse-client.conf(5) for

more information. Default values are commented out. Use either ; or # for

commenting.

; default-sink = oss_output.dsp1 ; default-source = default-server = /tmp/pulseaudio.socket ; default-dbus-server =

; autospawn = yes ; daemon-binary = /usr/local/bin/pulseaudio ; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes ; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no ; auto-connect-display = no

+end_src

Horizontal Rule


** Davinci Resolve Desktop entry * Freebsd ** resolve script

Freebsd script to launch Davinci Resolve from a Linux Jail

Path to resolve in this repository

+begin_example

davinci-resolve-freebsd-jail/freebsd/usr/local/bin/resolve

+end_example

Copy the resolve script from the repository to the freebsd bin directory

+begin_src sh

sudo cp davinci-resolve-freebsd-jail/freebsd/usr/local/bin/resolve /usr/local/bin

+end_src

+begin_src sh

!/bin/sh

resolve

Freebsd script to launch Davinci Resolve from a Linux Jail

start pulseaudio

pulseaudio --start --daemonize 2>/dev/null

doas jexec into ubuntu and run the wrapper script to start resolve

doas jexec ubuntu /usr/local/bin/wrapper-resolve \ -d "DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}" \ -u "${USER}"

+end_src

Horizontal Rule


* Ubuntu ** wrapper-resolve

Path to wrapper-resolve in this repository

+begin_example

davinci-resolve-freebsd-jail/ubuntu/usr/local/bin/wrapper-resolve

+end_example

Copy the script to the jail

+begin_src sh

sudo cp davinci-resolve-freebsd-jail/ubuntu/usr/local/bin/wrapper-resolve /usr/local/jails/linux/ubuntu/usr/local/bin

+end_src

Freebsd path to wrapper-resolve in the jail

+begin_example

/usr/local/jails/ubuntu/usr/local/bin/wrapper-resolve

+end_example

Path to wrapper-resolve in the jail

+begin_example

/usr/local/bin/wrapper-resolve

+end_example

+begin_src sh

!/bin/bash

===============================================================================

wrapper-resolve

===============================================================================

===============================================================================

script usage

===============================================================================

usage () {

if argument passed to function echo it

[ -z "${1}" ] || echo "! ${1}"

display help

echo "\

script usage

$(basename "$0") -u ${USER}" exit 2 }

===============================================================================

check the number of arguments passed to the script

===============================================================================

[ $# -gt 0 ] || usage "${WRONG_ARGS_ERR}"

===============================================================================

getopts check the options passed to the script

===============================================================================

while getopts ':u:d:h' opt do case ${opt} in u) username="${OPTARG}";; d) dbus="${OPTARG}";; h) usage;; \?) usage "${INVALID_OPT_ERR} ${OPTARG}" 1>&2;; :) usage "${INVALID_OPT_ERR} ${OPTARG} ${REQ_ARG_ERR}" 1>&2;; esac done shift $((OPTIND-1))

===============================================================================

switch to our user in the jail and start resolve

===============================================================================

su "${username}" -c "${dbus} /opt/resolve/bin/resolve" 2>/dev/null

+end_src

Horizontal Rule


*** davinci-resolve.desktop

Path to davinci-resolve.desktop in this repository

+begin_example

davinci-resolve-freebsd-jail/freebsd/home/username/.local/share/applications/davinci-resolve.desktop

+end_example

On the freebsd host copy the davinci-resolve.desktop to

+begin_example

~/.local/share/applications

+end_example

+begin_src sh

cp davinci-resolve-freebsd-jail/freebsd/home/username/.local/share/applications/davinci-resolve.desktop "${HOME}/.local/share/applications"

+end_src

davinci-resolve.desktop

+begin_src conf

[Desktop Entry] Version=1.0 Encoding=UTF-8 Type=Application Name=DaVinci Resolve Exec=/usr/local/bin/resolve-wrapper Icon=/usr/local/jails/linux/ubuntu/opt/resolve/graphics/DV_Resolve.png Terminal=false MimeType=application/x-resolveproj; StartupNotify=true Categories=AudioVideo

+end_src

Horizontal Rule


** start the jail

you need to start the jail before you can use it

+begin_src sh

doas service jail onestart ubuntu

+end_src