简体   繁体   English

在 VNC 服务器桌面上打开的 X11 在我的 VNC 查看器而不是 VNC 服务器上打开窗口

[英]X11 open on VNC server desktop opens windows on my VNC viewer instead of VNC server

I'm having an interesting issue and my searches (plus the suggested articles here) aren't helping because I'm probably using the wrong terms.我遇到了一个有趣的问题,我的搜索(加上此处推荐的文章)没有帮助,因为我可能使用了错误的术语。

I have three workstations:我有三个工作站:

  1. Lin - a Linux instance running XServer. Lin - 一个运行 XServer 的 Linux 实例。
  2. Mac - a MacBook Pro with remote management enabled and XQuartz installed. Mac - 启用了远程管理并安装了 XQuartz 的 MacBook Pro。
  3. Win - Windows workstation running VNC Client. Win - 运行 VNC 客户端的 Windows 工作站。

Using VNC Client on Win, I am able to connect to and control the Mac desktop.在 Win 上使用 VNC Client,我能够连接并控制 Mac 桌面。 This works as expected except that copy-paste doesn't work between them but that is a topic for another post.这按预期工作,除了复制粘贴在它们之间不起作用,但这是另一篇文章的主题。

Mac also has a connection to Lin, which is running X server. Mac 也与运行 X 服务器的 Lin 有连接。

When I am connected via VNC from Win to Mac, I open a Mac terminal, run "ssh -X user@Lin's address and connect successfully to Lin from Mac.当我通过 VNC 从 Win 连接到 Mac 时,我打开一个 Mac 终端,运行“ssh -X user@Lin's address 并从 Mac 成功连接到 Lin。

When I run "xterm" in that Mac terminal which is ssh -X to Lin, the xterm window opens on Mac as I expect.当我在 ssh -X 到 Lin 的 Mac 终端中运行“xterm”时,xterm 窗口如我所料在 Mac 上打开。

However, when I run "chromium-browser", "firefox", etc in that same Mac terminal, the X window opens on Win, not Mac.但是,当我在同一个 Mac 终端中运行“chromium-browser”、“firefox”等时,X 窗口在 Win 上打开,而不是在 Mac 上打开。 Same behavior if I run an xwindows app in the xterm window on mac - it opens on Win, not Mac.如果我在 mac 上的 xterm 窗口中运行 xwindows 应用程序,则行为相同 - 它在 Win 上打开,而不是 Mac。

How is this possible and what can I do to control it?这怎么可能,我该怎么做才能控制它? There may be times I might want that but mostly I want the X applications to run on Mac, not Win.有时我可能想要这样,但大多数情况下我希望 X 应用程序在 Mac 上运行,而不是 Win。

I get confused between which is the "server" and which is the "client" here, especially with three machines involved.我在这里混淆了哪个是“服务器”,哪个是“客户端”,尤其是涉及三台机器时。

Resolved - it turned out I had an X server running on Win via MobaXTerm and the DISPLAY variable was not correctly set on Mac, so X was just passing the connection through.已解决 - 原来我有一个 X 服务器通过 MobaXTerm 在 Win 上运行,并且 DISPLAY 变量在 Mac 上没有正确设置,所以 X 只是通过连接。

I don't understand how that happened automatically via VNC (I didn't have any other connections between Win and Mac), but when I stopped the X server on Win and restarted the XQuartz app on Mac, windows began to open where I expected.我不明白这是如何通过 VNC 自动发生的(我在 Win 和 Mac 之间没有任何其他连接),但是当我在 Win 上停止 X 服务器并在 Mac 上重新启动 XQuartz 应用程序时,Windows 开始在我预期的位置打开.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM