I installed tigervnc-server on CentOS Linux (release 7.7.1908).
I configured and enabled VNC service successfully, however, running
sudo systemctl status vncserver@:1.service
gives the following output:
vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: failed (Result: resources) since Thu 2019-10-10 13:57:15 +03; 34s ago
Process: 1379 ExecStart=/usr/sbin/runuser -l user-1 -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
Process: 1291 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Oct 10 13:57:09 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
Oct 10 13:57:15 localhost.localdomain systemd[1]: New main PID 1779 does not belong to service, and PID file is not owned by root. Refusing.
Oct 10 13:57:15 localhost.localdomain systemd[1]: New main PID 1779 does not belong to service, and PID file is not owned by root. Refusing.
Oct 10 13:57:15 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
Oct 10 13:57:15 localhost.localdomain systemd[1]: Unit vncserver@:1.service entered failed state.
Oct 10 13:57:15 localhost.localdomain systemd[1]: vncserver@:1.service failed.
I can see that VNC server is running:
ps aux | grep vnc
user+ 1779 0.2 0.7 184456 30936 ? S 13:57 0:00 /usr/bin/Xvnc :1 -auth /home/user-1/.Xauthority -desktop localhost.localdomain:1 (user-1) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/user-1/.vnc/passwd -rfbport 5901 -rfbwait 30000
user+ 1895 0.0 0.0 113184 1184 ? S 13:57 0:00 /bin/sh /home/user-1/.vnc/xstartup
and I can also connect to the machine via VNC client but the screen resolution is not changed to 1920×1080.
What can cause such a problem?
Best Answer
I have found this link which explains that there have been some changes to systemd, so this is more than likely where the issue is coming from.
https://community.oracle.com/thread/4286364
I have removed the line referring to the pid from my vncserver@:x file and no longer get an error reporting, although the pid is still reporting an error. Hopefully there will be a fix shortly.
Hope this is some help and may resolve your issue