Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have a VNCServer (vino) configured on my Ubuntu 8.10 box. I would like to connect to this server from a vncclient running on this same machine (the reason for doing this strange thing is mentioned below).

Understandably, when I connect to a vncserver on the same box, my vncclient shows recursive windows.

Is there a way I can connect to the vncserver on the same machine and not have the recursive windows problem? Perhaps if I could start the vncserver on one display and the client on another display then will it work? How can I do something like this?

Note - Reason for running vnc client and server on the same machine: When I start our Java Swing unit test suite, a bunch of swing UI's are created and destroyed as the tests run. These windows fly in the foreground making it impossible to work while the test suite is running. I am hoping to start the test suite within a vncclient so that I can continue working while the tests run.


Some searching seems to suggest that I can start a process on another display. I tried doing this to start vncviewer on another display.

export DISPLAY=:1
vncviewer localhost:0

but I get an error -

Error: Can't open display: :1

Does anyone know why I get this error message (I am running Ubuntu 8.10)?

share|improve this question
Have you considered Xvfb or xephyr? – hop Mar 29 '10 at 10:52
you get the error message because you don't have another display. use xvfb or xephyr to get another display. – hop Mar 31 '10 at 1:32
up vote 1 down vote accepted

Use Xvfb or Xephyr to create another (virtual) display and then tell your application to use that display.

Forget about VNC.

share|improve this answer

Use Xnest:

Xnest :1.0 &
DISPLAY=1.0 xlogo
share|improve this answer
Xnest is considered obsolete and supplanted by Xephyr. – hop Mar 31 '10 at 10:20
Thank you. I did not know that. – Mircea Vutcovici Mar 31 '10 at 13:12

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.