Nerdrium Home

Macintosh

Linux

Web Design

Case Mods

Gardening

Photography

Recipes

 

My Blog

 

Facebook

Twitter

View Remote X11 Windows

by Michael Greifenkamp (March 28th, 2007)

On an almost daily basis I am connecting from my Macintosh to a number of various RedHat and Fedora Core Linux machines. Often times, it is to instruct the remote machines to install new updates. While I'm quite comfortable using the command line, there are certain specific times that I'd really like to be able to view up2date in GUI mode, as if I were standing at the machine.

As it turns out, it's pretty easy.

The first thing to do is install X11, which can be done using the Tiger install DVD (or CDs), or by downloading from Apple's web site.

Once X11 is installed, one more small change was needed for the remote windowing to work. Using a text editor (like vi), edit the file .tchsrc in your home directory.

# cd ~
# vi .tcshrc

At the bottom of the file add a new line with the following:

setenv DISPLAY :0.0

Write the file (:w) and exit vi (:q).

Make sure that X11 has been started on the Macintosh (it gets installed at /Applications/Utilities/X11.app). Now we just need to connect to the remote server. In a terminal window, connect using ssh, but add the -X option.

# ssh -X 192.168.1.10

Now type the name of the application that you want to run on the Linux machine and the GUI window should appear on your Macintosh screen.

# up2date

And the window should pop up on your screen:

You can interact with the Linux program just as you would if you were at that machine. When you're finished, simply exit the program in question, and you'll see that you once again have a command prompt available in your terminal window.

One final note, make sure that you start X11 first. Often times I'll connect to a remote server using ssh -X and there will be a bit of a delay before I'm connected, and of course when I try to launch an application it doesn't work.

Drop me a line if you have any questions.

--Michael