How To Multiple boinc clients on the same computer

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

StefanR5R

Elite Member
Dec 10, 2016
5,498
7,786
136
The command
boinccmd --host HOSTNAME:PORTNUMBER --passwd PASSWORD --set_host_info MODELNAME
gives a "model" name to the client instance. After you triggered a project update (or the client issued a scheduler request for its own reason), a new column with the heading "Model" appears in the "Computers on this account" table, showing the MODELNAME string which you set for this client instance.

In the individual host details page, this string is shown in a row with the heading "Product name".
Sadly, PrimeGrid does not show this in either the computers table or the computer details. One or another project with old BOINC server versions don't show it either. I guess PrimeGrid's server version is not overly old, but quite customized, and this feature slipped through the cracks or was actively disabled.
 
  • Like
Reactions: TennesseeTony

Icecold

Golden Member
Nov 15, 2004
1,090
1,008
146
Mint 20 seems to have messed up my quick guide. I tried finding the correct directory paths for some time, but failed. Help.
Which step on your quick guide are you having issues with the directory paths? I followed the steps the same on Mint 19 and Mint 20 and it seemed to work the same.
 

TennesseeTony

Elite Member
Aug 2, 2003
4,209
3,634
136
www.google.com
I probably need to revisit the multiple instances with less all natural muscle relaxer made from potatoes/corn in my system. ;) It will be too late for a bunker this round though.
 
  • Like
Reactions: Icecold

Fardringle

Diamond Member
Oct 23, 2000
9,188
753
126
Maybe a dumb question, but how to I get BoincTasks to communicate with multiple clients on a computer? It sees the "main" client just fine, but I've tried searching automatically and tried manually adding the second client with the PC's IP address and with (and without) the port number of the second client, but it doesn't connect.
 

emoga

Member
May 13, 2018
188
301
136
the PC's IP address and with (and without) the port number of the second client, but it doesn't connect.
This is all on the same computer?
did you put a number after localhost? ex. localhost2 under the IP address column.
 
Last edited:

Fardringle

Diamond Member
Oct 23, 2000
9,188
753
126
It's on a second computer here at home, so I put the computer's IP address there.
 

emoga

Member
May 13, 2018
188
301
136
On the other computer, does it have the
Code:
<allow_remote_gui_rpc>1</allow_remote_gui_rpc>
tag in its cc_config.xml?
Some people claim it can work without it, however I haven't been able to connect with Boinctasks without it.
 

Fardringle

Diamond Member
Oct 23, 2000
9,188
753
126
On the other computer, does it have the
Code:
<allow_remote_gui_rpc>1</allow_remote_gui_rpc>
tag in its cc_config.xml?
Some people claim it can work without it, however I haven't been able to connect with Boinctasks without it.
Yes. The cc_config.xml file has that line in the main client DATA folder and in the second client's DATA folder. But this is my first time trying to connect to a second client on a computer so I'm not sure what I'm missing.
 

StefanR5R

Elite Member
Dec 10, 2016
5,498
7,786
136
How to add multiple client instances in BoincTasks
Maybe a dumb question, but how to I get BoincTasks to communicate with multiple clients on a computer?
Mmonnin's Guide, linked to in post #2, has got the info how to enter the other clients via BoincTasks' GUI.

I have two optional tweaks to add to that:
  • Since all of my computers have multiple clients, I use BoincTasks' group feature and created one group for each computer.
  • Since some of my computers have many multiple clients, entering them into BoincTasks' GUI became boring at some point. I stopped BoincTasks, loaded the file C:\Users\yournamehere\AppData\Roaming\eFMer\BoincTasks\computers.xml into a capable text editor, created more <computer> blocks, saved the file, and restarted BoincTasks.
XML:
<computers>
<computer>
    <id_name>m1</id_name>
    <id_group>m1</id_group>
    <ip>192.168.0.61</ip>
    <mac></mac>
    <checked>1</checked>
    <port>-1</port>
    <password>abc123</password>
    <encryption>no</encryption>
</computer>
<computer>
    <id_name>m1.00</id_name>
    <id_group>m1</id_group>
    <ip>192.168.0.61</ip>
    <mac></mac>
    <checked>1</checked>
    <port>40000</port>
    <password>abc123</password>
    <encryption>no</encryption>
</computer>
<computer>
    <id_name>m1.01</id_name>
    <id_group>m1</id_group>
    <ip>192.168.0.61</ip>
    <mac></mac>
    <checked>1</checked>
    <port>40001</port>
    <password>abc123</password>
    <encryption>no</encryption>
