I'm trying to use tmux on my computer and it runs perfectly as root, but I'd rather run it under my own account. When I run it with my account, I get a variety of error messages that include "Cannot establish any listening sockets" and another message that "Server is already active for display 0". I try to follow the instructions inside the error messages but it just brings me in circles. Let me know what I should try or what other information I should post. I'm a first timer here, so I might make mistakes with this post.


My guess is, you've tried to set up your ~/.profile (or .bash_profile) to automatically start Xorg on login. The problem is, each tmux window runs the .profile scripts again, and tries to start Xorg inside Xorg. So if that's the case, you need to add additional checks.

For example, if you have the startx command in ~/.profile, replace it with:

if [ "$(tty)" = /dev/tty1 ]; then

This will run startx only when logging in to the 1st text console (tty1). It doesn't just fix tmux, but also fixes SSH and "display managers" like GDM & LightDM, as well as avoiding duplicate Xorgs in general.

  • @t0ofpaste, if that's the case, consider rather using nodm instead of starting X by hand or auto-starting it from a console login session. – kostix Oct 7 '15 at 11:10
  • Good guess, indeed! – kostix Oct 7 '15 at 11:10
  • 1
    You are magical... Wow. Yea, I actually added an "exec xinit" inside my .profile and after changing my code to yours, it started working. Thanks a ton man. This problem has been terrorizing me for days! :P – t0ofpaste Oct 7 '15 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.