I am trying to run xterm on my Virtualbox ubuntu VM, but when I run xterm on the VM, I keep getting the message

xterm: Xt error: Can't open display!: 
xterm: DISPLAY is not set 

When I run xterm through putty (with X11 enabled) (from my host to the VM), I get:

PuTTY X11 proxy: unable to connect to forwarded X server: Network error: Connection refused
xterm: Xt error: Can't open display: mininet-vm:10.0

Some of the outputs of the ssh config files:

cat /etc/ssh/sshd_config | grep X
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no    

cat /etc/ssh/ssh_config | grep X
    ForwardX11 yes
    ForwardX11Trusted yes

Echo Displays: On Putty:

echo $DISPLAY
mininet-vm:10.0

On the Virtualbox VM:

echo $DISPLAY
##blank##

Version:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.10
DISTRIB_CODENAME=quantal
DISTRIB_DESCRIPTION="Ubuntu 12.10"
NAME="Ubuntu"
VERSION="12.10, Quantal Quetzal"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu quantal (12.10)"
VERSION_ID="12.10"
  • If you are running "PuTTY", it sounds as if your local machine is Windows. There are no details about an X server on the local machine in your question. People usually use Cygwin or something like that to provide X, and there are pages which tell how to tie those together. – Thomas Dickey Dec 27 '15 at 21:13
  • yes, but even when I run xterm within the virtualbox console itself, i still get th emessage cannot find display – user2883071 Dec 27 '15 at 21:14
  • It sounds like you've installed a console-only ("server") version of Ubuntu? – steeldriver Dec 27 '15 at 21:44
  • yes, updated the question with the full version information – user2883071 Dec 27 '15 at 21:47
  • We can not tell from the version if it has X11. But do not worry. Ubuntu and Debian have many variants (steeldriver used the word version to describe this. This is correct, but ambiguous). Each variant differs only in what software is installed by default. Therefore it is possible to change variant by installing extra software. As icespiker said you can add the minimal X11 by typing this into the command line sudo apt-get install xorg. You may also want to consider gnome, kde, fvwm or a different window-managment-system to go on top of X11. – ctrl-alt-delor Dec 28 '15 at 10:31
up vote 2 down vote accepted

You may want to take a look at Xming, which provides the X window display server on your Windows host (you could also use Cygwin, for some it might be preferable).

  • You do not need X11 server on the remote end. Only on the local end. But you will need the X11 clients (eg xterm). – ctrl-alt-delor Dec 27 '15 at 23:28
  • Also consider vnc. – ctrl-alt-delor Dec 27 '15 at 23:29
  • @richard Thank you for correcting my answer. I would too recommend vnc. tigervnc is my favorite implementation, and it's frequently updated (also has Windows binaries). – deekin Dec 27 '15 at 23:43
  • I should maybe add that, as the protocol vnc uses is pixel based, a display server such as X is mandatory on the vncserver host (which, in OP's case would be his guest system). – deekin Dec 28 '15 at 0:01
  • 1
    ... when you have installed it you'll be able to run software in a window system there locally (and you'll then satisfy the main requirement to install window managers or desktop environments such as Gnome, KDE, dwm, i3 etc..). You can install the Xorg server by typing: sudo apt-get install xorg. On the winhost side, Putty does not come with an X window display server, which is why I suggested you take a look at Cygwin or Xming. Your last comment is very confusing. Can you provide more concise information and be more clear on what machines you're running and what you're trying to achieve? – deekin Dec 28 '15 at 1:45

ssh scenario

You need to enable X11 forwarding in the ssh client (putty), and have X11 installed and running on the local machine. The machine name in the DISPLAY variable will not be the local machine, but something like :10 ( a local (from the point of view of the remote machine) connection ).

Direct use VM display

You need X11 running on the machine. If you just have a screen of text, no windows, no graphics, sometimes some colour, then you are not running X11, you can check using ps command.

We can not tell from the version if it has X11. But do not worry. Ubuntu and Debian have many variants (steeldriver used the word version to describe this. This is correct, but ambiguous). Each variant differs only in what software is installed by default. Therefore it is possible to change variant by installing extra software. As icespiker said you can add the minimal X11 by typing this into the command line sudo apt-get install xorg. You may also want to consider gnome, kde, fvwm or a different window-managment-system to go on top of X11.

  • I did enable X11 on Putty when I initiated the ssh session, however it still did not work. However when you say X11 has to be installed and running on the local machine (assuming this is the host machine (my PC)), is it not installed by default with Putty? I checked the enable X11 when initiating the session. – user2883071 Dec 28 '15 at 1:06

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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