kavejo
By:
kavejo

Help in setting up LXDE or XFCE on CentOS 7 coupled with tiger-vnc

October 24, 2014 24.5k views

Hello everyone,

I'm struggling in setting up a desktop environment on CentOS 7.
I have tried following multiple guides but with no luck.

I have followed these guides with no luck.

I have followed a guide for LXDE with no luck either.

At some point I got it working through DO remote console following a guide for Gnome 3 for CentOS 7 but the whole desktop environment was about 2 GB on disk.

Any way I haven't managed to have tiger-vnc working.

I tried to set it up at every attempt (7-8 times) and I managed to connect for a short time when I had installed Gnome 3. But after a reboot it failed to start hence I was not able to connect.

Is there anyone able to suggest a guide to get a light desktop environment for CentOS 7 as well as one for having constantly working a VNC server?

Thank you.

3 Answers

The instructions below are not terribly detailed, but should get you moving in the right direction.

#################################################
## These first several can be run directly as root
## or via SUDO

## Make sure all of the packages are up to date
sudo yum -y update

## This provides extra packages not included in the base
sudo yum -y install epel-release

## This is optional, but is a sanity-saver
sudo yum -y install bash-completion

## This installs the XFCE desktop environment
sudo yum -y groups install Xfce

## This installs your VNC Server
sudo yum -y install tigervnc-server

## This puts the VNC server under management by systemd
sudo cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

#################################################
## This next one should be run from the user as 
## whom you will log-in using VNC. This should 
## NOT be root
##
## If the user is not able to issue commands as
## root using SUDO, you will need to manually edit
## the file /etc/systemd/system/vncserver@:1.service
## as root and put in that user's name instead

## This puts the VNC user's information into the startup file
sudo sed -i -e 's![<]USER[>]!'"${LOGNAME}"'!g' /etc/systemd/system/vncserver@:1.service

#################################################
## This next one should be run from the user as 
## whom you will log-in using VNC. This should 
## NOT be root
##

## Set the VNC password and configuration for VNC user
vncserver

#################################################
## These next ones can be run directly as root
## or via SUDO

## Make sure VNC Server starts at boot time
sudo systemctl enable vncserver@:1.service

## Make sure systemd has picked up the new configs
sudo systemctl daemon-reload

#################################################
## This next one is only needed if you are running
## FirewallD 

## Allow VNC Server traffic through the firewall
#sudo firewall-cmd --permanent --zone=public --add-service vnc-server

At this point, you should be able to access your server via VNC (the connection address would be the server's IP, followed by a ":1", so if your server's IP address were 10.253.126.17, the connection address would be "10.253.126.17:1").

Note, you will likely need to configure XFCE to do anything useful, like start a window-manager (xfwm4) and a terminal (xterm) when you log in, but that's another story, for another time (and you can probably figure it out from http://docs.xfce.org/)

To use XFCE do

yum groupinstall "X Windows System" -y
yum groupinstall "Xfce4" -y

and apply Step 3, 4, 5 and 6 this tutorial
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-remote-access-for-the-gnome-desktop-on-centos-7

after that if you want to keep security apply the firewall and selinux settings.

here is the tricky part.

before you run

systemctl start vncserver@:4.service

edit /etc/X11/xinit/Xclients file

and add

if [ -x /bin/xfce4-terminal ] ; then
        exec /bin/xfce4-terminal
    fi

before last curly brackets.

you can start VNC server with

systemctl start vncserver@:4.service

I think xfce will show up in your vnc client.

VNC or Virtual Network Computing is a platform-independent protocol that enables users to connect to a remote computer system and use its resources from a Graphical User Interface (GUI). It's like remote controlling an application: the client computer's keystrokes or mouse clicks are transmitted over the network to the remote computer. VNC also allows clipboard sharing between both computers. This tutorial covers remote access to a GNOME desktop for two users.

I got:

]# yum groupinstall "X Windows System" -y
Loaded plugins: fastestmirror, langpacks, universal-hooks
Loading mirror speeds from cached hostfile

  • EA4: 69.72.212.11
  • cpanel-addons-production-feed: 69.72.212.11
  • base: cosmos.illinois.edu
  • epel: mirror.math.princeton.edu
  • extras: mirror.umd.edu
  • updates: centos.mirror.constant.com Warning: group X Windows System does not exist. Maybe run: yum groups mark install (see man yum) Error: No packages in any requested group available to install or update [root@ns1 ~]# yum groupinstall "Xfce4" -y Loaded plugins: fastestmirror, langpacks, universal-hooks Loading mirror speeds from cached hostfile
  • EA4: 69.72.212.11
  • cpanel-addons-production-feed: 69.72.212.11
  • base: mirror.cs.uwp.edu
  • epel: epel.mirror.constant.com
  • extras: mirror.umd.edu
  • updates: centos.mirror.constant.com Warning: group Xfce4 does not exist. Maybe run: yum groups mark install (see man yum) Error: No packages in any requested group available to install or update
Have another answer? Share your knowledge.