How to Install and Configure VNC on CentOS 7

How to Install and Configure VNC on CentOS 7
User
9 Min Read
2025/08/25

Working only with SSH and command lines on a CentOS 7 server can get a bit tiring. Some people are fine with it, but many would rather have a desktop they can click through instead of typing everything by hand. That’s why setting up VNC on CentOS 7 is so popular it gives you a full graphical interface, almost like you’re sitting at the machine.

In this guide, I’ll walk you through the process step by step so you can get remote desktop access working without the usual headaches.

 Update Your CentOS 7 Before Installing VNC

Before you dive into the VNC setup, take a moment to update your system packages. Run:

yum update -y

That way you won’t hit weird errors because of outdated stuff.

Next, you’ll need a desktop environment VNC on its own won’t give you a GUI. The easiest choice is GNOME. Install it with:

yum groupinstall "GNOME Desktop" -y

It takes a while, so let it finish. Once GNOME is in place, you can add the VNC server itself:

yum install tigervnc-server xorg-x11-fonts-Type1 -y

Now the base pieces are ready, and you can move on to the VNC configuration part.

Configure VNC on CentOS 7 (Step-by-Step)

First, grab the default VNC service file and make a copy of it. This file is just a template, and the number you add at the end decides which port VNC will use. For example, :3 means it’s going to run on port 5903.

cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:3.service

If you’d rather use port 5901 or 5902, just replace the 3 with 1 or 2.

Now, you’ll need a regular user. Root logins over VNC don’t work, so create a new account:

useradd eldernode
passwd eldernode

Next, edit the service file you just copied:

vi /etc/systemd/system/vncserver@:3.service

Anywhere you see the placeholder username, swap it out with the one you created (in this case, eldernode).

Switch into that user account and start VNC for the first time:

su - eldernode
vncserver

It’ll ask you to set a VNC password this is the one you’ll type in later when you connect.

Don’t forget the firewall. The port’s closed by default, so you’ll need to open it before VNC will work:

firewall-cmd --permanent --zone=public --add-port=5903/tcp
firewall-cmd --reload

Finally, reload systemd, start the VNC service, and enable it so it automatically runs after a reboot:

systemctl daemon-reload
systemctl start vncserver@:3.service
systemctl enable vncserver@:3.service

That’s it your VNC server on CentOS 7 should be running now. Next, we’ll connect to it using a VNC client.

 

Connect to Your CentOS 7 Server with a VNC Client

Once the server side is ready, you still need a viewer on your own computer. Most people go with RealVNC or TigerVNC, but any standard client will do. Install one, fire it up, and in the connection box type your server’s IP plus the port something like 192.168.1.10:5903.

It’ll pop up and ask for the VNC password you created earlier. Enter it, and if all went well you’ll suddenly be looking at a CentOS 7 desktop instead of a black terminal window. From there, you can move the mouse, open apps, and manage the server just like it was sitting on your desk.

 

Troubleshooting VNC on CentOS 7

Sometimes VNC still refuses to connect, even if you went through every step. Don’t panic it usually comes down to something small. Here are a few things worth checking:

Firewall rules. Double-check that the right port is actually open. VNC won’t work if you forgot to reload the firewall after adding the rule. I’ve run into this more than once.

SELinux. On some CentOS servers, SELinux quietly blocks VNC. You can try disabling it for a moment if VNC connects after that, you’ve found the problem.

Service status. Run:

systemctl status vncserver@:3.service

If it’s not running, the logs (journalctl -xe) usually point you to the problem.

User and password. Remember, root can’t log in. Make sure you’re using the non-root user you created, with the VNC password you set earlier.

Display number. If :1 doesn’t work, it might already be taken. Try :2 or :3 instead.

Most of the time, fixing one of these little issues gets VNC up and running.

 

Conclusion

Getting VNC up and running on CentOS 7 isn’t rocket science once you follow the steps, it just works. Instead of staring at a plain terminal, you suddenly get a full desktop you can move around in. It makes managing the server feel a lot less tiring, especially if you’re not the type who enjoys typing long commands all day.

VNC’s all set up now, so you can hop in remotely whenever you like. If it doesn’t connect right away, don’t overthink it most of the time it’s just a firewall rule or a small config you missed.

I’ve set this up on plenty of servers myself, and it always makes life easier when I need quick access to a GUI. If you want to go further into Linux server management, stick around there’s a lot more we can dive into.

0 out of 0 votes
Leave a Reply

Full Name*
Email*
Comment *

Calculate the value of 4 - 2 :

Save my name, email, and website in this browser for the next time I comment.
Recent Replies
Show More

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day