0

The Goal:
I would like to open a program from my ubuntu server in my windows 7 desktop.

Steps Taken:
Putty > SSH > X11 check 'enable port forwarding'
I have started VNC Viewer in listening mode
started putty ssh session
apt get install xinit
startx &
geany (it's a c language ide; it uses the GUI so I"m using it to test x forwarding)

Error Messages:
geany returns "cannot open display"
startx returns "setversion 1.4 failed"

I'm working on Windows 7 and headless Ubuntu Server 12.04 LTS

Obviously I forgot something, but I'm having difficulty figuring out what. The goal is to not use sudo apt get install desktop, since I only want to use one program at a time, and anyway my server isn't hooked up to a monitor.

Any ideas? Questions? Thanks for your help! Curios

curios
  • 366
  • One of the most popular X servers for Windows is https://sourceforge.net/projects/xming/. There is also some good information here: https://wiki.utdallas.edu/wiki/display/FAQ/X11+Forwarding+using+Xming+and+PuTTY - Based on what you've posted, I would guess this is your missing piece of your puzzle :) – AnotherKiwiGuy Nov 07 '16 at 07:35

2 Answers2

2

To forward X11 apps over your ssh connection, there needs to be something on your Windows client to which the X11 applications can connect. In other words, you need to run an X server for Windows, which will translate X11 protocol messages from the ssh connection into graphical drawing commands and send mouse and keyboard actions back across the network.

There are several options for this, one is Cygwin/X: http://x.cygwin.com/

Paul
  • 7,007
  • 3
  • 23
  • 30
  • Hi Paul, thanks for your response. I thought VNC Viewer was serving this purpose, but I'll check out cygwin. However, I'm not sure this explains why startx was returning that error message. Thanks! – curios May 21 '13 at 18:43
  • @curios, you don't need to run startx if you're forwarding your X11 display. Just start an X server on the Windows machine (as far as I can tell, VNC Viewer does not qualify), log in to the Ubuntu server with putty, and run geany straight away. – Paul May 22 '13 at 01:11
  • 1
    https://sourceforge.net/projects/xming/ – sam yi Aug 12 '16 at 09:19
0

Hmm you've got multiple issues here. Firstly, Ubuntu Server does not come with a GUI so you would have to install xorg and a desktop environment. xinit and startx alone are not sufficient. I normally use LXDE.

Secondly you would need a client program on the Windows side to display the forwarded X11 apps. And finally, VNC Viewer is not an X11 client program.

If you still want to go the VNC route, you'd also need to install tightvnc or similar on the server side. You should not be running VNC Viewer in listening mode.

More details here on Installing a lightweight LXDE+VNC desktop environment on your Ubuntu/Debian VPS

Zanna
  • 70,465