Running VNC Server on Oracle Enterprise Linux 5

VNC is an excellent way to remotely access an X Windows desktop on your Linux server. Many Oracle technologies have a nice GUI installer and using VNC to remote into the machine is the simplest way to walk through new software installations. Here are a few notes on how I get VNC running quickly.


  • Oracle Enterprise Linux ships with a VNC Server. If you find it is not installed, you can deploy the package thats part of the install CD/DVD. Just cd to the "Server" directory and run yum install vnc-server-4.1.2-14.el5.i386. Note the version of VNC server may be different depending on the release of Linux you have.
  • Now login as the user you want the server to run under and start a console/command prompt. You can also su to any user once in a console.
  • Run vncserver and it's going to create the configuration files and also ask you for a password which will be entered when accessing the VNC server remotely.
  • Once the server has started, you really want it to start with your desktop manager of choice. Oracle Enterprise Linux ships with 2 managers, KDE and Gnome. First you need to stop the current running server. Run vncserver -kill :1
  • Now you want to edit the VNC server startup script, edit this for the current logged in user. Nano is my editor of choice in Linux.

    1. nano $HOME/.vnc/xstartup
    2. Once open uncomment the two following lines;
      unset SESSION_MANAGER
      exec /etc/X11/xinit/xinitrc

  • Now you need to start the server, simply type vncserver from the command line and up it runs.
  • Finally you can now connect remotely. Download and install a VNC client onto your machine and then connect using hostname:1 and enter the password.

Comments:

Frits Excellent comments. I totally agree that VNC, from a security perspective, is not the ideal solution. It does allow for the securing of communication but when setting up simple servers for testing, as I do on a test network at home, there isn't the need for the security. On the machines which are exposed in a production fashion VNC isn't even installed and all work is done physically on the machine. I've not come across the two methods you describe and will, when I get time, try an installation and maybe post up another article. Thanks Simon

Posted by Simon Thorpe on June 03, 2009 at 07:02 AM PDT #

The oracle-validated RPM sets up everything that's required for remote X. Why not just use Xming on Windows (or X11 on Linux/MacOS -- it's built-in on Leopard) and SSH with X11 Forwarding enabled? That takes care of the OUI's GUI requirements and Frits' security concerns. It also means you're not running an X server on your production machines.

Posted by Avi Miller on June 03, 2009 at 11:11 AM PDT #

I agree VNC is easy. But, there are several quite important drawbacks for using VNC: - Quite insecure and exploits available (google for metasploit) - You enter an authenticated session. This is inherently insecure and is forbidden in the light of the current security frameworks (think SOX, ISO 27001, HIPAA, etc.) My suggestion would be to uncouple the two tasks VNC does: 1. X access for applications VNC is used as the X server for oracle products which need an X server (think oracle forms, dbconsole, iasconsole, etc.) Xvfb is perfect for this. It's extremely easy to install an Xvfb server in linux (it's a rpm package which need to be installed), the only thing you got to do is make a start/stop script to startup the Xvfb alias headless X server on localhost. 2. Secure, persistent sessions Here's a product which leverages SSH authentication and setups a persistent GUI session: NoMachine alias NX. there is the free version from nomachine (limited to two users) which works like a charm, and there's the real open source version, which didn't work last time I tried. just try it. and forget VNC.

Posted by Frits Hoogland on June 03, 2009 at 02:32 PM PDT #

@Avi: I totally agree that an SSH session with X-tunneling does anything you want. In fact, the metalink note about using Xming is modified after my comments (it used to say Xming didn't work, for which the solution is to install the extra fonts package which is offered with the Xming download. It now says it works and need the extra fonts package) I've seen VNC being used by EBS/APPS installations for session persistence. The installation takes fairly long, and with connections which could drop (think VPN) this is a safety step. Please mind these are not my security concerns. It's what companies think they want. In most cases, if you think it through, it's something you want too. @Simon: Xvfb is a solution proposed by Oracle since the need for an X server (originally with forms in IAS v 1.0.2.2. Yes, it started with that exact IAS version), but Xvfb used to be difficult to setup. Nowadays, with distinct Xvfb servers it's easy. It is badly documented however; if interested, mail me for brief setup instructions. Please try NX. It's very elegant and beautiful to have SSH security and safety and routability.

Posted by Frits Hoogland on June 03, 2009 at 06:31 PM PDT #

Thanks for the NX info. Works great. JBF Oracle Hyperion Support

Posted by John French on June 22, 2009 at 03:45 AM PDT #

Hi Avi, Xming does not always work well with the Oracle Guis (dbca, ..) If you have another linux box with X thats perfect. VNC is great for connections, which may crash sometimes. Oliver

Posted by Oliver on February 01, 2010 at 10:33 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Simon Thorpe, senior consultant at Oracle, blogs about simple and useful tips when working with Oracle technology.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today