LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 03-02-2021, 04:36 AM   #1
cristi92b
Member
 
Registered: May 2011
Posts: 94

Rep: Reputation: Disabled
Configuring TigerVNC on CentOS 8


I am trying to configure TigerVNC server on CentOS 8 but when I try to start the server using systemctl it stops right after startup.
Please find below the steps that I did:

1) I installed tigervnc-server package:
Code:
# dnf install tigervnc-server
2) I edited the tigervnc-server config file adding my user:

Code:
# nano /etc/tigervnc/vncserver.users
Code:
# cat /etc/tigervnc/vncserver.users
# TigerVNC User assignment
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#
# :2=andrew
# :3=lisa
 
:2=cristian
The user that I added is in the sudoers (wheel) group:
Code:
# cat /etc/group
root:x:0:
bin:x:1:
daemon:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mem:x:8:
kmem:x:9:
wheel:x:10:cristian
cdrom:x:11:
mail:x:12:
man:x:15:
dialout:x:18:
floppy:x:19:
games:x:20:
tape:x:33:
video:x:39:
ftp:x:50:
lock:x:54:
audio:x:63:
users:x:100:
nobody:x:65534:
dbus:x:81:
utmp:x:22:
utempter:x:35:
input:x:999:
kvm:x:36:qemu
render:x:998:
systemd-journal:x:190:
systemd-coredump:x:997:
systemd-resolve:x:193:
tss:x:59:
polkitd:x:996:
geoclue:x:995:
ssh_keys:x:994:
printadmin:x:993:
gluster:x:992:
rtkit:x:172:
pipewire:x:991:
pulse-access:x:990:
pulse-rt:x:989:
pulse:x:171:
libstoragemgmt:x:988:
qemu:x:107:
usbmuxd:x:113:
unbound:x:987:
rpc:x:32:
chrony:x:986:
avahi:x:70:
brlapi:x:985:
setroubleshoot:x:984:
saslauth:x:76:
cgred:x:983:
dnsmasq:x:982:
radvd:x:75:
sssd:x:981:
libvirt:x:980:
cockpit-ws:x:979:
cockpit-wsinstance:x:978:
flatpak:x:977:
colord:x:976:
rpcuser:x:29:
abrt:x:173:
gdm:x:42:
clevis:x:975:
gnome-initial-setup:x:974:
sshd:x:74:
slocate:x:21:
dip:x:40:
rngd:x:973:
tcpdump:x:72:
cristian:x:1000:
3) I edited the default config file specifying the session type:

Code:
# nano /etc/tigervnc/vncserver-config-defaults
Code:
# cat /etc/tigervnc/vncserver-config-defaults 
## Default settings for VNC servers started by the vncserver service
#
# Any settings given here will override the builtin defaults, but can
# also be overriden by ~/.vnc/config and vncserver-config-mandatory.
#
# See the following manpages for more details: vncserver(1) Xvnc(1)
#
# Several common settings are shown below. Uncomment and modify to your
# liking.

# securitytypes=vncauth,tlsvnc
# desktop=sandbox
# geometry=2000x1200
# localhost
# alwaysshared
session=gnome
4) I set a VNC password for the user that I created:
Code:
# su cristian
$ vncpasswd
5) I enabled and started the service:
Code:
# systemctl enable --now vncserver@:2
But the service is inactive:
Code:
# systemctl status vncserver@:2
● vncserver@:2.service - Remote desktop service (VNC)
   Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Tue 2021-03-02 01:53:47 PST; 2min 15s ago
  Process: 38978 ExecStart=/usr/libexec/vncsession-start :2 (code=exited, status=0/SUCCESS)
 Main PID: 38984 (code=exited, status=0/SUCCESS)

Mar 02 01:53:45 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
Mar 02 01:53:45 localhost.localdomain systemd[1]: Started Remote desktop service (VNC).
Mar 02 01:53:47 localhost.localdomain systemd[1]: vncserver@:2.service: Succeeded.
I followed the steps here (the 5 steps above are the same steps): https://serverspace.us/support/help/...r-on-centos-8/

Should I create a config file for my service in /etc/systemd/system ?

If yes, then is this the correct template file: ?
Code:
# cat /lib/systemd/system/vncserver@.service 
# The vncserver service unit file
#
# Quick HowTo:
# 1. Add a user mapping to /etc/tigervnc/vncserver.users.
# 2. Adjust the global or user configuration. See the
#    vncsession(8) manpage for details. (OPTIONAL)
# 3. Run `systemctl enable vncserver@:<display>.service`
# 4. Run `systemctl start vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "nolisten=tcp" to prevent X connections to your VNC server via TCP.
#
# Use "localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.


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

[Service]
Type=forking
ExecStart=/usr/libexec/vncsession-start %i
PIDFile=/var/run/vncsession-%i.pid
SELinuxContext=system_u:system_r:vnc_session_t:s0

[Install]
WantedBy=multi-user.target

Last edited by cristi92b; 03-02-2021 at 04:40 AM.
 
Old 03-03-2021, 08:00 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
There should be a log file under ~christian/.vnc. You might also find something in the journal.

You could also try running vncserver directly on the command line. When that works, start debugging the systemd service.
 
  


Reply

Tags
centos, centos8, systemd, tigervnc, vncserver



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CentOS 7 - Unable to set geometry on tigervnc-server philx66 Red Hat 0 07-27-2014 09:45 AM
TigerVNC on 2010.1 MartenH Mandriva 3 08-01-2010 11:26 AM
Mandriva 2010.1 TigerVNC setup msdobrescu Linux - Networking 2 07-19-2010 11:13 PM
Anyone got a slackbuild/package for TigerVNC? (Not TightVNC!) uppman Slackware 2 04-16-2010 06:42 AM
TigerVNC in Fedora 12 on PC without monitor kuzja_21 Linux - Newbie 10 01-18-2010 08:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration