fir3net
PPS-Firenetbanner-780.5x190-30-03-17

Linux - Setting up VNC Server

Below is a short guide to set up a VNC server within Linux.

INSTALL

Install the package by running the following commands,

  • Ubuntu/Debian - apt-get install vnc4server xinetd
  • Fedora/Redhat - yum install vnc-server

PASSWORD

Set the password for vnc by running the command vncpasswd

START VNC

Start the vnc server by running the command vncserver.
You should now be able to connect to you machine usng VNC.

STARTUP

To configure VNC to start at boot up edit the /etc/rc.local file and add the following line just before the line that reads exit 0:

su - <username> -c "/usr/bin/vnc4server :1 -geometry 1024x768 -depth 16 > /tmp/vncserver.log 2>&1 &" &

ISSUES

When you connect your presented with a blank grey screen. This is down to a configuration issue within the file /root/.vnc/xstartup. Further details on how to fix this can be found here.

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001