XRDP and non-english keyboard layout

Hello everybody,

the last days I felt I made some progress learning the very basics of nixos. I manged to set up a vm with nixos and am able to access a xfce-session using xrpd. Things seem to work fine but I cannot get the keyboard layout to work properly. I have to use a German keyboard, when connected via rdp to the vm the layout is not correct. XFCE seems to think it is english keyboard, so the special charackters are messed up and I do not have the german “umlaute” (Ö Ä Ü). Via SSH the keyboard works as it should.

Here the relevant bits form my configuration.nix

` services.xrdp.enable = true;
  services.xrdp.openFirewall = true; #or disable Firewall
  services.xrdp.port = 3389;
  services.xrdp.defaultWindowManager = "xfce4-session";

  # Configure keymap in X11
  services.xserver = {
    layout = "de";
    xkbVariant = "";
    #xkbModel = "PC105";
  };

  # Configure console keymap
  console.keyMap = "de";`

I get the same problem no matter weather I use plasma or XFCE. Also connecting via guacamole or remmina doesn’t make a differences.

Any help or hints are more than welcome, I am lost…

Currently, there is a bug how xrdp is packaged on NixOS. See xrdp: use patched xrdp sources when building xorgxrdp by chvp · Pull Request #250189 · NixOS/nixpkgs · GitHub for a fix. If you would like to try it, add this to your config

  services.xrdp.package = let
    patchedNixpkgs = pkgs.fetchFromGitHub {
      owner = "chvp";
      repo = "nixpkgs";
      rev = "56d50b35b99e6c624933ad1d267aca23b49ae79c";
      sha256 = "aam37J/wYN8wynNHBUgUVzbdm6wVXP+uq9CaOq1gscg=";
    };
  in pkgs.callPackage
  "${patchedNixpkgs}/pkgs/applications/networking/remote/xrdp" { };
1 Like

Wow, you made my evening. The patch solves my issue. And I thought the bug is most likely me :wink: Thank you!

Another thing I noticed: the initial connection takes around 20 sec, afterwards it is very smooth. Is that the way it should be?

This happens for me too with current version. I have downgraded xrdp and it connects quickly, but the older version has many CVEs (security issues), so it is not a good workaround.

OK, thanks for the info. I suppose a bug report is filed, I could not find it though. Or should I try and submit one?

1 Like

Interesting. With your help I got it to a point where I use it on a daily basis. So the bug with the connection time and the clipboad got quite annoying. XRDP is used only in my local network and the machine is not acessible form the internet so I think it might be sane to take the CVE risk. To save me a ton of research: do you mind sharing which version you used and maybe a working config in nix to downgrade safely?

I set services.xrdp.package to

pkgs.callPackage
    "${inputs.nixos-2205}/pkgs/applications/networking/remote/xrdp" { };

where inputs.nixos-2205 is https://github.com/NixOS/nixpkgs/tree/nixos-22.05. It has xrdp 0.9.9 and CVEs are listed here Neutrinolabs Xrdp version 0.9.9 : Security vulnerabilities, CVEs

Thanks once more - for help and patience. Once again I cannot figure out things myself. I feel in the nix world some stuff is really hard to look up.

I get an error

error: string 'https://github.com/NixOS/nixpkgs/tree/nixos-22.05/pkgs/applications/networking/remote/xrdp' doesn't represent an absolute path

with my configuration.nix:

  services.xrdp.package = let
    inputs.nixos-2205 = "https://github.com/NixOS/nixpkgs/tree/nixos-22.05";
  in pkgs.callPackage
  "${inputs.nixos-2205}/pkgs/applications/networking/remote/xrdp" { };

Can you help me find out what I am doing wrong?

inputs.nixos-2205 is a flake input on my configuration. It points to source of nixpkgs. Run nix-shell -p nix-prefetch-github --run 'nix-prefetch-github --rev nixos-22.05 NixOS nixpkgs' and then adapt it to XRDP and non-english keyboard layout - #2 by adomixaszvers