Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to start vncserver with the following command--

/sbin/service vncserver start

This is the error I am getting--

Starting VNC server: no displays configured 

How do I setup vncserver correctly?

share|improve this question
add comment

2 Answers

I got that error after a fresh install of Centos 6.3 i386. The issue is that /etc/sysconfig/vncservers needs to be filled out. There are some basic instructions in that file's comments. I added the following:

VNCSERVERS="2:jrb"
VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

After doing that I could start the server but there are some other steps before you can get going. I found out how to do this and the remaining configuration at http://wiki.centos.org/HowTos/VNC-Server

share|improve this answer
add comment

Easy steps to confgure VNC:

  1. Create a user (e.g., user1).
  2. Edit the /etc/sysconfig/vncservers file. Enter the below entry in the file.

    VNCSERVERS="2:user1"
    VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost" 
    
  3. Login through user (user1).

  4. Execute ls -la in the user's home directory and check whether the .vnc directory exists.
  5. If not, run the vncpasswd command. It will ask for a password. Give a password you want to keep.
  6. Check the user home directory again for the existence of the .vnc directory.
  7. Start the vncserver service with service vncserver start.

For more details, see man vncserver(1), vncpasswd(1).

share|improve this answer
add comment

Your Answer

 
discard

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.