is there any possibility to run Linux programs on the opnsense?

Started by metcenger, July 24, 2020, 02:54:24 PM

Previous topic - Next topic
I know it is possible to run Linux software on the FreeBSD by enable Linux compability on it. Does opnsense have the same option?
I tryed to install package linux_base-c7 on the opnsense wo success. There is no this package for opnsense.

No this doesn't work with HBSD. I also had a talk to franco 2 years ago when I planned to use commercial AV products via Linux ABI

Is it possible to run compibility on the OPNsense? Like I made on the freeBSD?

Quote from: mimugmail on July 24, 2020, 04:28:59 PM
No this doesn't work with HBSD. I also had a talk to franco 2 years ago when I planned to use commercial AV products via Linux ABI

No ... this doesn't work with HBSD .. which is OPNsense

The Linuxulator exists on HardenedBSD, but is not enabled by default. For 32-bit Linux binaries, a custom kernel and userland would need to be compiled/installed. 64-bit Linux binaries should run fine if linux64.ko is loaded. You will need to disable ASLR for that particular Linux binary (use hbsdcontrol for that).

As far as the linux* packages are concerned, OPNsense only ships with the packages it needs. Since OPNsense doesn't rely on anything that needs the linux* packages, they aren't built and are not in OPNsense's package repo. You'd want to enable the FreeBSD package repo and get the linux* packages from there.

Thanks for information.
Could you explain with more details how to enable this Linuxulator from hbsdcontrol. How to run hbsdcontrol ?
I want to use 64-bit Linux library.

Quote from: lattera on July 24, 2020, 05:06:21 PM
64-bit Linux binaries should run fine if linux64.ko is loaded. You will need to disable ASLR for that particular Linux binary (use hbsdcontrol for that).

Hi again.
Could you , pls, explain how to do it? As I read,
Adding (FreeBSD, HardenedBSD, ..) repositories in /usr/local/etc/pkg/repos/ manually is not supported and usually lead to unexpected issues

Quote from: metcenger on July 27, 2020, 12:18:17 PM
As I read,
Adding (FreeBSD, HardenedBSD, ..) repositories in /usr/local/etc/pkg/repos/ manually is not supported and usually lead to unexpected issues

There is no stable way to add it, if you insist you have to go the hacky way and do the modifications on your own.

I enabled load pkgs from FreeBSD repo and now I can download and run
pkg install linux_base-c7

But got an error:
Cannot install package: kernel missing 64-bit Linux support

Any idea how to enable this 64-bit Linux support?

I beleive that possible to run this compatibility for Linux software becouse I made it for FreeBSD. Almost same OS.

You need to recompile the kernel, be aware, this will not get into base system, so with every kernel update you have to ship your custom kernel again.

Here you can build your custom kernel:
https://github.com/opnsense/tools