</computer>
<computer>
    <id_name>m1.02</id_name>
    <id_group>m1</id_group>
    <ip>192.168.0.61</ip>
    <mac></mac>
    <checked>1</checked>
    <port>40002</port>
    <password>abc123</password>
    <encryption>no</encryption>
</computer>
<!-- etc. pp. -->
</computers>

boinctasks.png

It sees the "main" client just fine, but I've tried searching automatically and tried manually adding the second client with the PC's IP address and with (and without) the port number of the second client, but it doesn't connect.
Can boinccmd and boincmgr connect a) locally from the computer with the extra client, b) remotely from the computer which is dedicated to run BoincTasks?

Does the computer with the extra client have a so-called firewall on it? If so, it needs to allow inbound TCP traffic to the port of the client.
 
Last edited:
  • Like
Reactions: TennesseeTony

Fardringle

Diamond Member
Oct 23, 2000
9,188
753
126
How to add multiple client instances in BoincTasks

Mmonnin's Guide, linked to in post #2, has got the info how to enter the other clients via BoincTasks' GUI.

I have two optional tweaks to add to that:
  • Since all of my computers have multiple clients, I use BoincTasks' group feature and created one group for each computer.
  • Since some of my computers have many multiple clients, entering them into BoincTasks' GUI became boring at some point. I stopped BoincTasks, loaded the file C:\Users\yournamehere\AppData\Roaming\eFMer\BoincTasks\computers.xml into a capable text editor, created more <computer> blocks, saved the file, and restarted BoincTasks.
I followed that. The only difference between his guide and what I did is that I used the IP address instead of LOCALHOST since it's not a local host.

Groups would definitely be helpful with the systems you have. I only have a few so it's not as important but I might play with it later. :)

Can boinccmd and boincmgr connect a) locally from the computer with the extra client, b) remotely from the computer which is dedicated to run BoincTasks?
Locally works just fine for both clients. Remote works fine for the main client but the File>Select Computer doesn't have an option to specify a port number to try to connect to the second instance. I haven't used the command line so I'm not sure what syntax to use to try to connect.

Does the computer with the extra client have a so-called firewall on it? If so, it needs to allow inbound TCP traffic to the port of the client.
The standard Windows 10 firewall is running. The port for the second instance is open to allow all incoming traffic. I tried completely disabling the firewall as well.
 

StefanR5R

Elite Member
Dec 10, 2016
5,498
7,786
136
Can boinccmd and boincmgr connect a) locally from the computer with the extra client, b) remotely from the computer which is dedicated to run BoincTasks?
Locally works just fine for both clients. Remote works fine for the main client but the File>Select Computer doesn't have an option to specify a port number to try to connect to the second instance.
In the dialogue which comes up after "File" -> "Select computer...", enter hostname_or_address:port_number in the Host name box.

Alternatively, start boincmgr from a dedicated shortcut which you created as described in mmonnin's guide.

I haven't used the command line so I'm not sure what syntax to use to try to connect.
On Windows:
"C:\Program Files\BOINC\boinccmd" --host hostname_or_address:port_number --passwd your_password the desired command

Instead of "the desired command", try --client_version as a basic status query, and then --read_cc_config as a control command.

Omit the --passwd your_password part if you configured the client instance to accept remote control RPCs without password.
 
  • Like
Reactions: biodoc

StefanR5R

Elite Member
Dec 10, 2016
5,498
7,786
136
BTW, I often prefer to start boincmgr from the command line with respective -n and -g parameters, over using the "Select computer" menu in an already started manager.
 

Fardringle

Diamond Member
Oct 23, 2000
9,188
753
126
It seems I've broken that second instance while trying to make remote connections work. BOINC Manager on the local PC doesn't even work to connect to the instance any more. And the command prompt functions say they can't connect to the system. Still works fine on the main instance, though.

Maybe I'll just abandon the idea of trying to bunker CPU work while letting the GPU stay actively connected on that machine. It's pretty old and slow anyway...
 

StefanR5R

Elite Member
Dec 10, 2016
5,498
7,786
136
Random thoughts:
Something in the client config which is required for remote access is amiss.
Or the second instance is not actually running. (Check with taskmanager.)
Or it is running but is doing something which keeps it from responding to RPCs. (Possible, but highly unlikely.)
 

Fardringle

Diamond Member
Oct 23, 2000
9,188
753
126
Yeah, I don't know how I broke it, but I definitely broke it. :)

