• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to install and configure VNC Server on CentOS/RHEL 8

by admin

Question: How to remotely access graphical environment on an CentOS/RHEL 8?

The access will be used using a VNC server.

Setup VNC Server

1. Install VNC Server and the graphical environment in the server:

$ sudo dnf install tigervnc-server
$ sudo dnf group install "Server with GUI"

2. Configure the users that will user VNC. Edit /etc/tigervnc/vncserver.users and add display number and user:

:[display_number]=[user]

For example:

:1=opc

3. Configure the VNC password for [user] and define the default desktop:

$ vncpasswd
$ echo session=gnome >> .vnc/config

4. Start the corresponding service:

$ sudo systemctl start vncserver@:[display_number]

For example:

$ sudo systemctl start vncserver@:1

VNC viewer access

To connect to the VNC service it’s recommended to use a SSH tunnel.

Connect using ssh

1. ssh command to connect:

$ ssh [user]@[server] -L 590[display_number]:localhost:590[display_number]

For example:

$ ssh opc@[server] -L 5901:localhost:5901

2. Connect vncviewer:

$ vncviewer localhost:[display_number]

For example:

$ vncviewer localhost:1
Note: To use the tunnel, connect to “localhost”, not the external IP address.

Connect using putty

1. Launch putty:

configure VNC in RHEL 8

2. Go to Connection -> SSH -> Tunnels:

Configure VNC CentOS 8

3. Click “Add” and then “Open”:

Install and configure VNC viewer CentOS 8

4. Connect VNC Viewer to “localhost:1”:

install and configure VNC RHEL 8

Filed Under: CentOS/RHEL, CentOS/RHEL 8, Linux

Some more articles you might also be interested in …

  1. iwconfig: command not found
  2. checkinstall Command Examples in Linux
  3. rpmbuild : command not found
  4. How to block non-root user from creating crontab entry in Linux
  5. halt: command not found
  6. How to Check whether SELinux is Enabled or Disabled
  7. CentOS / RHEL 7 : sysctl kernel parameter doesn’t take effect after reboot
  8. chmod: command not found
  9. CentOS / RHEL : How to rotate /var/log/wtmp and /var/log/btmp file using logrotate
  10. How to Check if a Service Restart or Server Reboot is required After RPM Package Update (CentOS/RHEL/Fedora)

You May Also Like

Primary Sidebar

Recent Posts

  • banner Command Examples (Print the given argument as a large ASCII art)
  • bandwhich Command Examples (Display the current network utilization by process, connection or remote IP/hostname)
  • balena Command Examples (Interact with the balenaCloud, openBalena and the balena API from the command-line)
  • badblocks Command Examples (Search a device for bad blocks)

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright