About the principles of FreeBSD's Linux compatibility layer

I have a question about the principle of the Linux compatibility layer:
Is it actually the case that the FreeBSD kernel itself is binary compatible with Linux programs, but just needs Jail containers because of the different file structure?
 
Is it actually the case that the FreeBSD kernel itself is binary compatible with Linux programs, but just needs Jail containers because of the different file structure?
Filestructure is mostly the same. But Linux programs (or any program actually) rarely live in a vacuum, so besides the kernel functions it typically also needs various libraries. Those libraries are typical for Linux, glibc for example. The kernel has some shims to 'translate' the Linux kernel calls to FreeBSD equivalents, but libc doesn't have shims to make it compatible with glibc.
 
Is it actually the case that the FreeBSD kernel itself is binary compatible with Linux programs, but just needs Jail containers because of the different file structure?
No jails are needed, they are just one option. The other option is a compatibility "overlay", by default /compat/linux. Whenever a Linux binary is looking for some file, the kernel first tries to prepend /compat/linux to the full path. Only when there's nothing found, the original full path is tried. So, whatever is below /compat/linux "hides" files by the same path name for Linux binaries.

This also happens in jails btw, so you could also have a jail with a "mix" of FreeBSD and Linux binaries. But there's also the common practice to install a full Linux userland in a jail, without any FreeBSD binaries, which works just as well.

For the first part of your question, mostly what SirDice already said. The FreeBSD kernel implements Linux syscalls. What a binary sees depends on its "ELF brand", a FreeBSD binary sees the native syscalls, a Linux binary the Linux syscalls. So, what's "missing" is indeed libraries, that's why you typically need to install some Linux userland as well. A fully statically linked Linux binary would run on FreeBSD without that.
 
I wonder if anyone here is able to assist me with a pet project I have been working on? I have been trying to get MakeMKV working on FreeBSD 13.2. I have successfully installed the CLI version, thanks to a post I saw on here a while ago but, would really like to use the GUI version.

Recently, I came across a method for installing it directly on Debian Linux using a custom 3rd party repo (rather than installing a Flatpak, or compiling it from the files available on their website).

I used debootstrap, to install a Debian jail and managed to install MakeMKV with no issues. It seems to run fine, except for one problem. Of course, it can not "see" the DVD-drive because it's in a Jail and therefore separated from the main system.

My question is, does anybody know how to give DVD-drive access to a jailed Linux application? I'm not concerned about the security implications, I just want to use this application in FreeBSD.

Thank you.
 
I wonder if anyone here is able to assist me with a pet project I have been working on? I have been trying to get MakeMKV working on FreeBSD 13.2. I have successfully installed the CLI version, thanks to a post I saw on here a while ago but, would really like to use the GUI version.

Recently, I came across a method for installing it directly on Debian Linux using a custom 3rd party repo (rather than installing a Flatpak, or compiling it from the files available on their website).

I used debootstrap, to install a Debian jail and managed to install MakeMKV with no issues. It seems to run fine, except for one problem. Of course, it can not "see" the DVD-drive because it's in a Jail and therefore separated from the main system.

My question is, does anybody know how to give DVD-drive access to a jailed Linux application? I'm not concerned about the security implications, I just want to use this application in FreeBSD.

Thank you.
Please see multimedia/makemkv
Also, please search the forums for makemkv, as using this program on FreeBSD has been discussed several times, most notably here.
 
Hi, thanks for the reply. As stated above, I have already seen the post that you linked above and successfully installed the CLI version of MakeMKV.

However, I have been trying to get the full GUI version running on FreeBSD. As I said, I have managed to get it installed and running in a Debian Linux jail on FreeBSD.

The only issue left to resolve is how to give the "jailed" application access to the computer's DVD-drive. If anyone has any insights they can share I would be very appreciative. Thanks.
 
Back
Top