• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

vncserver fails with “Starting VNC server: no displays configured”

by admin

Question

When I try to start/restart the “vncserver” service, it fails with the below error.

# service vncserver restart
Starting VNC server: no displays configured

Solution

Check for the Syntax of the /etc/sysconfig/vncservers file

1. The above error mostly occurs when you syntax error in the vncserver configuration file /etc/sysconfig/vncservers. You can verify if you have the configuration entries in below format.

# vi /etc/sysconfig/vncservers
VNCSERVERS="2:myusername"
VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

2. One of the most common mistake users do is that they use unnecessary spaces in the configuration file. For example, following line exists in /etc/sysconfig/vncservers, and have typos such as space between “N” and “[user]”

# cat /etc/sysconfig/vncservers
...
VNCSERVERS="N: [user]"

3. Sometimes you copy the configuration file lines from some book or website, which may also copy some junk characters. These are hard to find. You can use the below command to see if the file contains any junk characters.

# cat -evt /etc/sysconfig/vncservers | grep -v "#"

4. Another useful tip is to edit the below commented lines by hand which are already present in the configuration file /etc/sysconfig/vncservers.

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

The above 2 lines are present by default for sample configuration. Make sure you remove the “#” in front of these lines before using them.

5. You should see output similar to shown below when the configuration file is with correct syntax.

# service vncserver start
Starting VNC server: 2:root 
New 'geek.mylabserver.com:2 (root)' desktop is geek.mylabserver.com:2

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/geek.mylabserver.com:2.log

3:user 
New 'geek.mylabserver.com:3 (user)' desktop is geek.mylabserver.com:3

Creating default startup script /home/user/.vnc/xstartup
Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/geek.mylabserver.com:3.log

                                                           [  OK  ]
How to configure VNC Server on CentOS/RHEL 6

Filed Under: Linux

Some more articles you might also be interested in …

  1. flutter: Google’s free, open source, and cross-platform mobile app SDK
  2. ping Command Examples in Linux
  3. semanage Command Examples in Linux
  4. lshal Command Examples in Linux
  5. efibootmgr Command Examples in Linux
  6. debugfs: command not found
  7. cpufreq-info Command Examples in Linux
  8. lcov: command not found
  9. dolt sql: Run a SQL query. Multiple SQL statements must be separated by semicolons
  10. dolt checkout: Checkout the work tree or tables to a specific branch or commit

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright