Quantcast
Channel: Linux and Mac Hacks
Viewing all articles
Browse latest Browse all 39

Tunnel X Windows over SSH from a Linux Server to Mac OS X Mountain Lion

$
0
0
First lets setup the Linux Server. You need to add the following two directives to the sshd config, on Ubuntu it is found in /etc/ssh/sshd_config (look at the file first, it might already be in place)

X11Forwarding yes
X11DisplayOffset 10
If you added them, then make sure you restart ssh

# /etc/init.d/sshd restart 

Also make sure you install Xwindows on the Linux Server, on Ubuntu you can use apt-get
# apt-get install xinit

Once you are all set, you need to start X windows, as the root user type
# start x 

Now lets get Mac OSX Lion working. First you need to install XQuartz: http://xquartz.macosforge.org/landing/ since XWindows is not installed by default on XWindows. The installation is pretty straightforward it is pretty much all point and click.

It's time to log into the Linux Server and test, make sure you add the -X (which forwards Xwindows):
# ssh -X myusername@thelinuxserver.com 
You can test that everything works by checking the display:
  # echo $DISPLAY

If you get something like:
localhost 10:0

You are good to go!




Viewing all articles
Browse latest Browse all 39

Trending Articles