tralph3 / ZeroTier-GUI

A Linux front-end for ZeroTier
GNU General Public License v3.0
211 stars 32 forks source link

Zerotier-gui not working correctly on Ubuntu 22.04 #25

Closed gerrymanley closed 10 months ago

gerrymanley commented 10 months ago

Hi Ralph, I followed your install instructions and after install, clicking on the Zerotier GUI icon goes as follows: 1 - Zerotier-One Service prompt appears The 'zerotier-one' service isn't running. Do you wish to grant root access to enable it? Yes - No 2 - clicking yes brings up password prompt 3 - entered password and clicked on authenticate 4 - Prompt windows closes and nothing more happens.


When I run this command /usr/bin/./zerotier-gui I have to follow the same steps as above and below is what I get in terminal:


/usr/bin/./zerotier-gui Traceback (most recent call last): File "/usr/bin/./zerotier-gui", line 1246, in mainWindow = MainWindow() File "/usr/bin/./zerotier-gui", line 156, in init self.refresh_networks() File "/usr/bin/./zerotier-gui", line 273, in refresh_networks networkData = self.get_networks_info() File "/usr/bin/./zerotier-gui", line 322, in get_networks_info return json.loads(check_output(["zerotier-cli", "-j", "listnetworks"])) File "/usr/lib/python3.10/subprocess.py", line 421, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.10/subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['zerotier-cli', '-j', 'listnetworks']' returned non-zero exit status 1.


I then ran sudo /usr/bin/zerotier-gui in terminal and the Zerotier-GUI opens and I can now work as before - join - leave.....all functions work correctly. Here is what I get in terminal after above command:


vms@vms-52492c98f8:~$ sudo /usr/bin/zerotier-gui can't invoke "event" command: application has been destroyed while executing "event generate $w <>" (procedure "ttk::ThemeChanged" line 6) invoked from within "ttk::ThemeChanged"


Note: Ubuntu 20.04 - no problems whatsoever I'm forced to go to Ubuntu 22.04 now

tralph3 commented 10 months ago

Have you downloaded the latest version of the program? It should have asked you to add your user to the zerotier-one group, since apparently zerotier has changed their documentation, and I can't find any reference to dropping a copy of the authtoken in the home directory of the user.

If you are using the latest version, then you could maybe try to go back to the previous commit and see if that works better?

gerrymanley commented 10 months ago

Yes Tomas, And i get the same results with both versions. I have 2 mini itx boards which i am using, One got a new install of 22.04 And the 2nd board got an upgrade from 20.04 to 22.04. I will update the issue with results of the latest zerotier-gui

On Fri, 10 Nov 2023, 18:50 Tomás Ralph, @.***> wrote:

Have you downloaded the latest version of the program? It should have asked you to add your user to the zerotier-one group, since apparently zerotier has changed their documentation, and I can't find any reference to dropping a copy of the authtoken in the home directory of the user.

If you are using the latest version, then you could maybe try to go back to the previous commit and see if that works better?

— Reply to this email directly, view it on GitHub https://github.com/tralph3/ZeroTier-GUI/issues/25#issuecomment-1806166332, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKH4QC2HAECYPF2JJWR2LTYDZSPPAVCNFSM6AAAAAA7GOCYNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGE3DMMZTGI . You are receiving this because you authored the thread.Message ID: @.***>

tralph3 commented 10 months ago

Well, in any case, if it works with sudo, the problem is that your regular user doesn't have access to zerotier, i.e., it can't execute zerotier commands. So, we should see why.

Run ls -la in your home directory, check if you have a file called .zeroTierOneAuthToken. If you don't, then check that you have a file called authtoken.secret in /var/lib/zerotier-one. Also, tell me the permissions of that list file, and to what group it belongs to.

gerrymanley commented 10 months ago

from home directory: -rw------- 1 vms vms 24 jul 11 12:21 .zeroTierOneAuthToken from /var/lib/zerotier-one: -rw------- 1 zerotier-one zerotier-one 24 nov 10 16:34 authtoken.secret drwx------ 4 zerotier-one zerotier-one 4096 nov 10 16:34 controller.d -rw-r--r-- 1 zerotier-one zerotier-one 141 nov 10 16:34 identity.public -rw------- 1 zerotier-one zerotier-one 270 nov 10 16:34 identity.secret -rw-r--r-- 1 zerotier-one zerotier-one 19495 nov 10 19:31 metrics.prom -rw------- 1 zerotier-one zerotier-one 24 nov 10 16:34 metricstoken.secret

tralph3 commented 10 months ago

Ok, so you have the authtoken, which is the old method which for some reason works at times, and other times it does not. You can see that the authtoken.secret in /var/lib/zerotier-one belongs to the zerotier-one group, but the group doesn't have permission to read or write to the file. The latest version of zerotier-gui takes care of this for you. If not, then you can manually add yourself to the group and change the permissions of the authtoken:

sudo usermod -aG zerotier-one youruser
sudo chmod 660 /var/lib/zerotier-one/authtoken.secret
sudo chmod 660 /var/lib/zerotier-one/identity.secret

That should be enough to use the program without root. Do note that you have to re-login in order for the new group to take effect.

gerrymanley commented 10 months ago

Tomas, You pointed me in the right direction. Since I did an upgrade from 20.04 to 22.04 I ended up with the original .zeroTierOneAuthToken in the home folder but I also removed and reinstalled zerotier. Once I deleted this and restarted and then clicked on zerotier-GUI icon it worked as it should and I got a new .zeroTierOneAuthToken in home folder. I will now install the latest version (tomorrow) and give you an update. Thanks again /Gerry

gerrymanley commented 10 months ago

Tomas, Big Thanks for your support. Everything is working as it should with the latest version.

SiNaPsEr0x commented 6 months ago

Ok, so you have the authtoken, which is the old method which for some reason works at times, and other times it does not. You can see that the authtoken.secret in /var/lib/zerotier-one belongs to the zerotier-one group, but the group doesn't have permission to read or write to the file. The latest version of zerotier-gui takes care of this for you. If not, then you can manually add yourself to the group and change the permissions of the authtoken:

sudo usermod -aG zerotier-one youruser
sudo chmod 660 /var/lib/zerotier-one/authtoken.secret
sudo chmod 660 /var/lib/zerotier-one/identity.secret

That should be enough to use the program without root. Do note that you have to re-login in order for the new group to take effect.

thanks this fix on KALI ... this only command thanks!