Running X11 Server on MacOS X - and connecting from a remote machine

The question is now asked in SU .

I have a Windows XP laptop and I can run the Cygwin X11 server there (script startxwin.bat

, IIRC). I also use a remote machine - this is usually a Solaris 10 SPARC machine located about 1800 miles away, which can be named xclient.subdom2.example.com

for the purposes of this question.

For better or worse - mostly worse - I use xhost +xclient.subdom2.example.com

on a laptop to allow anyone using a remote computer to display their X client on my machine. Fortunately, I'm the only person who regularly uses a Solaris machine, and corporate security is tough enough for me to live with security threats.

From an XP laptop, I then remotely connect to the X client machine and set an environment variable DISPLAY=xplaptop.subdom1.example.com:0.0

and can run X client programs on the remote machine and see the image happily, if a little slow, on XP. (Depending on the length of the DHCP name assigned to the laptop, I sometimes had to refer to the IPv4 address instead of the machine's FQDN.)

I also have an Apple MacBook Pro and I want to replicate the XP laptop functionality on it. Unfortunately, I have not yet been able to figure out what magic spell is needed to get the X11 server to work satisfactorily. It looks like just clicking on the X11 server is /Applications/Utilities

n't enough. Executing the command xhost

again (with help DISPLAY=macpro.subdom1.example.com:0.0

) doesn't seem like a trick.

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


Also - and a lot in the bonus question category - how easily and well does the X11 server respond to changes in the network (between a corporate DHCP direct connection and a wireless airport at home with a corporate VPN connection)? Is this a "reboot in a new environment" problem or will you be able to automatically detect the changes?


I would also consider other ways to achieve roughly the same result - like VNC or Mac equivalents - if they are easier to configure. I believe VNC is installed on a Solaris box; it might be if it isn't.

+2


source to share


2 answers


As mentioned by KFro, using ssh forwarding (-X flag) is much easier than using xhost. It is also secure and you are claiming to have a network, but this is your data. Ssh-forwarding just makes your application see that the X client and server seem to be on the same machine and everything just works.

If you want to go to the xhost path, first make sure you have the latest version of XQuartz (installed Apple X Server). You can get it from http://xquartz.macosforge.org/trac/wiki and I would recommend it regardless.



It allows you to do a lot of nice configuration things like clipboard sync, key layouts and window focus without having to gouge inside OS X's inner shell.With newer versions (or at least the latest), you have a security tab that allows allow connections from network clients. I believe you still need to do vhostoo xhost, but it provides a nice checkbox that allows X to listen to it.

+2


source


This question should probably go to superuser.com.

Personally, I don't use xhost stuff. Its a logistic nightmare ... you need to worry about security, small configuration items on your server x like allowing tcp connections, etc.



It is generally easy to do this with ssh -X remote.host. This will bring x11 clients back to your host server. It basically sets the DISPLAY variable in your ssh session so that X11 clients can send their commands.

I don't have a Mac, but I would have thought this would work with both their quartz display server and x11 server.

+4


source







All Articles