Does anyone run Linux desktop apps that require several shared libraries (such as gtk) on FreeBSD? If so, how do you do it? (Linuxulator, Linux jail, VM?)

Background: I'm trying to run the Linux binary for Zotero because the ports are for an old version. But it has lots of libraries that in turn need lots of shared libraries.
I did try to use debootstrap to install a Debian system and install libraries via chroot, but the lack of systemd prevented library installation.

#freebsd #BSD #zotero

So far I've been able to:

1) bootstrap a Ubuntu jammy system to /compat/ubuntu

2) update sysctl compat.linux.emul_path=/compat/ubuntu

3) chroot into /compat/ubuntu to
a) create a user with the same id as my FreeBSD user
b) install dependencies (e.g. libgtk)

4) fix ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2

# cd /compat/ubuntu/lib64/
# rm ./ld-linux-x86-64.so.2
# ln -s ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ld-linux-x86-64.so.2

5) install the Zotero standalone binaries into the chrooted user's home directory

I know that I am able to call the executable from the host by running /compat/ubuntu/home/brendan/Zotero_linux-x86_64/zotero-bin, but then I get some firefox dbus errors.

So, I'm getting closer...

#bsd #runbsd #zotero #freebsd

@brendan I think a lot of people use https://wiki.freebsd.org/bhyve
bhyve - FreeBSD Wiki

@l33tname Yes, this will be my fallback option if I can't find any other way of running it. I just didn't want the overhead of a VM if I can help it.
@brendan I used Linuxulator in the past for some things. Most notable was probably Sublime Merge but there was already a good port. Now I would probably try a Linux jail for a more complicated app. But depends on the use case obviously.
@ianthetechie Okay, I'll look into Bastille's Linux jails as an option.
@brendan yup that sounds like a good approach :)

@brendan

A Linux jail uses the Linuxulator. I tend to use Podman when I want to do this kind of thing, since it makes it easy to configure a container with whatever dependencies the programs have (and, often, they already come with a container image). It also uses the Linuxulator, and a jail for isolation, and can do nullfs mounts into the jail for things that you want to share.

@brendan Most of this is way beyond me, but in regards to escaping the systemd requirement, have you looked into distros that aren't built centered around systemd? For example, Devuan is a more direct attempt to switch away and then there are some like MX Linux which have options that can offer a choice of sysvinit with at least more of its fundamentals built to not require systemd.

Devuan is the closest to a drop-in replacement. (Really you can switch a Debian system over to Devuan by just changing a few sources and switching a few components.)

I don't really know what libraries you need (nor have the ability to diagnose each individually anyway,) so I couldn't say whether that solves that problem or not, but maybe it could help you on your way?