Please post working xrdp setting in configuration.nix

Hi,
I use NixOS 20.03.

XRDP doesnt work as advertised
https://nixos.wiki/wiki/Remote_Desktop

Would somone please post a working configuration.nix?

When I specify the ICEW as in the link and log in via RDP, the system just asks for username and password and after that I just get a teal background screen with no buton

I am puzzled that there aren’t many posting about XRDP in NixOS. Do people just use SSH or X window manager and not many people use XRDP? Or do people just use something like the VNCServer?

I just tested it. It works fine here. I am using xorg.

I copy/pasted it straight from the wiki:

services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "${pkgs.icewm}/bin/icewm";
networking.firewall.allowedTCPPorts = [ 3389 ];

Here is the full configuration.nix from the VM I use for testing random nixos stuff. It isn’t very clean :cowboy_hat_face:

configuration.nix
# The vm used for testing

{ config, pkgs, ... }:

let
  unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in {
  imports =
    [ 
      ./modules/common.nix
      ./modules/zsh.nix
      ./modules/sddm-theme.nix
      ./modules/vmware.nix
    ];

  # Use the systemd-boot EFI boot loader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  # Enable the KDE Desktop Environment.
  services.xserver.desktopManager.plasma5.enable = true;
  services.xserver.displayManager.sddm = {enable = true; extraConfig = ''
  [General]
  InputMethod=
'';};
  services.sddmTheme = {enable = true; backgroundFile = /wallpapers/slimepink.png;};

  networking.interfaces.ens33.useDHCP = true;
  networking.hostName = "nixos";

  environment.systemPackages = with pkgs; [
    unzip
    ffmpeg
    kate
    firefox
    flameshot
    gwenview
    okular
    gimp
    falkon
    (vivaldi.override { proprietaryCodecs = true; enableWidevine = true; })
    smplayer
    vlc
    sayonara
    latte-dock
    appimage-run
    unstable.vscodium
    inxi
    lm_sensors
    glxinfo
    mpv
  ];


  # Open ports in the firewall.
  networking.firewall.enable = true;
  networking.firewall.allowedTCPPorts = [ 3389 ];
  # networking.firewall.allowedUDPPorts = [ ... ];

  services.printing.enable = true;

  # Enable sound.
  sound.enable = true;
  hardware.pulseaudio.enable = true;

  # Enable the X11 windowing system.
  services.xserver.enable = true;
  services.xserver.layout = "us";
  # services.xserver.xkbOptions = "eurosign:e";

  users.users.dalto = {
    isNormalUser = true;
    extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
  };

  system.stateVersion = "20.03"; # Did you read the comment?

  nixpkgs.config.allowUnfree = true;

  # zfs
  boot.initrd.supportedFilesystems = [ "zfs" ];
  boot.zfs.devNodes = "/dev/disk/by-partuuid";
  services.zfs.autoScrub.enable = true;
  networking.hostId = "6b4fb61d";

  # automatic upgrades
  system.autoUpgrade = {enable = true; allowReboot = true;};

  services.xrdp.enable = true;
  services.xrdp.defaultWindowManager = "${pkgs.icewm}/bin/icewm";
}

Speaking only for myself, I use ssh 90% of the time. When I need a graphical session I usually use my virtualization platform to get access to the console.

1 Like

Thank you so much! Let me try soon! Is it the case that I need to turn off the native X session running with the video caed before I can use the XRDP version, maybe? Anyway, let me try!

I don’t think so. I was able to log into the plasma session via the console and rdp concurrently.

That being said, I didn’t test extensively.

1 Like

@yasu I am using XRDP + remmina (the RDP client) for work extensively. This module should work for 20.03. Hope it helps. Btw, I am using xfce on remote server, haven’t tested the others yet.

1 Like