How to fix three obscure BOINC problems in Ubuntu 24.01

After I upgraded to Ubuntu 24.04, I ran across some issues running BOINC. Searching for answers was frustrating. This describes the three obscure issues I finally resolved. I’m publishing this in the hope that someone else will find that this write-up provides them the answers they need.

The three issues:

  1. You try to start boincmgr, but nothing happens.
  2. The boinc-client spams the log file with “Authorization required, but no authorization protocol specified”.
  3. When running boincmgr, you get this: “gui_rpc_auth.cfg exists but can’t be read. See https://boinc.berkeley.edu/gui_rpc.php”.

First issue, boincmgr won’t start

This is simple. boincmgr creates a file in your home directory to tell it that it’s already running, even if it isn’t. To fix, do this: rm ~/'BOINC Manager-<username>. Of course, replace with your account username.

Do these prerequisites before moving onto the other issues

There are a couple of things you need to be sure of before problems can be fixed.

  1. You need to be a member of the boinc group
    1. All boinc files are owned by boinc:boinc which is the boinc user and the boinc group.
    2. But, you run boincmgr under your user. Therefore, you must add your user to the boinc group.
      1. Run this: sudo usermod -a -G boinc <userid>
      2. Confirm with this: groups <userid>. You should see “boinc” listed at the end.
      3. But, while you’ve created your intent to be in the boinc group, you aren’t yet because your shell session doesn’t know it yet. If you log out and log in your shell will know. But, if you want it to take effect immediately, just for the shell you’re currently running in, you can use: newgrp boinc. The next time you log in you won’t need to do any of this again.
  2. Run these two commands to make sure things are right with an important file. They aren’t always, for some reason.
    1. sudo chown boinc:boinc /var/lib/boinc/gui_rpc_auth.cfg
    2. sudo chmod 640 /var/lib/boinc/gui_rpc_auth.cfg
  3. To check that you are really in the boinc group, see if you can list the contents of the gui_rpc_auth.cfg file which you just set to be owned by boinc:boinc. Do not use “sudo” to run the test:
    cat /var/lib/boinc/gui_rpc_auth.cfg
    If you don’t get a permissions error, you are good.
  4. Is there something in the file that looks like a password? If so, skip the next step; otherwise, you need to put a password into this file.
  5. To add a password to the file, run this: pwgen 30 1 | sudo tee /var/lib/boinc/gui_rpc_auth.cfg. Or you can make one up and put it into the file.

Second issue, the Authorization Required error

When you enter sudo systemctl status boinc-client you see line after line of “Authorization required, but no authorization protocol specified”. This is the kind of obscure, unhelpful error message that makes you want to kick the developer who wrote this code. They knew exactly what the problem was when they caught the error, and they could have provided the true cause and even an explanation.

The error should have been more like, “BOINC is not authorized to see whether you are using your mouse and keyboard.” And maybe not repeating this a million times endlessly in the log would have been nice too.

This has to do with the boinc feature where you specify different settings for when the machine is in use and not in use. It’s actually more like when you are using it, and you are not using it.

This wasn’t a problem in earlier Ubuntu versions, but security is enhanced in 22.04 and above. The boinc client runs under user “boinc” and you run under your user. It simply means that the boinc user is no longer allowed to stalk you by default. You need to give it permission to know when you type and click by giving it permission to connect to your X server.

How to fix

It’s actually the X server that is blocking the boinc requests. There is a one-time temporary fix, which you can use to prove the solution, and then a permanent fix, because the one-time fix disappears when you log back in.

  1. Add permissions for the boinc user to see what you’re doing. Open a terminal and run this: xhost +si:localuser:boinc. “+” means add a rule. “si” means “server interpreted” rule. If this works you’ll see a message like, “localuser:boinc being added to access control list”. This will only grant the access in the current session.
  2. Test it. Run sudo systemctl restart boinc-client or “start” if it’s not running. Then sudo systemctl status boinc-client. The authorization errors should be gone.
  3. Make it permanent. There’s no way to have the X server remember this change, AFIK. So you’d want to automatically apply the temporary fix every time you log in. Assuming you are using the GNOME desktop, you can add this to the startup application list.
    1. Open the “Startup Applications” or “Startup Applications Preferences” tool from the system menu. For me, this meant running “Stacer”. Or you can click the Windows key and search for “Startup Applications” to run the Gnome tool.
    2. Click “Add” to create a new entry
    3. Make the Name: BOINC Xhost Permission,
      Comment: Grants BOINC client permission to query idle status, and the Command: xhost +si:localuser:boinc
    4. Save it. Now every time you log in, this command will be executed and the problem should be gone!

Third issue: gui_rpc_auth.cfg exists but can’t be read

If you are encountering this error when starting boincmgr, and you’ve done all the prerequisite steps above, then you’ve encountered what is clearly a boicmgr bug. It clearly knows the file exists because it found it, but the reason it can’t read it is because it can’t find it. Huh? This is why I think it’s a bug. It seems to forget where the gui_rpc_auth.cfg file is when it tries to read the password from it.

There’s an environment variable that should be used to point to it, but it doesn’t seem to work either.

The fix is to add an argument to the boincmgr command to remind it where the file is, at least this is the solution I came up with.

Try starting it with boincmgr -d /var/lib/boinc

If it works for you like it does for me, then this is the way you need to run it. If you don’t want to remember “-d /var/lib/boinc” and want an easier way to run it, you can create a script file, like “boincmgr-run”. Here’s how:

  1. If this path doesn’t exist, enter mkdir -p ~/bin
  2. Then: nano ~/bin/boincmgr-run
  3. Enter these two lines:
    1. #!/bin/bash
    2. /usr/bin/boincmgr -d /var/lib/boinc
  4. Do Ctrl+O, Enter, Ctrl+X to save the file and exit.
  5. Then: chmod +x ~/bin/boincmgr-run
  6. Then add ~/bin to your system PATH if not there already by modifying your .bashrc file:
    nano ~/.bashrc
    At the end, add this:
    export PATH="$HOME/bin:$PATH"
    Do Ctrl+O, Enter, Ctrl+X to save the file and exit
  7. Then apply the change: source ~/.bashrc
  8. Now you can run boincmgr-run from either a terminal window or by using Alt+F2

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top