Page 1 of 2

Headless Linux Box

Posted: Sun Sep 12, 2021 9:59 pm
by DoctorBob
I am running Mint Linux 20.2 on an old laptop. Running the OS headless. I access it via ssh (putty).
I can not see what is going on in the FAH client.

Is there a way to access FAH Client that is text based?
Is there a txt based non-javascript client page that will work with elinks or lynx web browsers?
Or is there client software that work with a headless installation?
Or is there a way to access the web based FAH Client or FAH Viewer from another PC?

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 1:16 am
by bikeaddict
FAHControl can be configured to monitor and control a remote client. When adding a client, the Connection tab allows the hostname or IP address to be added. The headless client should be configured in /etc/fahclient/config.xml with a password and to allow an IP address or range of addresses to connect. You will also need to allow incoming connections on port 36330.

It would be easiest to temporarily run a desktop environment on the laptop and run FAHControl locally to configure everything on the Remote Access tab so you don't have to edit config.xml directly.

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 2:57 am
by DoctorBob
Here is my /etc/fahclient/config.xml file:

<config>
<!-- Client Control -->
<fold-anon v='true'/>

<!-- Folding Slot Configuration -->
<gpu v='false'/>

<!-- Slot Control -->
<power v='light'/>

<!-- User Information -->
<passkey v='xxxxxxxxxxxxxxxxxxxxxxxxxx'/>
<user v='DoctorBob'/>

<!-- Folding Slots -->
<slot id='0' type='CPU'/>
</config>

I see that this file does not show all supported setting as commented out, it just shows the active ones.
What are the required parameters needed to be added here (headless, connection address(s), port number)?
And once set does the laptop need to be rebooted or a service reloaded?

BTW, is it possible to get more control over the CPUs?
Medium and Full settings really drive the laptop into thermal meltdown.
I am currently running the client set to CPU light.
This is better but the client uses only one CPU and drives it at 100%.
I would like to get both CPUs going and throttle them back to achieve a good balance between number crunching and thermal levels.

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 3:24 am
by aetch
Get the IP address of one of your computers, if should look something like 192.168.0.23, we're only interesting in the first 3 parts "192.168.0".

Add the following lines to your config, if your IP address is different then replace the "192.168.0" with whatever you have.

Code: Select all

  <!-- HTTP Server -->
  <allow v='192.168.0.0/24'/>
  <!-- Remote Command Server -->
  <command-allow-no-pass v='192.168.0.0/24'/>
Reboot your folding laptop. This is a permissions thing, FAH doesn't work quite right if you just stop and start it from the command line.

This allows other computers to remotely access the client on your laptop while restricting that access to only computers on your local network.

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 3:30 am
by DoctorBob
Thank you, aetch,

Yes, my LAN range is 192.168.0.0/24
I added your code to my /etc/fahclient/config.xml file and rebooted the laptop.

Do I point my web browser at the laptop running the client using the default port number?
http://192.168.0.107:36330


Laptop is now back up and running. All I see in my web browser is:

[H[2JWelcome to the FAHClient command server.
>

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 3:56 am
by aetch
Web browser, no.
We use the advanced control panel which can be setup to monitor and control multiple remote clients. It also gives you very granular control over what a specific client does. Things which the web interface is not capable of.

On your windows laptop install the FAH Client.
The installation package contains the client, the viewer and the advanced control panel.
During install you will see a number of options.
To ensure the client is installed but does not run make sure you do the following:-
*). select "Custom Install (advanced)",
*). select "Start Manually. (Expert)"
*). remove the tick from "Start Folding @ Home"

On your Windows machine open the advanced control panel.
Start button -> Folding@home -> FAHControl

Bottom left of window "Add"
Name - the name you want to refer to your folding machine as
Address - the name or IP address you currently enter into your web interface
SAVE

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 4:43 am
by DoctorBob
Brilliant! Thank you, aetch.

Yes, much better then the web based interface and I can access it from my main PC or any other PC on my network.
I should now be able to sort out the rest of my questions I asked earlier.

Cheers,

DoctorBob

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 9:36 am
by DoctorBob
Okay, I was not too successful finding information regarding CPU control.

Here is my question from the previous post:
BTW, is it possible to get more control over the CPUs?
Medium and Full settings really drives the laptop into thermal meltdown.
I am currently running the client set to CPU light.
This is better but the client uses only one CPU and drives it at 100%.
I would like to get both CPUs going and throttle them back to achieve a good balance between number crunching and thermal levels.
FAHControl document page is not available (404):
https://foldingathome.org/projects/FAHC ... ?lng=en-US

I had a look at Configure --> Slots but not sure how to get both CPU cores going and control the amount of CPU usage.

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 10:50 am
by gunnarre
Look here instead: https://foldingathome.org/support/faq/i ... ion-guide/

In short, you can go to the Slots tab in the configuration, select the existing CPU slot, click Edit and change the number of threads from -1 (follow the slider) to the number of threads you want to run. Then save the setting. The setting will take effect when the next work unit is requested, and you'll get a WU for the number of threads you set - or lower - depending on what the server has available.

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 1:09 pm
by aetch
Slide your "Folding Power" slider to "Full"

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 9:47 pm
by calxalot
You can set the number of cores to use, but cannot set the percentage of cpu to use.

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 10:46 pm
by DoctorBob
calxalot wrote:You can set the number of cores to use, but cannot set the percentage of cpu to use.
That makes it tricky. I will have to leave Folder Power set to Light.

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 11:24 pm
by bikeaddict
A utility like cpulimit or cputool could be used to limit CPU usage. It would need to be run in a shell script under cron. The script would have to use pgrep to get the process ID.

Re: Headless Linux Box

Posted: Mon Sep 13, 2021 11:24 pm
by calxalot
There is a 3rd party tool for Linux you might want to try.

https://github.com/opsengine/cpulimit

Re: Headless Linux Box

Posted: Tue Sep 14, 2021 12:54 am
by calxalot
Your Linux distribution may have kernel support for limiting cpu time.

This might be useful:
https://linuxhint.com/limit_cpu_usage_process_linux/