Skip to content

What’s on VNC tonight?

July 3, 2012

Here is a quick guide on how to use VNC to view remote desktops.

To install VNC onto server: –

prompt> yum install tigervnc-server

Set the VNC password for the user, this is a security measure: –

prompt> vncpasswd

Configure VNC so that it can be used: –

prompt> vi /etc/sysconfig/vncservers

Make sure to replace the username with a specific user for the VNC to connect to. Uncomment these two lines and save.

VNCSERVERS=”2:username”

VNCSERVERARGS[2]=”-geometry 800×600 -nolisten tcp -localhost”

Now you are ready to startup the VNC server.

prompt> vncserver

Once you execute the above command it will start the VNC server on port 5901 and display number 1 and so on and on when you create more display numbers with VNC servers.

Make sure to allow your firewall to let port 5901 tcp traffic through so that VNC clients can access this VNC server: –

prompt> system-config-firewall-tui

# Then proceed to customise > Forward > Add > Port Range: 5901 & Protocol tcp > OK > Close > OK > Yes

Then all you need to do is go to another machine install the VNC client like so: –

prompt> yum install vncviewer

Then use the command below to create a VNC session between the current machine that has vncviewer installed on it and the machine where the VNC server is installed on (replace the hostname below with the hostname of the server that has the VNC installed on it, you can always type hostname on the server to find this out): –

prompt> vncviewer hostname:5901

You can always see how many VNC servers you have running on the system by logging onto the server it is running on and doing a:-

prompt> vncserver -list

Furthermore you can terminate the specific VNC server by killing it, in the example below it will terminate the VNC server that is on the display number 1: –

prompt> vncserver -kill :1

I made sure I had installed xterm so that I could access it when I did a VNC session from the client to the server. First time I was trying it out I was getting a lot of problems and made a few mistakes but with persistence and renewed effort I learn’t it 🙂 !

Furthermore once I had the VNC server setup as above I could also use my mobile and any other computer regardless of platform to connect to the VNC server

Advertisements

From → Linux

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: