• 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. cpupower: command not found
  2. daemon: command not found
  3. restorecon: command not found
  4. hdiutil Command Examples in Mac
  5. How to load SELinux Module For Oracleasm
  6. Configure dnsmasq to use different DNS Servers for some Domains (CentOS/RHEL)
  7. legit Command Examples in Linux
  8. aa-disable: command not found
  9. How to Partition DM-Multipath Pseudo Devices in CentOS/RHEL
  10. mke2fs Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright