Ubuntu can connect to Windows, but Windows can't connect to Ubuntu #1620

Closed
opened 2026-02-20 23:59:56 -05:00 by deekerman · 3 comments
Owner

Originally created by @dr1ver1 on GitHub (Apr 6, 2023).

Bug Description

I've tried 2 set ups of RustDesk Server on my home network that has the follows machines:
Ubuntu 22.04 running X11
Windows 10 PC
Windows 11 Laptop

I can connect as follows:

  • Ubuntu machine to Windows machines
  • Windows machine to Windows machine

I'm unable to connect from Windows to Ubuntu - and this is my main requirement.

I've set up RustDesk Server on Ubuntu, using the docker-compose.yml at https://rustdesk.com/docs/en/self-host/install/
When I try to connect to Ubuntu I get the error: "Failed to connect via relay server... Please try later"

I've also set up RustDesk Server on the Windows 10 machine using the instructions at https://pedja.supurovic.net/setting-up-self-hosted-rustdesk-server-on-windows
When I try to connect to Ubuntu I get the error: "x11 error connection refused"

I was previously using the public RustDesk server to access Ubuntu from Windows.

All machines running RustDesk Desktop 1.1.9
Windows RustDesk Server 1.1.7-4
Ubuntu RustDesk Server using docker image rustdesk/rustdesk-server:latest

On Ubuntu I've run:

ufw allow 21115:21119/tcp
ufw allow 8000/tcp
ufw allow 21116/udp

On Windows I've created rules in the firewall for those ports.

I've tried the Discord, but none of the suggestions helped.

From Windows Powershell I've run Test-NetConnection to check that the relevant ports are open on the Ubuntu machine.

How to Reproduce

Set up RustDesk Server on Ubuntu 22.04 and try to access Ubuntu from Windows

Expected Behavior

Expect to be able to connect to Ubuntu from Windows

Operating system(s) on local side and remote side

Windows 10, Windows 11 -> Ubuntu 22.04

RustDesk Version(s) on local side and remote side

All machines running RustDesk Desktop 1.1.9; Windows RustDesk Server 1.1.7-4; Ubuntu RustDesk Server using docker image rustdesk/rustdesk-server:latest

Screenshots

N/A

Additional Context

No response

Originally created by @dr1ver1 on GitHub (Apr 6, 2023). ### Bug Description I've tried 2 set ups of RustDesk Server on my home network that has the follows machines: Ubuntu 22.04 running X11 Windows 10 PC Windows 11 Laptop I can connect as follows: - Ubuntu machine to Windows machines - Windows machine to Windows machine I'm unable to connect from Windows to Ubuntu - and this is my main requirement. I've set up RustDesk Server on Ubuntu, using the docker-compose.yml at https://rustdesk.com/docs/en/self-host/install/ When I try to connect to Ubuntu I get the error: "Failed to connect via relay server... Please try later" I've also set up RustDesk Server on the Windows 10 machine using the instructions at https://pedja.supurovic.net/setting-up-self-hosted-rustdesk-server-on-windows When I try to connect to Ubuntu I get the error: "x11 error connection refused" I was previously using the public RustDesk server to access Ubuntu from Windows. All machines running RustDesk Desktop 1.1.9 Windows RustDesk Server 1.1.7-4 Ubuntu RustDesk Server using docker image rustdesk/rustdesk-server:latest On Ubuntu I've run: ``` ufw allow 21115:21119/tcp ufw allow 8000/tcp ufw allow 21116/udp ``` On Windows I've created rules in the firewall for those ports. I've tried the Discord, but none of the suggestions helped. From Windows Powershell I've run Test-NetConnection to check that the relevant ports are open on the Ubuntu machine. ### How to Reproduce Set up RustDesk Server on Ubuntu 22.04 and try to access Ubuntu from Windows ### Expected Behavior Expect to be able to connect to Ubuntu from Windows ### Operating system(s) on local side and remote side Windows 10, Windows 11 -> Ubuntu 22.04 ### RustDesk Version(s) on local side and remote side All machines running RustDesk Desktop 1.1.9; Windows RustDesk Server 1.1.7-4; Ubuntu RustDesk Server using docker image rustdesk/rustdesk-server:latest ### Screenshots N/A ### Additional Context _No response_
deekerman 2026-02-20 23:59:56 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

#763 #440

@rustdesk commented on GitHub (Apr 6, 2023): #763 #440
Author
Owner

@dr1ver1 commented on GitHub (May 25, 2023):

To access the RustDesk client on Ubuntu from another machine on the LAN, I needed to add the following to the firewall:
sudo ufw allow from 192.168.1.0/24 proto tcp
i.e., by default TCP connections from other clients on the LAN are blocked with a vanilla Ubuntu & UFW set up. The RustDesk client from the requesting machine needs TCP to be allowed, and the ports seem to be "random" - at least they are not 21115-21119, and seem to vary each time. This was evidenced in /var/log/ufw.log

Maybe I missed it, but I haven't this in any of the documentation - note this is for the client not the RustDesk server.
Maybe it is obvious, but I spent some time on discord and no one there picked it up, and I haven't seen it mentioned in any of the issues or discussions here. I suspect there may be some potential users who have the same issue and have given up, especially if they are not familiar with looking at firewall logs.

@dr1ver1 commented on GitHub (May 25, 2023): To access the RustDesk client on Ubuntu from another machine on the LAN, I needed to add the following to the firewall: `sudo ufw allow from 192.168.1.0/24 proto tcp` i.e., by default TCP connections from other clients on the LAN are blocked with a vanilla Ubuntu & UFW set up. The RustDesk client from the requesting machine needs TCP to be allowed, and the ports seem to be "random" - at least they are not 21115-21119, and seem to vary each time. This was evidenced in `/var/log/ufw.log` Maybe I missed it, but I haven't this in any of the documentation - note this is for the client not the RustDesk server. Maybe it is obvious, but I spent some time on discord and no one there picked it up, and I haven't seen it mentioned in any of the issues or discussions here. I suspect there may be some potential users who have the same issue and have given up, especially if they are not familiar with looking at firewall logs.
Author
Owner

@xlinx commented on GitHub (Feb 21, 2025):

dont use network_mode: "host"
specific port self
that will not listen on ipv6

services:
  hbbs:
    container_name: hbbs
    ports:  
      - 21115:21115
      - 21116:21116
      - 21116:21116/udp
      - 21118:21118
    image: rustdesk/rustdesk-server:latest
    environment:
      - ALWAYS_USE_RELAY=Y
    command: hbbs
    volumes:
      - ./data:/root
    depends_on:
      - hbbr
    restart: unless-stopped

  hbbr:
    container_name: hbbr
    ports:  
      - 21117:21117
      - 21119:21119    
    image: rustdesk/rustdesk-server:latest
    command: hbbr
    volumes:
      - ./data:/root
    restart: unless-stopped
@xlinx commented on GitHub (Feb 21, 2025): dont use network_mode: "host" specific port self that will not listen on ipv6 ``` services: hbbs: container_name: hbbs ports: - 21115:21115 - 21116:21116 - 21116:21116/udp - 21118:21118 image: rustdesk/rustdesk-server:latest environment: - ALWAYS_USE_RELAY=Y command: hbbs volumes: - ./data:/root depends_on: - hbbr restart: unless-stopped hbbr: container_name: hbbr ports: - 21117:21117 - 21119:21119 image: rustdesk/rustdesk-server:latest command: hbbr volumes: - ./data:/root restart: unless-stopped ```
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#1620
No description provided.