Remote Desktop: Difference between revisions

From NixOS Wiki
imported>Skylark
→‎Clients: Add Remmina, since it's mentioned below
imported>Skyset
Line 61: Line 61:
services.xrdp.openFirewall = true;
services.xrdp.openFirewall = true;
</source>
</source>
(Source: [https://discourse.nixos.org/t/please-post-working-xrdp-setting-in-configuration-nix/7404/10 Discourse Link], [https://github.com/NixOS/nixpkgs/blob/86a80807d8d7051c63ab2b9d7f630abe066468b1/nixos/modules/services/networking/xrdp.nix nixpkgs code])
(Source: [https://discourse.nixos.org/t/please-post-working-xrdp-setting-in-configuration-nix/7404/10 Discourse Link], [https://github.com/NixOS/nixpkgs/blob/86a80807d8d7051c63ab2b9d7f630abe066468b1/nixos/modules/services/networking/xrdp.nix nixpkgs code])


Line 66: Line 67:


<code>freerdp</code> or <code>remmina</code> can be used on the client side.
<code>freerdp</code> or <code>remmina</code> can be used on the client side.
<h3>GNOME</h3>
The Xrdp <code>defaultWindowManager</code> setting to access a remote GNOME shell should be set to <code>gnome-remote-desktop</code>.
<code>services.gnome.gnome-remote-desktop</code> must be enabled for this to work. Also ensure that you have a firewall port open for Xrdp to communicate on (for the GNOME connections app, this is <code>3389</code>).


=== Guacamole ===
=== Guacamole ===

Revision as of 06:31, 2 March 2024

Clients

  • Apache Guacamole
  • freerdp
  • KRDC (KDE)
  • remmina
  • tightvnc and its forks tigervnc and turbovnc
  • x2goclient

Servers

  • XRDP

Configuration

Most servers provide a vncserver command. Various servers provide configuration options either by CLI or by configuration file.

Desktop session

To start a desktop session or window manager, one currently has to do this manually because servers still have hard-coded paths to /usr/share/xsessions to look for .desktop files. That means one has to write a script that starts the desktop session, window manager, or any other X application.

Some servers will automatically run $HOME/.vnc/xstartup but the more secure option is to write an executable script and run vncserver -xstartup $pathToScript

An example script:

#!/usr/bin/env bash

# set some env variables
# start window manager
exec icewm

pathToScript can also be a path to an executable like ${pkgs.icewm}/bin/icewm

Tiger VNC

Nixpkgs has a package but no service. The server component can be started using the vncserver command. To connect, use the vncviewer command.

x2go

X2go client is packaged in nixos as x2goclient.

The server is installed by adding the following line:
services.x2goserver.enable = true;
to /etc/nixos/configuration.nix.

RDP

NixOS has first class support for XRDP server.

services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;

services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "startplasma-x11";
services.xrdp.openFirewall = true;

(Source: Discourse Link, nixpkgs code)

You need to log out the user first on the remote machine, otherwise you'll get a black screen. (Source: Reddit). It may be particularly true on a multi-user system. You may be able to work around this by enabling and configuring Polkit. The configuration for enabling these permissions is the example code on that page.

freerdp or remmina can be used on the client side.

GNOME

The Xrdp defaultWindowManager setting to access a remote GNOME shell should be set to gnome-remote-desktop.

services.gnome.gnome-remote-desktop must be enabled for this to work. Also ensure that you have a firewall port open for Xrdp to communicate on (for the GNOME connections app, this is 3389).

Guacamole

Guacamole-server and guacamole-client are in nixpkgs. Some details are in the package request.

Meshcentral

Meshcentral is a self-hosted open source administration tool similar to teamviewer. It can be added with:

services.meshcentral.enable = true;

However, the agent (client) is not available. (Request)