How to configure selfhost rustdesk server?

Hello there, i have been wanting to be able to access my desktop remotely, i found rustdesk which seemed promisable, but a few tries and searches and i still couldnt understand how to set it up to run sucessifully.

So far i have on my configuration the basics:

{
  lib,
  config,
  ...
}:
let
  cfg = config.modules.rustdesk;
in
{
  options.modules.rustdesk = {
    enable = lib.mkEnableOption "enable rustdesk server module";
  };

  config = lib.mkIf cfg.enable {
    services.rustdesk-server = {
      enable = true;
      openFirewall = true;
    };
  };
}

i after rebuilding i couldnt see any of these systems running

Would anyone like to help me? please?

UPDATE:
i figured out the problem, no relay-servers host have been defined, so after rebuilding i got this error:

hbbs[...]: error: The argument '--relay-servers <HOST>' requires a value but none wa
s supplied

What is this relay-server?

~ 
❯ nixos-rebuild repl
building Nix...
Nix 2.28.3
Type :? for help.
Loading installable ''...
Added 6 variables.
nix-repl> options.services.rustdesk-server.relay.enable.description
"Whether to enable the RustDesk relay server.\n"

nix-repl> options.services.rustdesk-server.relay.enable.value      
true

I have no idea but the default for enabling it is true, so you need to configure presumably the rest of the relay related options or disable the relay. Read the upstream docs to decide if this is what you want (I presume you do because typically you need something like this to punch nat and access your service from the general internet).

by upstream you mean: Docs of RustDesk :: Documentation for RustDesk?

Yes, that is what I mean. Specifically Self-host :: Documentation for RustDesk, which while sparse confirms my instinct about the relay server. It’s optional if you don’t need nat punching.

Even if its optional, after disabling it (relay.enable = false;) the signal server still fails because there is no relay server host.
what is the relay server host?

Well then I’d raise an issue on github, in the mean time just fill in a fake ip address and move on I guess? The role of the relay service is described in the upstream docs. It solves the problem of access to rust desk from WAN.

One second, lemme ask something, rustdesk is not a substitute for rdp or vnc right?

I have never setup remote desktop, so i dont know what i am doing

I can tell you what you need or don’t need. If you want remote access on just your local network then I’d probably just setup vnc. If you want to share it outside of you LAN then you will have to solve the problem that rust desk + relay is solving, no matter what.

I would need outside the LAN so i would need desk+relay.

On that note though, i noticed i didnt needed to setup server as i could connect peer to peer using their server (less secure but ok i guess), so i installed on this computer (NixOs) and on a mac, but i couldnt connect for some other reason, also i noticed a warning on the program saying it couldnt use wayland unnattended which was a deal breaker.

Hey I’m also having this same problem. From what I’ve gathered from the rust desk docs the relay server is only used if hole punching fails which is apparently rare so for the time being I’ve just put in googles dns server (any IP address will do just to stop the service from failing).

services.rustdesk-server.signal.relayHosts = [ “8.8.8.8” ];

What would be nice though is some public relay server that could be used instead of some bogus one but I’m struggling to find any relay IP’s online.

:warning: Please don’t use some public IPs, which don’t offer that service! :warning:
:heart: Be kind to your fellow operators. :heart:

Use a loop back IP (::1 or 127.0.0.1) or one from the Reserved IP addresses, if you insist in putting an IP to satisfy the option check.

Better though, use a RustDesk relay server ( hbbr, probably self-hosted, see services.rustdesk-server.relay).

2 Likes

Yeah true you’re right. Don’t use some public IP use a loopback if needed…

Better though, use a RustDesk relay server ( hbbr, probably self-hosted, see services.rustdesk-server.relay).

Thanks for the suggestion, though not being able to setup the relay server is part of the issue… if you check on the code i provided i was trying to setup the rustdesk-server but itself requested a relay server.

I still dont know what im doing wrong.