With the worldwide outbreak of the coronavirus the Folding@home project has seen a massive influx of new users donating their computer’s idle CPU cycles to run simulations of protein dynamics in order to help find treatments for diseases such as coronavirus, cancer, alzheimer’s, and more.
The people of VMware were kind enough to develop a ‘fling’ which makes it super easy to donate idle CPU cycles on existing installations running VMware Fusion, Workstation or vSphere. It’s a simple OVA deployment which only requires you to fill in a couple of parameters such as your F@h user, passkey and team. Check it out here: https://flings.vmware.com/vmware-appliance-for-folding-home
This is an excellent way to maximize the utilization of existing installations. However regardless of the hypervisor type this layer still adds a bit of latency. If you have a machine that doesn’t necessarily need to run a hypervisor and you want to squeeze every bit of CPU power out of your machine, maybe this solution is of interest for you. The beauty of this solution is that is is completely stateless. This means you can boot from an ISO file, run the application from memory and when you’re done return to the operating system you originally installed on the server.
So how exactly do you accomplish this? Well, simply follow these steps.
First off, download a copy of Grml Live Linux from grml.org. Most servers allow you to boot from a remote management solution such as IPMI, ILO, iDRAC or CIMC. The details on how to mount an ISO file for each of these solutions varies a bit, so I won’t describe those in detail. Once you booted from the Grml ISO execute these steps.
- Select ‘
grml64-full - advanced options‘ from the boot menu.
- Then select select ‘
grml64-full - copy whole medium to RAM‘.
- Wait for the contents of the ISO to be copied to RAM.
- Then configure your network interface by running ‘
grml-network‘. This is a super simple setup script which even allows you to configure VLAN interfaces and static or DHCP IP addressing.
- When your network interface is fully configured you can start the ssh daemon by simply typing ‘
service ssh start‘.
- And assign a password to the root user with ‘
- Execute the next code block either via SSH or the console (I sure hope it has a copy-paste function).
- Make sure you enter your own user, team and passkey details before you execute the code block.
Credits for this code go to Gergely Imreh who wrote an article about setting up Folding@Home on AWS.
sudo mkdir /etc/fahclient/ || true
sudo chmod 777 /etc/fahclient
sudo cat <<EOF > "/etc/fahclient/config.xml"
<!-- Folding Slot Configuration -->
<!-- Slot Control -->
<!-- User Information -->
<!-- Folding Slots -->
<slot id='0' type='CPU'/>
sudo dpkg -i --force-confdef --force-depends fahclient_7.4.4_amd64.deb
- Confirm you want to start the client automatically. And although you’ll see some error messages on the screen when you finish the fahclient will probably run just fine.
- Finally, to show what your server is working on enter the following text on the console. It will show roughly the same output as the F@h fling from VMware.
tmux new-session -d 'htop'
tmux split-window -p 10 -v 'tail -f /var/lib/fahclient/log.txt'
tmux -2 attach-session -d
And that’s it! You are now running the Folding@home client at maximum capacity!
When you are done you simply reboot and continue using the OS that you originally installed on that server.