-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support X forwarding #41
Comments
being able to setup arbitrary octet streams could be useful for port forwarding and agent forwarding too. |
There are techniques for optimising X11 over WANs that can significantly reduce bandwidth requirements - eg Xpra (http://www.xpra.org). That said, X11 over a 3G link is going to be painful at best because it's not possible to remove the RTT between input & display. Note that most Xclients need lots of RTTs to start up. I support the idea that SSP be enhanced to allow multiple datastreams over a single "connection". |
I'm very interested in this, @keithw, can you give a short outline of what work needs to be done to support this? Tunneling and X11 forwarding are high on my "want" lists from mosh (roaming tunneling over ssh is a dream come true) so I'd contribute what I can. |
The biggest blocker at this point is probably coming up with a channel for arbitrary congestion-controlled octet streams that roam and handle intermittent connectivity gracefully. Then we can send anything (including reliable X protocol messages or other arbitrary stream) over that. |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
+1 |
This comment has been minimized.
This comment has been minimized.
+1, and this would make vim's clipboard=unnamedplus clipboard syncing work, which is HUGE. |
This comment has been minimized.
This comment has been minimized.
I'd like to ask for only-when-currently-connected stream forwarding, to avoid using much memory when the client is not available. My use case would be dbus notifications, sent by irssi within a screen (accessed via mosh); when the client is attached, these should pop up as usual. |
This comment has been minimized.
This comment has been minimized.
Any plans for this @keithw? |
You're forgetting the biggest benefit that this feature would add: X11 Forwarding! :) |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3 similar comments
+1 |
+1 |
+1 |
This comment has been minimized.
This comment has been minimized.
So what's the progress on this feature? |
I do not believe that anyone is currently working on this |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Guys can we stop spamming people with +1 |
This comment has been minimized.
This comment has been minimized.
Current I use
Then after that I just use
Now I can use X application (gtkwave) in the mosh session. Is that a kind of I tried to merge these two step into on by:
But the |
I tried your command on Ubuntu 16.04 and Centos 7, and I got a "no session" error. I don't have much experience with tmux, so I can't help you there. However, I did find this: |
This comment has been minimized.
This comment has been minimized.
Another error I'm seeing when running |
Oof, that was a while ago. Recreating my old setup, yes, I did get that. Can't seem to get my exact tmux error back, but that's probably my lack of tmux knowledge speaking again. |
That is all expected. Mosh uses SSH only for the initial login and closes the SSH connection immediately after starting (Even if Mosh were to try to leave the SSH connection open, it would just be a normal SSH connection over normal TCP. It wouldn’t gain any ability to survive network disconnections and roaming the way Mosh users expect. There would be no advantage over just using SSH directly. Even worse, it would potentially hide problems like #730 where Mosh would only live as long as the SSH session and appear unreliable in a way that’s difficult to debug.) |
i had an idea - how about firing up a new "proxy" ssh connection each time mosh either detects an IP address change or somehow when the client requests data...... say you were monitoring the IP address and the mosh client detects a change in gateway etc. it could check for parameters like -D 8888 (dynamic socks proxy), -L local port forwards, -R remote etc. perhaps this would need to terminate the older ip address processes to free up the local ports for the new ssh proxy process??? i understand the reason mosh does not support X11 is that mosh is a virtual TTY terminal emulator. but perhaps mosh can start ssh client sessions in the background to support custom parameters? this is one of my connect strings: yep thats a string i used to use at some stage in my life. @keith you mention you thought the main blocker to be needing to have:
excuse my ignorance, but.... correct me if wrong but I understand Mosh is currently doing it's awesome magical business regarding intermittent and dynamic IP environs by maybe setting up a UDP listening port and wait for a listener that is able to report the PID code / authentication token that matches a live running user session on the box in question. how about passing that string straight through to the server yeah? after cleansing it for XSS vulns. :) |
@tomachinz Use autossh to persist the connection? Or use systemd.socket to connect on demand? Currently I'm using mosh for the terminal and ssh for X forwarding. It mostly works, except that I have to start the ssh tunnel every day (I'm using password authentication for this box). My ssh connection is as stable as mosh because it uses the Wireguard VPN, and mosh is still great in this use case for its quick feedback. I don't want mosh to use my ssh in its own way. It's already disturbing because the ssh connection mosh has used isn't multiplexed so I have to connect again when I need it. (I don't use the mosh script for high latency hosts for this reason.) |
@lilydjwg Interesting thought. Going that direction, I'd rather see autossh than systemd sockets for the implementation of this. One of the best parts of Mosh is how platform agnostic it is. If you place a dependency on systemd, that limits it to systemd-based Unix and Linux systems- potentially locking macOS, Windows, Cygwin, Windows Subsystem for Linux, and even As for whether it might work, I'd say it's at least a good start. SSH will automatically tear down a connection it thinks is broken (albeit after some delay), and autossh can start it right back up with the new IP. This solves the problem of keeping a socket "open" across IP changes, but it still leaves up the problem of a persistent connection. When autossh respawns a connection, it's not the same connection and some software might not handle this well. Something like http(s) or RDP traffic that can handle a socket getting reset would be fine, but I don't know if X11 is as fault-tolerant (my knowledge is stronger in OSI layers 2-6 rather than layer 7 protocols). On topic of tunneling connections, auto-respawning a tunneling ssh from mosh is related to various proxy/jump features like #970 #285 (there are a lot of ProxyCommand and jumphost github issues floating about and probably at least half of them are duplicated). |
@lilydjwg actually, not at all, my thought was much more primitive - to literally pipe the users command text straight through to... is it the shell interpreter? eg... from the client side. mosh -Y tomachi@server so on the other client end, the mosh client runs local: ssh -Y tomachi@server I can see there is more to it than meets the eye. Or perhaps it could all be done in the client? It's the client that needs to free up listening ports in some cases, but also the server may need to free up remote listening ports if there is a drop-out. I reckon a handshake / or reset command between client and server is needed: upon reset both the client and server seek and destroy the old ssh connection; 2 seconds later the client retries the ssh outbound again. That would work for my tunnels: local, remote and dynamic AFAIK. Here you can see me switch from local LAN connection (10.0.0.1) on my phone to GSM mobile (118.148.204.212). mosh is uber cool really.... By running this command I did some debug:
I guess X11 uses export display etc hadn't thought of that... |
Or leave the sshd process running in a background thread. Then kill it during the reset. |
@tomachinz I've done nested X11 tunnels ( AFAIK (correct me if I am wrong), all I think picking up the calls on the server side and (once they're on the client side) getting them to the local X11 server is fairly straightforward- the problem is getting them over the network between the server and client. IIRC, X forwarding is a special case for SSH's native TCP forwarding. Way back in 2012 when this thread was started, @keithw commented:
That's the problem we need to solve. The premise of TCP is to have a reliable connection layer where everything is (mostly) guaranteed to arrive at the application layer. If this doesn't happen, the stream breaks or delays data until the whole stream can arrive in-order. TCP by itself has limited buffers, so can only sustain limited disconnect periods before needing to destroy and recreate the connection. It might be a bit problematic, since the mosh-server and mosh-client would likely have to buffer the data on both sides of the pipe, then replay the buffers when a connection is reestablished. All that without even talking about congestion control. VPNs (like Cisco IPSec) can deal with TCP over UDP. Possibly worth investigating how they do that? |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Because it notifies everyone that follows this issue and contributes nothing to the discussion.
Yes there is, add a thumbs up reaction to the first post in the issue. |
In theory, we could easily support X forwarding (with roaming!) by just conveying a verbatim octet stream in both directions over the underlying network layer -- the same kind of statesync object that we use for user input.
We wouldn't get predictive local UI, but we would get the other benefits of Mosh (support for sleep/wakeup and IP roaming).
The text was updated successfully, but these errors were encountered: