Linuxulator for the Win

Last month I wrote up an approach to working with two operating systems with a single-boot system. This approach consisted of invoking Linux binaries under chroot -n. It seemed more complicated than necessary, and it was.

The driving issue was trying to set up a Python environment to run Linux-only modules, because evidently most people in the Python world don’t know that systems other than Windows, Mac, and Linux exist.

But the approach was overwrought. The sour program that sources a file and in that environment executes the tail as a command is as useful as before. But the chroot -n is not needed.

To set up a Linux-based Python environment one need only call the Python directly from the installed Linux, something like this:

/compat/linux/bin/python3.11 -m venv venv

Activating that environment uses the Linux executable for Python and many things work exactly as expected directly from the FreeBSD host OS. That’s more like it! Linuxulator for the win!