• Comments
  • Tiger VNC startup in RHEL 7

    Posted on

    OS: RHEL 7

    Used the instructions here:
    https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-TigerVNC.html

    Expected behavior:
    systemctl start vncserver@:4.service should report a successful start.

    Actual behavior:
    Job for vncserver@:4.service failed. See 'systemctl status vncserver@:4.service' and 'journalctl -xn' for details.

    Workaround: start vncserver manually by USER with "vncserver" command with no arguments. This means that for every server restart, each VNC user has to SSH in and initialize a vncserver manually, figure out which port it opened on, and connect to that. Sometimes users connecting this way report only a black screen w/ a cross-pointer.

    Issue: What can I do to make the config files load VNC service (with active GUI) for each user automatically at boot-up, to their assigned TCP ports?

    Command line log:

    sudo systemctl start vncserver@:4.service
    Job for vncserver@:4.service failed. See 'systemctl status vncserver@:4.service' and 'journalctl -xn' for details.
    [stanasa@localhost ~]$ sudo systemctl status vncserver@:4.service
    vncserver@:4.service - Remote desktop service (VNC)
       Loaded: loaded (/usr/lib/systemd/system/vncserver@:4.service; disabled)
       Active: failed (Result: exit-code) since Wed 2014-07-30 15:26:03 EDT; 10s ago
      Process: 13245 ExecStart=/sbin/runuser -l stanasa -c /usr/bin/vncserver %i (code=exited, status=98)
      Process: 13238 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
    
    Jul 30 15:26:03 localhost.localdomain systemd[1]: vncserver@:4.service: contr...
    Jul 30 15:26:03 localhost.localdomain systemd[1]: Failed to start Remote desk...
    Jul 30 15:26:03 localhost.localdomain systemd[1]: Unit vncserver@:4.service e...
    Hint: Some lines were ellipsized, use -l to show in full.
    
    ###########
    Content of /lib/ vncserver@:4.service, OWNED by root
    
    ...
    [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 stanasa -c "/usr/bin/vncserver %i -geometry 1200x900"
    PIDFile=/home/stanasa/.vnc/%H%i.pid
    ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
    
    [Install]
    WantedBy=multi-user.target
    
    
    ####### Content of home/USERNAME/.vnc/xstartup, owned by USERNAME
    #!/bin/sh
    
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    
    exec /etc/X11/xinit/xinitrc &
    

    by

    points

    Responses

    Red Hat
    © 2025 Red Hat, Inc.