Skip to content

Folding-at-Home on FreeBSD in an iocage jail

Given the urgency for research on the novel COVID-19 virus, I have been running Rosetta@Home and Folding@Home on my Windows machine.

BOINC (which powers Rosetta@Home) runs reasonably well on FreeBSD with some special instructions.

I also wanted to run Folding@Home. I currently have a Linux VM in bhyve to do so. But, that is rather inefficient. How bad would it be to run it in a Linux compat jail? Turns out, it’s not too bad.

Since BOINC is also linux-compat, I basically followed the BOINC instructions (translating the instructions from FreeNAS to stock FreeBSD iocage).

I then installed (within the jail) the rather newly-refreshed biology/linux-foldingathome port.

Here are step-by-step instructions. I am using VNET jails and assign hosts in the jail to the 192.168.2.0/24 network attaching to a vnet1.X (X picked by iocage) interface created on the fly by iocage.

Get a console to the jail with:

Within the jail (root console from previous command), I ran

Then, it’s time to build the new biology/linux-foldingathome, which basically encapsulates the recipe here.

To save a build dependency, I used the same process as the BOINC instructions: use pkg to get as many as possible. In this case, linux-base-c7 is the only one:

Now, I edited /usr/local/etc/fahclient/config.xml and updated my username and passkey. I deferred joining Team FreeBSD (team #11743) until I know things are working correctly.

I also added the following lines to the config file to allow access within my trusted network (192.168.1.0/24):

<allow> 127.0.0.1 192.168.1.0/24</allow>
<web-allow>127.0.0.1 192.168.1.0/24</web-allow>
<password>p@33w0r6</password>

Enable the fahclient service

Now, exit the jail’s console. For some reason I did not have linsysfs loaded (yet), so I had to load it. (I am copying all the things that were previously loaded in the BOINC instructions here):

To make it permanent, add load_linsysfs=”YES” to /boot/loader.conf, linux_load=”YES” to /etc/rc.conf, and security.bsd.unprivileged_idprio=1 to /etc/sysctl.conf. (I already had it added.)

Set up the correct entries in the Jail’s fstab:

Update to look as follows (change the absolute path to correspond to where your iocage jail sits in the host environment):

Now, it’s time to try it out:

Hopefully, you should see something informative, and your CPU usage should start going up with assigned work.

See my stats here.

Be the first to like.