DISPLAY update with ssh and byobu

I have the following scenario:

On my work computer (A), I open a byobu (tmux) session.

Inside byobu, I open several terminals. Some are local to (A), while others are ssh on another machine (B).

I go home and from my home computer (C) I ssh to (A), ran "byobu" and found all my sessions at (A) or (B).

This works great except for launching X11 applications. I don't leave the X11 application running when I change computers, but just running "xclock" sometimes works and sometimes it doesn't ("can't connect to X server localhost: n.0").

I understand that it depends on the variable DISPLAY

and that it will be configured so that X11 will connect to the computer where I ran "byobu" last, before creating a session inside byobu, and it could be (A) or (C). My problem is that often I don't know how to fix a session that no longer works. Sometimes I can just open another session (another tab in byobu) and use the value $DISPLAY

in other sessions, but this only works as long as the new session is open, not always. In other cases, I was able to disconnect byobu (F6), reconnect it (run "byobu") and open a new ssh connection (B) and then work, but not the existing sessions.

I have read some docs like SSH, X11 Forwarding and terminal muxers, or How to get tmux X display back? but it is not clear to me how they apply (if any) to my situation. For example, the code of the .bashrc

first if it is in (A), (B) or (C)?

+3
ssh x11 tmux byobu


source to share


No one has answered this question yet

Check out similar questions:

1786
Ssh error "permissions too open"
1147
How do I use SSH to run a shell script on a remote machine?
one hundred
How can I send commands when opening a tmux session inside another tmux session?
81
How do I force the screen to detach from another SSH session?
60
How to automatically start tmux on an SSH session?
45
How to automatically update SSH agent environment variables when connecting to existing tmux sessions
five
Nested terminal color scheme, tmux, ssh, vim setup
1
Vim keymaps not working after re-binding to tmux session over ssh
0
How can I connect to an existing byobu session or start a new one if there is no session when starting the terminal emulator?
0
Can't log out correctly from SSH session with active IPython / Matplotlib in Tmux



All Articles
Loading...
X
Show
Funny
Dev
Pics