Xquartz ssh -X 会话:如何分离/重新附加到持久窗口
我已经安装了 xquartz 在我的OSX计算机上,然后使用ssh连接到远程服务器 - x Windows(例如,例如Rstudio - 我看到窗口显示在我的屏幕上,即使它在远程服务器上运行-Neato!)。
我想做的是创建稳定的,持续的会话,以断开/重新连接到(即关闭和重新打开与我的环境和变量仍然存在的相同窗口相同,而不是关闭它并打开另一个一)。
因此,我正在使用a tmux 从终端中进行会话,以便我可以从我的ssh连接到服务器并稍后再连接。然后,我想做的然后是重新启动我之前从该会话开始的GUI窗口。不幸的是,一旦创建了GUI窗口,我就不知道如何从GUI窗口中“存储”或“分离” - 如果我关闭它们,则删除了未保存的数据并丢失了会话。
有没有办法从ssh -x
内部启动持久窗口,然后“隐藏”该窗口,然后在以后再次连接后重新打开它?
I've installed xquartz on my OSX machine, and upon connecting to a remote server with ssh -X [email protected]
I'm able to launch gui windows (let's say Rstudio for example --I see the window show up on my screen even though it's running on the remote server -neato!).
What I'd like to do is create stable, persistent sessions to disconnect/reconnect to (i.e. close and re-open the same window with my environment and variables still there, instead of closing it and opening another one).
Hence, I'm using a tmux session from the terminal so that I can detach from my ssh connection to the server and connect back later. What I'd like to do then is re-launch the gui windows that I started from that session previously. Unfortunately, I don't know how to "store" or "detach" from the GUI windows once they are created --if I close them, then the unsaved data is deleted and the session is lost.
Is there a way to launch a persistent window from within ssh -X
, and then "hide" that window, and re-open it after connecting again later?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定这现在是否仍然有帮助,但我会将其放在这里供后代使用。对于特定的 RStudio 情况,您最好安装 RStudio 的服务器版本 - 付费的 RStudio Workbench 或免费的开源版本。服务器版本提供您正在寻找的持久会话,包括长时间运行的作业。
开源版本有一个登录名,但所有密码均以未加密的形式发送 - 不要在没有其他保护的情况下将其暴露在互联网上。在开源版本中,每个用户只能有一个会话。
即使不允许访问公共互联网,您也可以通过 ssh 转发端口 8787 ( -L 8787:localhost:8787) &通过访问 localhost:8787 从本地浏览器登录远程 RStudio Server 实例。
Not sure if this will still help now but I'll put it here for posterity. For the specific RStudio case you'd be better off installing a server version of RStudio - either the paid RStudio Workbench or the free open-source version. The server versions provide the persistent sessions you're looking for, including for long-running jobs.
The open source version has a login, but all passwords are sent in unencrypted - don't expose it to the internet without other protections. In the open-source version you can only have one session per user.
Even without allowing access to the public internet you could forward port 8787 over ssh ( -L 8787:localhost:8787) & log into the remote RStudio Server instance from your local browser by visiting localhost:8787.