Remote connect to Ubuntu22.04 Gnome: X11 error: connection refused (login as root) #1245

Closed
opened 2026-02-20 23:21:49 -05:00 by deekerman · 8 comments
Owner

Originally created by @btdan on GitHub (Jan 17, 2023).

Describe the bug you encountered:
The rustdesk is installed in Ubuntu22.04 ,and the file /etc/systemd/system/rustdesk.service is as default, just as follows:
------------------------ The begin of file /etc/systemd/system/rustdesk.service ---------------
[Unit]
Description=RustDesk
Requires=network.target
After=systemd-user-sessions.service

[Service]
Type=simple
ExecStart=/usr/bin/rustdesk --service
PIDFile=/var/run/rustdesk.pid
KillMode=mixed
TimeoutStopSec=30
User=root
LimitNOFILE=100000

[Install]
WantedBy=multi-user.target
------------------------ The end of file /etc/systemd/system/rustdesk.service ---------------
And then I restart the Ubuntu22.04 system.I can find the rustdesk process with ps command,just as follows:
截图 2023-01-17 21-04-58

But when I want to connect to this ubuntu system, I get the error tip : X11 error: connection refused.
the screenshot is just as follows:
微信图片_20230117213204

That is to say, I can not connect to the ubuntu22.04 system.
But when I kill all rustdesk process, and then start rustdesk again in the terminal command.
And I can connect to the ubuntu22.04 system.

What did you expect to happen instead?
I want to connect to the ubuntu22.04 system successfully without restarting rustdesk. In this instance, I can connect to the ubuntu22.04 system remotely .
Can anyone tell me how to solve this problem?
By the way, I login the gnome of ubuntu22.04 as root user.
I also find this post https://github.com/rustdesk/rustdesk/issues/2468
And then modify the /usr/bin/rustdesk file just as follows:
I know how to fix it.Just install bless(apt-get install bless) and (bless /usr/bin/rustdesk), and search "geteuid" in text and change it with "getppid" , and save , reopen the rustdesk finally.It's OK to connect! I think it's the root login's problem.

But it does not work at all.
...

How did you install RustDesk?
I just download the xxx.deb file from this website
and then dpkg -i xxx.deb to install RustDesk.

Thanks very much for your help .Best wishes.


RustDesk version and environment
RustDesk 1.1.9 Ubuntu22.04

Originally created by @btdan on GitHub (Jan 17, 2023). <!-- Hey there, thank you for creating an issue! --> **Describe the bug you encountered:** The rustdesk is installed in Ubuntu22.04 ,and the file /etc/systemd/system/rustdesk.service is as default, just as follows:\ ------------------------ The begin of file /etc/systemd/system/rustdesk.service --------------- [Unit] Description=RustDesk Requires=network.target After=systemd-user-sessions.service [Service] Type=simple ExecStart=/usr/bin/rustdesk --service PIDFile=/var/run/rustdesk.pid KillMode=mixed TimeoutStopSec=30 User=root LimitNOFILE=100000 [Install] WantedBy=multi-user.target ------------------------ The end of file /etc/systemd/system/rustdesk.service --------------- And then I restart the Ubuntu22.04 system.I can find the rustdesk process with ps command,just as follows: ![截图 2023-01-17 21-04-58](https://user-images.githubusercontent.com/5276480/212911423-21e6bd7e-d823-41f1-912e-17dffc0e7ef2.png) But when I want to connect to this ubuntu system, I get the error tip : X11 error: connection refused. the screenshot is just as follows: ![微信图片_20230117213204](https://user-images.githubusercontent.com/5276480/212912053-af918c16-d0e9-4437-9d0e-621cda49473f.png) That is to say, I can not connect to the ubuntu22.04 system. But when I kill all rustdesk process, and then start rustdesk again in the terminal command. And I can connect to the ubuntu22.04 system. **What did you expect to happen instead?** I want to connect to the ubuntu22.04 system successfully without restarting rustdesk. In this instance, I can connect to the ubuntu22.04 system remotely . Can anyone tell me how to solve this problem? By the way, I login the gnome of ubuntu22.04 as root user. I also find this post https://github.com/rustdesk/rustdesk/issues/2468 And then modify the /usr/bin/rustdesk file just as follows: I know how to fix it.Just install bless(apt-get install bless) and (bless /usr/bin/rustdesk), and search "geteuid" in text and change it with "getppid" , and save , reopen the rustdesk finally.It's OK to connect! I think it's the root login's problem. But it does not work at all. ... **How did you install `RustDesk`?** I just download the xxx.deb file from this website and then dpkg -i xxx.deb to install RustDesk. Thanks very much for your help .Best wishes. --- **RustDesk version and environment** RustDesk 1.1.9 Ubuntu22.04 <!-- In order to reproduce your issue, please add some information about the environment in which you're running RustDesk. -->
deekerman 2026-02-20 23:21:49 -05:00
Author
Owner

@rustdesk commented on GitHub (Jan 17, 2023):

Try out nightly build please. https://github.com/rustdesk/rustdesk/releases/tag/nightly

@rustdesk commented on GitHub (Jan 17, 2023): Try out nightly build please. https://github.com/rustdesk/rustdesk/releases/tag/nightly
Author
Owner

@btdan commented on GitHub (Jan 18, 2023):

Thanks very much for your reply.
But After I reinstall the nightly build. The rustdesk show version 1.2.0
And then I restart the Ubuntu22.04 system.
I can connect to the ubuntu22.04 through rustdesk , but after I type the password in rustdesk and login ubuntu22.04 remotely,
The connection is discard. RustDesk tell that Connection refused
Can you tell me how to solve this problem?
Thanks again.

@btdan commented on GitHub (Jan 18, 2023): Thanks very much for your reply. But After I reinstall the nightly build. The rustdesk show version 1.2.0 And then I restart the Ubuntu22.04 system. I can connect to the ubuntu22.04 through rustdesk , but after I type the password in rustdesk and login ubuntu22.04 remotely, The connection is discard. RustDesk tell that Connection refused Can you tell me how to solve this problem? Thanks again.
Author
Owner

@btdan commented on GitHub (Jan 18, 2023):

In the picture below, I can NOT modify anything.
That is to say, I can not modify the password.
Can you tell me how to solve this problem?
Thanks very much.

image

@btdan commented on GitHub (Jan 18, 2023): In the picture below, I can NOT modify anything. That is to say, I can not modify the password. Can you tell me how to solve this problem? Thanks very much. ![image](https://user-images.githubusercontent.com/5276480/213165675-5cbf007d-7bf2-4e10-a131-d92a7010219c.png)
Author
Owner

@grummbeer commented on GitHub (Jan 18, 2023):

just scroll up a bit in this dialog and then …

rustdesk-settings

@grummbeer commented on GitHub (Jan 18, 2023): just scroll up a bit in this dialog and then … ![rustdesk-settings](https://user-images.githubusercontent.com/67791701/213276591-603307a2-e099-419b-89d3-a2d2a613eab8.png)
Author
Owner

@rustdesk commented on GitHub (Jan 18, 2023):

@grummbeer Thanks

@rustdesk commented on GitHub (Jan 18, 2023): @grummbeer Thanks
Author
Owner

@btdan commented on GitHub (Jan 19, 2023):

Hello, Thanks very much for your reply. And with your help, I can change the password successfully.
But when I connect to the remote Ubuntu 22.04 system, the login screen is displayed. And I can input the user name and password to login. However, after I login the system and imediately disconnect to the remote Ubuntu22.04.
And get a small window with the tip just as follows:
1674183928742

I have tested several times. If I login as an ordinary user (that is to say ,not root) . I get the same window as shown above.
But if i close the rustdesk and open rustdesk again, I can get the remote desttop of remote ubuntu22.04.

If I login the remote Ubuntu22.04 as root user. I get the same window as shown above. But I can NOT connect to the remote Ubuntu22.04 again if I close the rustdesk and open it again.
Can you help me to solve this problem?
Thanks very much.

@btdan commented on GitHub (Jan 19, 2023): Hello, Thanks very much for your reply. And with your help, I can change the password successfully. But when I connect to the remote Ubuntu 22.04 system, the login screen is displayed. And I can input the user name and password to login. However, after I login the system and imediately disconnect to the remote Ubuntu22.04. And get a small window with the tip just as follows: ![1674183928742](https://user-images.githubusercontent.com/5276480/213609270-15f34df3-ff8c-4a03-ae2a-95e091e1e06e.png) I have tested several times. If I login as an ordinary user (that is to say ,not root) . I get the same window as shown above. But if i close the rustdesk and open rustdesk again, I can get the remote desttop of remote ubuntu22.04. If I login the remote Ubuntu22.04 as root user. I get the same window as shown above. But I can NOT connect to the remote Ubuntu22.04 again if I close the rustdesk and open it again. Can you help me to solve this problem? Thanks very much.
Author
Owner

@rustdesk commented on GitHub (Jan 30, 2023):

solution here: https://github.com/rustdesk/rustdesk/issues/2573#issuecomment-1408672281

@rustdesk commented on GitHub (Jan 30, 2023): solution here: https://github.com/rustdesk/rustdesk/issues/2573#issuecomment-1408672281
Author
Owner

@rustdesk commented on GitHub (Apr 6, 2023):

#440

@rustdesk commented on GitHub (Apr 6, 2023): #440
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rustdesk-rustdesk#1245
No description provided.