Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've currently have the following situation.

I have a server, that is connected to the internet with ssh (on a non 22 port). This is an ubuntu server without X server. Now i have a machine inside this network, that is used as a desktop machine.

Is it possible to forward all request on a specific port (for the server) directly to that desktop machine, to be able to use the Xserver over SSH?

share|improve this question
What OS, terminal software and X server are you using on the local machine? – Dennis Williamson Jan 31 '11 at 15:46

Just pass the -X argument when connecting to your server using ssh, and you'll be able to launch applications on the server that are displayed on the client.

share|improve this answer
Eraser, i need indeed connect to the server, but this server doesn't have xserver installed. And i need to run applications from the desktop that's behind the server. – Grezly Jan 31 '11 at 15:02
Ok, so you want to connect to the server, and the server will actually forward your request to the desktop? – lmontrieux Jan 31 '11 at 15:06
The just create an ssh tunnel. See the -L arg documentation in the ssh man page. – lmontrieux Jan 31 '11 at 15:06

By far the simplest way to do this is to install VNC Server on the Desktop machine.

Then you can do the following from your laptop with RealVNC Viewer installed: vncviewer desktop:1 -via

To connect directly to the desktop. This will automatically SSH to, forward a port to the destination VNC server, then connect to that port. Replace desktop with the internal DNS name or IP of the desktop, and of course the rest should be obvious there.

As an alternative there's also X forwarding, which you can bounce through a tunnel, but XLib does not make any attempts to optimize for bandwidth.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.