I just deleted that instance since it can't be connected/started/managed any more. I might try again later, when I feel in the mood to figure it out...
 

StefanR5R

Elite Member
Dec 10, 2016
5,498
7,786
136
User credentials of the client
mmonnin said:
sudo /usr/bin/boinc --daemon --allow_multiple_clients --gui_rpc_port 31422 --dir /var/lib/boinc2
This is really, really bad advice perpetuated from mmonnin's guide. This way, sudo runs the client as root user, which is bad practice.¹

Best practice is to run the client as the boinc pseudo-user:

0. Stop the extra client, if it is currently running. E.g.
boinccmd --host localhost:31422 --passwd XXXXXXXX --quit
(You need to state the correct remote GUI password.)

1. Change ownership of the data directory to the boinc pseudo user.
sudo chown -R boinc:boinc /var/lib/boinc2
You have to do this only once, then never again.²

2. Start the client as pseudo-user boinc.
sudo -u boinc /usr/bin/boinc --daemon --allow_multiple_clients --gui_rpc_port 31422 --dir /var/lib/boinc2

________
¹) My own Linux-related howto shows how to run the client as the currently logged-in user. Depending on who that user is, this may be bad practice too.
²) Well, you do have to repeat it actually whenever you create additional files within the data directory after the fact.
 
Last edited:

StefanR5R

Elite Member
Dec 10, 2016
5,498
7,786
136
How to auto-start extra clients at computer reboot

If you wish to have one or several of the extra client instances started automatically when the computer boots, you can rather trivially add it as a system service (...on Linux).

Here is something which I once used on Debian 9:
Bash:
sudo dd of=/lib/systemd/system/boinc-client_40000.service << EOF
[Unit]
Description=Berkeley Open Infrastructure Network Computing Client 40000
After=network.target

[Service]
Nice=10
User=boinc
PermissionsStartOnly=yes
ExecStartPre=/usr/bin/touch /var/log/boinc_40000.log /var/log/boincerr_40000.log
ExecStartPre=/bin/chown boinc:boinc /var/log/boinc_40000.log /var/log/boincerr_40000.log
ExecStart=/bin/sh -c '/usr/bin/boinc --gui_rpc_port 40000 --dir /var/lib/boinc-client_40000 >/var/log/boinc_40000.log 2>/var/log/boincerr_40000.log'
ExecReload=/usr/bin/boinccmd --host localhost:40000 --read_cc_config
ExecStopPost=/bin/rm -f /var/lib/boinc-client_40000/lockfile
IOSchedulingClass=idle

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl enable boinc-client_40000
sudo service boinc-client_40000 start

In this example, the data directory was called /var/lib/boinc-client_40000, and the directory and all its contents were owned by the pseudo-user boinc.

I came up with the systemd unit file by looking at the existing /lib/systemd/system/boinc-client.service. Monkey see, monkey do.

Note, a more proper place for the systemd unit file would probably have been /etc/systemd/system/. It's a local customization after all, not a packaged service file.

Note to self, to be done:
  • Verify how the unit file should look like on current popular distributions, e.g. Mint 20.
  • Demonstrate how to use one single template unit file for arbitrary many instances.
Documentation: man systemd.unit, man systemd.service, man systemd.exec.
 
Last edited:

StefanR5R

Elite Member
Dec 10, 2016
5,498
7,786
136
2.2 – Where to put the data directory?
[...] let's give each of those subdirectories the same name as the port number.​
[...]
5.1 – Add a start script for the secondary client.
[...] The way I wrote it above with the $(...) directives, you can put an identical copy into ~/BOINC/40001 etc. later, and it will just work with that directory and portname without change.​
This setup is quite convenient, if I may say so myself. I just needed to move some data directories to a different computer. This other computer already has clients with 4000x port number running. I renamed the imported directories on the external disk to 5000x, ran the /mnt/ExternalData/BOINC/5000x/_start.sh scripts, and off I go with additional clients at 5000x ports, working on the imported tasks.
 
  • Like
Reactions: biodoc

StefanR5R

Elite Member
Dec 10, 2016
5,498
7,786
136
Step 2, make a few decisions about the secondary client(s)

Don't get worried now. All of these decisions can be revised later, anytime.
2.2 – Where to put the data directory?
Choose a location whose name doesn't embarrass you if others saw it. This goes for the names of its parent directories too.
Why? — Some science applications log the full path to the boinc data directory in stderr.txt which is uploaded with the result after a task was finished. That way, the whole world can see it.