Install Xfce VNC remote desktop on CentOS 7

Xfce is a lightweight linux desktop environment. You can install Xfce on a remote server or virtual machine, connect to it using VNC to use it as a desktop.

xfce remote desktop

To install Xfce, enable EPEL repo

Install Xfce

You can see other groups available with command “yum grouplist”.

Insall vnc server

Creating User

We need to create a normal linux user to use with Xfce. Using it as root is not recommended.

To create user, run

Replace “serverok” with whatever username you want to use.

Configure VNC server

Change to the user we created before

To create initial vnc config files and set password, run

We used -fg option to keep vncserver in forground. vcnserver will ask you to set password, this will be used to connect to VNC server.

When i run “vncserver -fg” on CentOS, it exited with error. If it keep running, press CTRL+C to stop vnc server.

If you run with out -fg option, you can stop vnc server with command

Edit file

Replace contents of this file with following

Now you can start vncserver manually with command

You will be able to connect to VNC server with YOUR_SERVER_IP:1

Auto start VNC server

Following need to be done as user root.

Edit file

Find

Replaced with

reload systemctl

Enable vncserver to start on boot

Start vncserver

Open port in firewall

You need to open VNC port in firewall. vnc ports start at 5900, for :1, it will be 5901.

If you are using firewalld, you can open port 5901 with

firewall-cmd command is run 2 times as first command only make changes in current session. second command with –permanent option make changes permanent, but that only happens after you reload firewalld or reboot server. Running command 2 times make the changes permanent and apply changes to current session.

See VNC, Remote Desktop

Leave a Reply

Your email address will not be published. Required fields are marked *