“Just a second”, you’re thinking, “I thought this blog was supposed to be about Oracle stuff ?”
This is true…broadly speaking. However, I’ve spent a fair chunk of the last week playing with Ubuntu 9.10 server working up to putting Oracle on it. This particular mini-adventure will come in handy when I come to do the actual install as Oracle uses a graphical interface as it’s main installation tool.
So, this tuneling X over SSH sounds pretty impressive. Tuneling itself sounds very technical, a fact augmented by the inclusion of a TLA in the phrase. And the X just serves to make it sound rather mysterious and exciting.
As is so often the case in such matters, the truth is rather more prosaic.
Tunneling X over SSH is simply a technique for allowing graphical apps on one machine to run under the Window Manager of another whilst connected via SSH.
Why would you want to do this ? Well, not being a Linux expert, I have listened to the advice that, generally speaking, Windows Managers are not installed on servers as they take up resources that could more usefully be allocated to other things ( like Oracle databases, to take a random example).
You don’t buy that ? OK, you’ve got me – the truth is I initially tried to install openbox, couldn’t get it to work, so went with this. What follows is an account of all of the steps I took to get this working. Some of these may well be unnecessary, but I’ve included them just in case. I’ll be sure to point out where I think I may have gone up a blind alley. I hope that you, dear reader, will also be able to help me see the error of my ways !
One other point to note – this is a server I’m messing around with at home. In more formal environments, I’m sure that you’d be rather more concerned with ensuring that adequate security was implemented in terms of which users have permissions to run X ( or ssh, come to that).
First stop was the ever-informative Ubuntu Community Documentation, specifically, the bit about installing a GUI on the Server.
Getting the packages
All of the following packages and configuration changes take place on the server.
Get the X11 packages for a “minimal” server installation
sudo apt-get install xserver-xorg xserver-xorg-core
Next step was to try getting things working by using openbox
sudo apt-get install openbox
NOTE – This is the bit where I fiddled around with openbox for a bit, but couldn’t get it to work.
I’ve not removed the package so can’t say for certain that it’s not required, but I’m fairly sure that this is the case.
It was at this point that I turned to the idea of tuneling.
I already had two of the required X11 packages, so I only had to download :
sudo apt-get install X11-apps sudo apt-get install x11-xserver-utils
X11-apps contains useful little apps that you can run to confirm everything is working as expected.
The next step is to uncomment the allow forwarding parameter in /etc/ssh/sshconfig and set it to yes
sudo vi /etc/ssh/ssh_config
In the file, change the line
On the client, open a Terminal session and initiate an X windows session via ssh :
ssh -X username@server
Note the switch in the command is uppercase X, not lowercase x.This is relevant because both are valid switches for the ssh command.
The first time you connect using the X switch as each user, a file called .Xauthority will be created in that user’s home directory. This will facilitate subsequent X-windows connections by the user.
Once you’re in type
You should see a clock face display on the client machine.
Congratulations – it’s all up and running. And for my next trick…I’ll be running the Oracle Installer via this method. Wish me luck !