Setting up X forwarding over SSH

Home

Toolkit:

My OraFAQ Blog

Contact me

If you want to run any of Oracle's GUI tools from a remote machine -- for example, to install Oracle on a remote machine -- you may need to set up X forwarding over SSH.

Step 1: Add the server's IP and name to your hosts file


Edit the file and add something like:

11.12.13.14	my.oracle.server.ca	# My Oracle server

Step 2: Set your display variable and start X on your machine


Set your display environment variable to [your IP address]:0 and start X. This example assumes you're using Bash (the default for Cygwin), and that your IP address is 1.2.3.4 :
$ export DISPLAY=1.2.3.4:0
$ startx &

Step 3: Ssh into the remote machine

You may want to use a different shell prompt for this command, because the window you used above will be cluttered with X messages. On most systems, "startx" will have popped up an xterm; use that.

$ ssh -l oracle -Y my.oracle.server.ca -b 1.2.3.4
oracle@my.oracle.server.ca's password:
Warning: No xauth data; using fake authentication data for X11 forwarding.
[oracle@my.oracle.server]$ 

You're now logged in to the remote machine. Any X programs you tell it to run will pop up on your local display.

Step 4: Run X programs

Test your X setup by running a simple program like xeyes or xclock.

[oracle@my.oracle.server]$ xeyes &

Note: Proofread any scripts before using. Always try scripts on a test instance first. I'm not responsible for any damage, even if you somehow manage to make my scripts corrupt every last byte of your data, set your server on fire and serve you personally with an eviction notice from your landlord!
All scripts and tips © Natalka Roshak 2001-2005.
Enjoy the FREE tips folks...