
Vim /etc/tigervnc/vncserver-config-defaults and add “session=gnome” This is needed to have “.vnc” folder with correct SELinux context.Īlternatively you can use: restorecon -RFv $HOME/.vnc If you already have VNC installed, you need to remove “$HOME/.vnc folder” if it exists and recreate again with vncpasswd.


Restorecon /usr/sbin/vncsession /usr/libexec/vncsession-start Semodule -i /usr/share/selinux/packages/vncsession.pp To enable and use tigervnc, in the following steps:

Setting Graphical Login as Default – As root: systemctl set-default graphical.target and reboot.
START VNC SERVER HOW TO
Read Also : How to Configure Rsyslog Server in CentOS 8 / RHEL 8Īfter you install the BaseOS of RHEL 8 and add the repo files, yum update -yĪfter you install the workstation or server: yum install gnome* -y See you in the next article…Until then a big THANK YOU and BYE for now!!! Please provide your comments and suggestion in the feedback section below. Hope the step-by-step guide to install VNC server on Centos 8 / RHEL 8 has provided you with all the information to easily setup VNC Server and access remote desktops. That’s it, you’ve successfully installed VNC Server in Centos 8 / RHEL 8.
START VNC SERVER PASSWORD
Enter the password that you have created earlier for your local user and click OK to continue
START VNC SERVER WINDOWS
To access the remote desktop, Start the VNC Viewer from your Windows / Linux workstation and enter your VNC server IP Address and Port Number and then hit enter Now we are all set to see if the remote desktop connection is working. ~]# Step 6) Connect to Remote Desktop Session Use the following command allow VNC Server port “5901” in os firewall, ~]# firewall-cmd -permanent -add-port=5901/tcp Use below systemctl command to verify the status of VNC server, ~]# systemctl status :1.serviceĪbove command’s output confirms that VNC is started successfully on port tcp port 5901. Use below netstat or ss command to verify whether VNC server start listening its request on 5901, ~]# netstat -tunlp | grep 5901 ~]# systemctl enable :1.serviceĬreated symlink /etc/systemd/system// :1.service → /etc/systemd/system/ I am using display number as 1, so use the following commands to start and enable vnc service on display number “1”, ~]# systemctl daemon-reload Step 5) Start VNC Service and allow port in firewall Note:Replace the user name in above file which suits to your setup.īy default, VNC server listen on tcp port 5900+n, where n is the display number, if the display number is “1” then VNC server will listen its request on TCP port 5901. ~]# vim /etc/systemd/system/ ĮxecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'ĮxecStart=/sbin/runuser -l pkumar -c "/usr/bin/vncserver %i -geometry 1280x1024"ĮxecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' Create a file “ /etc/systemd/system/ ” with the following content so that tigervnc-server’s service started for above local user “pkumar”. Next step is to configure VNC Server Configuration file. ~]# Step 4) Setup VNC Server Configuration File Would you like to enter a view-only password (y/n)? n Let’s assume we want ‘pkumar’ user to use VNC for remote desktop session, then switch to the user and set its password using vncpasswd command, ~]# su - pkumar Now install TigerVNC Server using the following command: ~]# dnf install tigervnc-server tigervnc-server-module -y Step 3) Set VNC Password for Local User

It is one of the most popular VNC Server and a high-performance and platform-independent VNC that allows users to interact with remote machines easily. Next we’ll install the VNC Server, there are lot of VNC Servers available, and for installation purposes, we’ll be installing TigerVNC Server. ~]# sed -i -follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux Step 2) Install VNC Server (tigervnc-server) VNC server will not work properly if SElinux is enabled on your system, as of now work around is to disable it using following commands, ~]# setenforce 0 Note: Wayland is the default display manager (GDM) in GNOME and it not is configured to handled remote rendering API like X.org Once the system is rebooted successfully uncomment the line “ WaylandEnable=false” from the file “ /etc/gdm/nf” so that remote desktop session request via vnc is handled by xorg of GNOME desktop in place of wayland display manager. Now reboot the system so that we get GNOME login screen. Once the above packages are installed successfully then run the following command to enable the graphical mode ~]# systemctl set-default graphical if you don’t have it in your system, install it using the following command: ~]# dnf groupinstall "workstation" In CentOS 8 / RHEL 8, GNOME is the default desktop environment.
