LINUX(4)
π LINUX(4) π
okay bestie so this is the linux page from the Kernel Interfaces Manual β yes the whole vibe is "how do I run Linux stuff on FreeBSD without a whole virtual machine, because who has the RAM for that" πΈ
β¨ NAME β¨
linux β Linux ABI support π§
π SYNOPSIS π
so to compile support for this ABI into an i386 kernel, you drop this line into your kernel configuration file:
options COMPAT_LINUX
and for an amd64 kernel you use this one instead:
options COMPAT_LINUX32
OR, if you'd rather load the ABI as a module at boot time, you put this line into loader.conf(5):
linux_load="YES"
π DESCRIPTION π
The linux module gives you limited Linux ABI (application binary interface) compatibility, which means you can run a whole bunch of unmodified Linux applications and libraries without needing virtualization or emulation. no cap, it's just vibes β¨
some of the facilities it provides are:
- An image activator for correctly branded
elf(5)executable images - Special signal handling for activated images
- Linux to native system call translation
- Linux-specific system calls
okay important note bestie: dynamically linked Linux executables are gonna need a suitable environment in /compat/linux. That includes native Linux shared libraries, and Linux-specific virtual filesystems. π«Ά
to set that whole thing up, install the emulators/linux_base-c7 port or the linux_base-c7 package, and add this line to the rc.conf(5) file:
linux_enable="YES"
and if you want to avoid mounting Linux-specific filesystems at startup, also add this line:
linux_mounts_enable="NO"
π₯ SYSCTL VARIABLES π₯
the following variables are available as both sysctl(8) variables and loader(8) tunables:
compat.linux.debugβ enables debugging messages. Set it to0to silence them. Defaults to1. π€«compat.linux.default_openfilesβ the default softopenfilesresource limit for Linux applications. Set it to-1to disable the limit entirely. Defaults to1024.compat.linux.emul_pathβ path to the Linux run-time environment. Defaults to/compat/linux. πcompat.linux.osnameβ the Linux kernel operating system name.compat.linux.osreleaseβ the Linux kernel operating system release. ngl, changing this to something else is discouraged on non-development systems, because it may change the way Linux programs work. Recent versions of GNU libc are known to use different syscalls depending on the value of this sysctl. πcompat.linux.oss_versionβ the Linux Open Sound System version. πcompat.linux.preserve_vstatusβ when set to1, it prevents Linux applications from resetting thetermios(4)VSTATUSsetting. From a user perspective, this makesSIGINFOwork for Linux executables. Defaults to0.
π FILES π
/compat/linuxβ minimal Linux run-time environment/compat/linux/devβ device file system, seedevfs(5)/compat/linux/dev/fdβ file descriptor file system mounted with thelinrdlnkoption, seefdescfs(5)/compat/linux/dev/shmβ in-memory file system, seetmpfs(5)/compat/linux/procβ Linux process file system, seelinprocfs(5)/compat/linux/sysβ Linux kernel objects file system, seelinsysfs(5)
π¦ SEE ALSO π¦
brandelf(1), pty(4), elf(5), fdescfs(5), linprocfs(5), linsysfs(5), tmpfs(5)
β HISTORY β
Linux ABI support first appeared in FreeBSD 2.1. the way it's been serving looks since forever π
π BUGS π
Support for some of the Linux-specific system calls and system call arguments is missing. yeah. not everything made it to the group chat, sorry bestie π
and that's the whole page!! mwah π this one came from Debian, dated July 5, 2020 β stay hydrated, back up your rc.conf, and go run some Linux binaries on your FreeBSD box like the icon you are πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2000 Sheldon Hearn
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms