Target OPNsense during compliation from a different machine

Started by ikeruga, September 02, 2026, 12:46:50 PM

Previous topic - Next topic
Hey folks,

I've been using OPNsense since late last year. It's been nice to use, but when I've wanted to try more complex things that require downloading ports and compiling them, the low-power of the CPU is very noticeable. Is there any way to set up a VM or to target OPNsense on a Windows machine? The idea being that I compile what I need using my laptop's much faster CPU and then just copy over the binaries over for installation and avoid a 5+ hour compile. I guess I could set up something using FreeBSD, but given that OPNsense has its own packages, I'd like to try to find a way to directly target OPNsense.

Cheers!

It depends on what you want to compile and how you want to install it.

Ideally, you would use a FreeBSD VM with the ports tree to compile and package the software. Then you can simply copy the package over and install it with pkg.

If you just want to compile something random, e.g. a Go program or something similar, and don't want/need to install it as a package, you can usually compile it on your existing system with the target OS set to FreeBSD and then just copy the binary over.

Thank you, allddd!

For anyone else who is interested in setting something like this up and needs a little more guidance, I finally found a guide that goes further into the details I am interested in here:
https://www.8labs.id/guides/opnsense/building-packages/

It is essentially the same as what allddd said, setting up a FreeBSD VM or physical machine as a build machine to produce the packages to install on the OPNsense router, just with all the specifics included.

You're welcome :) AFAIK there's nothing really OPNsense specific when it comes to packaging, other than the fact that they cloned the upstream ports tree and added some internal packages.

That's probably also why there isn't really any OPNsense specific docs for this. The FreeBSD Porter's Handbook covers this stuff in quite a lot of detail and I'd generally recommend it over any other guide, although it's fair to say it's not exactly the most beginner friendly read.