> ## Content Index
> Fetch the complete content index at: https://bgpgeek.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Building a Networking Virtual Lab part 2: Install VNC with XFCE on CentOS 7
- URL: https://bgpgeek.com/install-vnc-with-xfce/
- Published: 2018-02-26T21:30:00.000Z
- Updated: 2026-09-15T21:21:46.000Z
- Author: BGPGeek
- Tags: Lab, Networking, XFCE, VNC, KVM, Libvirt, Centos7, Virtual, #Import 2026-05-29 14:39, #Import 2026-09-15 21:11

# Introduction

This is part two of Building a Networking Virtual Lab. VNC can be used to manage your Hypervisor via the Virtual Machine Manager GUI.

# Step 1 Install VNC/XFCE CentOS packages

`yum install epel-release –y`  
`yum groupinstall xfce -y`  
`yum install tigervnc-server -y`  
`yum -y groupinstall X11 -y`

# Step 2 Setup VNC password for user

Login as your kvmuser. You can use any username for this.  
`su - kvmuser`  
Set a VNC password for your user.  
`vncserver`  
Exit to move back to the root user.  
`exit`

Backup the xstatup file.  
`mv /home/kvmuser/.vnc/xstartup /home/kvmuser/.vnc/xstartup.org`  
create a new xstartup file.  
`vi /home/kvmuser/.vnc/xstartup`

> #!/bin/bash  
> xrdb $HOME/.Xresources  
> startxfce4 &

Fix owner/permissions on the new file.  
`chown kvmuser:kvmuser /home/kvmuser/.vnc/xstartup`  
`chmod 755 /home/kvmuser/.vnc/xstartup`

Copy the sample VNC service.  
`cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service`

Edit the following lines in the file to look like the below.  
`vi /etc/systemd/system/vncserver@:1.service`

> #User=<USER>  
> ExecStart=/sbin/runuser -l kvmuser -c "/usr/bin/vncserver %i"  
> PIDFile=/home/kvmuser/.vnc/%H%i.pid

# Step 3 Start VNC server

Permit the VNC service on the firewall and reload the firewall service.  
`firewall-cmd --permanent --zone=public --add-service vnc-server`  
`firewall-cmd --reload`

As we have made changes to the systemctl we need to reload the daemon.  
`systemctl daemon-reload`

Start the vncserver service and set to start at boot.  
`systemctl enable vncserver@:1 && systemctl start vncserver@:1`

# Step 4 Start vnc server

Connect to the hypervisor via VNC to use Virtial Machine Manager.  
![vnc.png](https://bgpgeek.com/content/images/2026/09/vnc.png)

# Links

[Part1](https://bgpgeek.com/install-kvm-on-centos-7/)  
[Part3](https://bgpgeek.com/install-vagrant-on-centos7/)