1

Good day

I'm running RHEL 7.6 with kernel version 3.10.0-514.el7.x86_64.

Vncserver version is tigervnc-server-1.8.0-17.el7.x86_64.

My vncserver@:1.service file looks like this, I have replaced <user> whith a valid user.

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l <user> -c "/usr/bin/vncserver %i"
PIDFile=/home/<user>/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

When I execute the command systemctl start vncserver@:1 I get the followin error

Job for vncserver@:1.service failed because a configured resource limit was exceeded. See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.

systemctl status vncserver@:1 shows this

Oct 01 09:05:21 systemd[1]: Starting Remote desktop service (VNC)...

Oct 01 09:05:24 host_name systemd[1]: Can't open PID file /home/user/.vnc/host_name:1.pid (yet?) after start: No such file or directory

Oct 01 09:05:24 host_name systemd[1]: Failed to start Remote desktop service (VNC).

Oct 01 09:05:24 host_name systemd[1]: Unit vncserver@:1.service entered > failed state.

Oct 01 09:05:24 host_name systemd[1]: vncserver@:1.service failed.

Every time I execute systemctl start vncserver@:1 the N increase host_name:N.pid file in /home/user/.vnc it should stay at 1.

My xstartup file in the .vnc directory looks like this.

    #!/bin/sh
     unset SESSION_MANAGER 
     unset DBUS_SESSION_BUS_ADDRESS
     /etc/X11/xinit/xinitrc 
    # Assume either Gnome or KDE will be started by default when installed 
    # We want to kill the session automatically in this case when user logs out. In case you modify 
    # /etc/X11/xinit/Xclients or ~/.Xclients yourself to achieve a different result, then you should 
    # be responsible to modify below code to avoid that your session will be automatically killed 

     if [ -e /usr/bin/gnome-session -o -e /usr/bin/startkde ]; 
     then
         vncserver -kill $DISPLAY 
     fi

I have disabled my firewall and put seLinux in Permissive mode still the same error, however I have created a vncserver@:13.service file for root wich starts with no problem.

Any help will be greatly appreciated

Regards

2
  • Have you checked the permissions on /home/user/.vnc ? Oct 1, 2019 at 8:30
  • I have and they belong to the user, it is rwx for the user an rw for group.
    – Chris
    Oct 1, 2019 at 14:02

2 Answers 2

0

I had the same issue on a centos-release-7-7.1908.0.el7.centos.x86_64 with 3.10.0-1062.4.3.el7.x86_64 kernel, exact same setup and configuration.

I noticed via journalctl -xe an error generated during startup phase of the service while trying to access the /tmp/.X11-unix/X59 file (my VNC is setup to run on port 5959). After manually deleting it, the service got regularly back on track.

0

RHEL7 and CentOS 7 come with iptables turned on by default. I received all sorts of odd errors from it. This was very similar to one of them You can make sure that this is your situation by running:

sudo systemctl status firewalld

If this is the case you should open VNC in your iptables, see details here: https://wiki.centos.org/HowTos/VNC-Server#Amend_the_iptables or https://www.cyberciti.biz/faq/linux-iptables-open-vncserver-port-6000-5800-5900/

Alternately if this server does not need to be secured by iptables (Ideally if it's behind a different firewall), you can just disable and stop iptables like so:

sudo systemctl stop firewalld && sudo systemctl disable firewalld

Stop will stop it and disable will stop it from returning after a restart.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.