How to connect to remote X11 hosts from a Mac | Platforms – InfoWorld

In my previous two posts on the subject, I explained why youd want to use X11 to drive a host remotely, and the basics of configuring your Mac to run OS Xs X11 server and to use local X11 software. Now we get to the most important step, which, once you understand the whole X11 client/server thing, is a walk in the park.In X11 parlance, the X11 server is the software that handles communications and renders client content.

The X11.app that you run on your Mac is the server. X11 applications on remote hosts are clients. They reach out to your server to tap your display, keyboard and mouse, but with far lower networking and compute overhead than full-screen remote desktop sessions require.The toughest thing about X11 used to be arranging for X11 clients to see your server. Reaching across LAN segments, or through NATs and firewalls, was no picnic without resorting to VPN. Fortunately, some creative melding of X11 and SSH, the secure shell, gave us this gem:ssh -X hostnameWhen run from inside xterm on your Mac, this command creates a tunnel from the remote machine to your X server. You have to be able to access that machine via ssh, of course, which requires that you set up sshd the SSH daemon on the remote box and exchange credentials.When ssh -X connects, it will ask for a password, just as regular ssh does. Once you get a shell prompt, do this:echo $DISPLAYThe answer should come back “localhost:10.0” unless the remote machine has been configured differently. If DISPLAY is blank, you can set it:export DISPLAY=”localhost:10.0″Now, whenever you run an X11-enabled app in that ssh session, the application runs on the remote machine and automatically opens its windows on your Mac. You may need to specify the path to your remote systems stash of X11 clients. For example,export PATH=/usr/openwin/bin:$PATHis required on Solaris machines.Once the X11 apps are in your PATH, you can go snooping around. Everything compiled against GNOME and KDE is intrinsically X Window-enabled. If your remote machine has the GNOME desktop environment installed it doesnt need to be running, try this in your ssh session:nautilus &Thats GNOMEs file manager.gnome-system-monitor &is useful, too, and Firefox runs nicely on X11.When youre offline for periods of a few minutes, your SSH tunnel will be held open for you and reconnected as soon as your LAN interface comes back up. But if youre offline for too long, your session will expire and youll get kicked back to your Macs shell prompt. Just ssh -X again.X11 is much faster and more efficient than VNC for remote access to GUI apps, and once you get it down the first time, itll be second nature, even to connect two Macs.Tom Yager is a senior contributing editor at InfoWorld, a Web developer, and a Mac expert.

via How to connect to remote X11 hosts from a Mac | Platforms – InfoWorld.

Leave a Reply

Your email address will not be published. Required fields are marked *