2

Question now asked on SU.

I have a Windows XP laptop, and I can run the Cygwin X11 server on there (script startxwin.bat, IIRC). I also use a remote machine - it happens to be a Solaris 10 SPARC machine, about 1800 miles away - that can be called xclient.subdom2.example.com for the purposes of this question.

For better or worse - mostly worse - I use xhost +xclient.subdom2.example.com on the laptop to allow anyone who uses the remote machine to display their X client on my machine. Fortunately, I'm the only person who uses the Solaris machine on a regular basis and the corporate security is stringent enough that I can live with the security risks.

From the XP laptop, I then remotely connect to the X client machine, and set environment variable DISPLAY=xplaptop.subdom1.example.com:0.0 and can run X client programs on the remote machine and see the display happily, if a little slowly on occasion, on the XP laptop. (Depending on the length of the DHCP name assigned to the laptop, I've occasionally had to resort to an IPv4 address instead of the machine's FQDN.)

I also have an Apple MacBook Pro, and I want to replicate the functionality of the XP laptop on it. Unfortunately, I have not yet been able to work out what magic incantation is needed to get the X11 server to run satisfactorily on it. It appears that simply clicking on the X11 server in /Applications/Utilities is not sufficient. Running the xhost command again (with DISPLAY=macpro.subdom1.example.com:0.0) doesn't seem to do the trick.

Can you suggest what the incantations needed are? Or suggest pointers to where the answer is spelled out in words of one or two syllables?


Also - and very much in the bonus question category - how readily and well does the X11 server react to changes in networking (between corporate direct wired DHCP connection and wireless Airport at home with connection to corporate via a VPN)? Is it a 'restart in the new environment' issue, or will it manage to detect the changes automatically?


I would also consider other ways of achieving about the same result - such as VNC or Mac equivalents - if they are easier to set up. I believe that VNC is installed on the Solaris box; it can be if it is not.

4

2 回答 2

4

这个问题可能应该转移到 superuser.com。

就个人而言,我不使用 xhost 的东西。这是一场后勤噩梦……您必须担心安全性,x 服务器中的小配置项,例如允许 tcp 连接等。

通常,简单的做法是使用 ssh -X remote.host。这会将 x11 客户端通过管道传输回主机的服务器。它基本上在您的 ssh 会话中设置了一个 DISPLAY 变量,以便 X11 客户端有一个地方可以发送他们的命令。

我没有 Mac,但我认为这适用于他们的石英显示服务器和他们的 x11 服务器。

于 2009-09-01T20:51:27.033 回答
2

正如 KFro 所提到的,使用 ssh 转发(-X 标志)比处理 xhost 容易得多。它也恰好是安全的,你声称你的网络是安全的,但是,它是你的数据。ssh 转发只是让您的应用程序看到 X 客户端和服务器似乎在同一台机器上,并且一切正常。

如果你想走 xhost 路线,首先确保你有最新版本的 XQuartz(安装了 Apple 的 X 服务器)。您可以从http://xquartz.macosforge.org/trac/wiki获得它,无论如何我都会推荐它。

它可以让你做很多不错的配置,比如剪贴板同步、键盘映射和窗口焦点,而无需在 OS X 的内部进行探索。对于较新的版本(或至少是最新版本),您有一个安全选项卡,可让您允许来自网络客户端的连接。我相信您仍然需要执行 xhost voodoo,但它提供了一个不错的复选框,让 X 可以收听它。

于 2009-09-01T22:51:06.043 回答