TigerVNC installation on CentOS 7 (as in Red Hat System Administrator's Guide )
3
votes
2
answers
3008
views
I want to install TigerVNC on my freshly installed CentOS 7 server,
version centos-release-7-4.1708.el7.centos.x86_64.
So besides other tutorials I've tried already, I followed the
Red Hat guide.
However with variable error messages depending on the tutorial I never got the service to start. The following is exactly what I did on a new installation of CentOS 7:
yum install tigervnc-server
cp /usr/lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@.service
vi /etc/systemd/system/vncserver@.service
initial file content:
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
User=
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=-/usr/bin/vncserver -kill %i
ExecStart=/usr/bin/vncserver %i
PIDFile=/home//.vnc/%H%i.pid
ExecStop=-/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
file content after edit:
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
User=root
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=-/usr/bin/vncserver -kill %i
ExecStart=/usr/bin/vncserver %i
PIDFile=/home/root/.vnc/%H%i.pid
ExecStop=-/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
Instructions after file edit:
systemctl daemon-reload
su - root
vncpasswd
systemctl start vncserver@:1.service
Job for vncserver@:1.service failed because a timeout was exceeded. See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.
[root@localhost ~]# systemctl status vncserver@:1.service
● vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@.service; disabled; vendor preset: disabled)
Active: failed (Result: timeout) since Wed 2018-01-03 09:00:17 UTC; 22s ago
Process: 2045 ExecStart=/usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
Process: 2040 ExecStartPre=/usr/bin/vncserver -kill %i (code=exited, status=2)
Jan 03 08:58:50 localhost vncserver: New 'localhost:1 (root)' desktop is localhost:1
Jan 03 08:58:50 localhost vncserver: Creating default startup script /root/.vnc/xstartup
Jan 03 08:58:50 localhost vncserver: Creating default config /root/.vnc/config
Jan 03 08:58:50 localhost vncserver: Starting applications specified in /root/.vnc/xstartup
Jan 03 08:58:50 localhost vncserver: Log file is /root/.vnc/localhost:1.log
Jan 03 08:58:50 localhost systemd[1] : PID file /home/root/.vnc/localhost:1.pid not readable (y...art.
Jan 03 09:00:17 localhost systemd[1] : vncserver@:1.service start operation timed out. Terminating.
Jan 03 09:00:17 localhost systemd[1] : Failed to start Remote desktop service (VNC).
Jan 03 09:00:17 localhost systemd[1] : Unit vncserver@:1.service entered failed state.
Jan 03 09:00:17 localhost systemd[1] : vncserver@:1.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
Does anyone have a clue how I can solve this?
Asked by J.Ober
(31 rep)
Jan 3, 2018, 09:17 AM
Last activity: Aug 4, 2025, 03:06 PM
Last activity: Aug 4, 2025, 03:06 PM