参考https://blog.csdn.net/tootsy_you/article/details/130010564
注意:
docker-compose.yml
version: '3'
networks:
rustdesk-net:
external: false
services:
hbbs:
container_name: hbbs
ports:
- 21115:21115
- 21116:21116
- 21116:21116/udp
- 21118:21118
image: rustdesk/rustdesk-server:latest
command: hbbs -r 10.73.30.241:21117
volumes:
- ./data:/root
networks:
- rustdesk-net
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
networks:
- rustdesk-net
restart: unless-stopped
起动
kt@kt4028:~/rustdesk$ docker compose up -d
WARN[0000] /home/kt/rustdesk/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
[+] Running 3/3
✔ Network rustdesk_rustdesk-net Creat... 0.1s
✔ Container hbbr Started 0.3s
✔ Container hbbs Started 0.6s
kt@kt4028:~/rustdesk$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
996219c21c99 rustdesk/rustdesk-server:latest "hbbs -r 10.73.30.24…" 20 seconds ago Up 19 seconds 0.0.0.0:21115-21116->21115-21116/tcp, :::21115-21116->21115-21116/tcp, 0.0.0.0:21118->21118/tcp, :::21118->21118/tcp, 0.0.0.0:21116->21116/udp, :::21116->21116/udp hbbs
ac9ef80c7ad9 rustdesk/rustdesk-server:latest "hbbr" 20 seconds ago Up 19 seconds 0.0.0.0:21117->21117/tcp, :::21117->21117/tcp, 0.0.0.0:21119->21119/tcp, :::21119->21119/tcp
查看密码
kt@kt4028:~/rustdesk$ docker logs hbbs
[2025-01-12 08:13:33.181897 +00:00] INFO [src/common.rs:122] Private key comes from id_ed25519
[2025-01-12 08:13:33.181918 +00:00] INFO [src/rendezvous_server.rs:1205] Key: CV6jEZIB3HDnAbUPwtbdzrMzzZF6yxbaBuSlAUR5pNQ=
[2025-01-12 08:13:33.181924 +00:00] INFO [src/peer.rs:84] DB_URL=./db_v2.sqlite3
[2025-01-12 08:13:33.183226 +00:00] INFO [src/rendezvous_server.rs:99] serial=0
[2025-01-12 08:13:33.183246 +00:00] INFO [src/common.rs:46] rendezvous-servers=[]
[2025-01-12 08:13:33.183251 +00:00] INFO [src/rendezvous_server.rs:101] Listening on tcp/udp :21116
[2025-01-12 08:13:33.183256 +00:00] INFO [src/rendezvous_server.rs:102] Listening on tcp :21115, extra port for NAT test
[2025-01-12 08:13:33.183261 +00:00] INFO [src/rendezvous_server.rs:103] Listening on websocket :21118
[2025-01-12 08:13:33.183321 +00:00] INFO [libs/hbb_common/src/udp.rs:36] Receive buf size of udp [::]:21116: Ok(212992)
[2025-01-12 08:13:33.183434 +00:00] INFO [src/rendezvous_server.rs:138] mask: None
[2025-01-12 08:13:33.183448 +00:00] INFO [src/rendezvous_server.rs:139] local-ip: ""
[2025-01-12 08:13:33.183464 +00:00] INFO [src/common.rs:46] relay-servers=["10.73.30.241:21117"]
[2025-01-12 08:13:33.183586 +00:00] INFO [src/rendezvous_server.rs:153] ALWAYS_USE_RELAY=N
[2025-01-12 08:13:33.183606 +00:00] INFO [src/rendezvous_server.rs:185] Start
[2025-01-12 08:13:33.183684 +00:00] INFO [libs/hbb_common/src/udp.rs:36] Receive buf size of udp [::]:0: Ok(212992)
kt@kt4028:~/rustdesk$
无头运行本地ubuntu,被控端
rustdesk --start-service
根据提示。一次不行就再启动一次。被控制端ubuntu。
控制端win
成功
这会好了。在局网中可自由了。