Install the desktop environment that we will use:
yum groupinstall Desktop -y
Install the TigerVNC server used for VNC access and a required package:
yum install tigervnc-server xorg-x11-fonts-Type1 -y
Enable VNC server at boot:
chkconfig vncserver on
Create a VNC password for your logged in user:
vncpasswd
Now edit the /etc/sysconfig/vncservers file and add the following to the end:
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1400x700"
Make sure to change "1:root" to "1:<user>", changing the user to the user account you with to use with VNC. Also change the resolution to the dimensions you like then save the file.
Now add proper iptables firewall rules to allow VNC access remotely:
iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT
service iptables save
service iptables restart
Now restart the VNC server then kill the active session so we can make a config change:
service vncserver restart
vncserver -kill :1
Now edit the xstartup file inside the .vnc directory of your users home directory.
nano .vnc/xstartup
Comment out the last line then set to execute gnome by adding this line:
#twm &
exec gnome-session &
Now save the file and exit, then restart the VNC server.
service vncserver restart
You should now be able to connect using a VNC client of choice on a remote computer. I recommend using RealVNC Client. Connect to your VNC at <server_ip>:1, 1 being the port.
Mest populär
Install ownCloud on CentOS 6
We will be setting up ownCloud on a fresh CentOS 6.6 64-bit installation. ownCloud is an open...
Install PPTP / PPP Proxy Server on CentOS 6
PPTP Proxy is an easy to setup proxy server that can be used as an OpenVPN alternative, and many...
Setup Teamspeak 3 Server on Linux (CentOS)
If you run a gaming community, a Teamspeak 3 server is probably a popular choice for you to have...
Setup Plex Media Server on Linux CentOS 7
Looking for a home media server to stream movies, tv shows or music? Plex is a great solution....
Change MySQL Data Directory in Linux
There's many reasons that you might want to change the directory that your MySQL data is stored...