Mosh

From NixOS Wiki
Revision as of 02:46, 18 January 2018 by imported>Ghuntley

Troubleshooting

Missing /run/user/1000

Using a mosh session, $XDG_RUNTIME_DIR (/run/user/1000) doesn't exist and causes issues such as:

  • nix-shell failing with Error in tempdir() using /run/user/1000/nix-shell.XXXXX

This is caused by the way mosh handles logging-in to the system, the login is actually handled by a short ssh session, which ends immediately. logind, as it is used, closes the user's session and cleans up behind, since there is no loingering configured by default.

As a workaround, it is possible to set an alias in the user's shell wrapping mosh-server to keep the session around.[1]

alias mosh-server = "systemd-run --user --scope mosh-server"

References