Tmux fails to start with

error creating /run/user/$(id -u)/tmux-1000 (No such file or directory)

But starts fine under root

  • What is the distro that you are running in WSL2? is it the default Ubuntu, or something else? is TMUX_TMPDIR set in your user environment? Commented Apr 5, 2021 at 14:11
  • Ubuntu 20.04. TMUX_TMPDIR is not set, and I have to similar problem with GNU Screen. It seems that /run is not writable under unprivileged user
    – andreoss
    Commented Apr 5, 2021 at 20:10
  • As a workaround, you could try setting TMUX_TMPDIR=/tmp, which AFAIK is the "traditional" value (and appears to be what tmux uses on Ubuntu 20.04 under WSL1) Commented Apr 5, 2021 at 20:19
  • 1
    Is TMPDIR set (not TMUX_TMPDIR)? That would explain why it is happening for both tmux and screen. I'm running WSL2 (and WSL1) Ubuntu 20.04 and both are correctly using /tmp/tmux-1000. Figuring out why temp files are trying to go to /run is pretty much the core issue, it sounds like. Commented Apr 6, 2021 at 2:05
  • For me exporting export TMUX_TMPDIR='/tmp' in my .zshrc worked on openSuse Tumbleweed with tmux 3.2
    – Didier A.
    Commented Jul 14, 2021 at 5:24


You must log in to answer this question.

Browse other questions tagged .