Sunday, 30 March 2014

VNC - Virtual Network Computing - sometimes you need to use AIX tools ...

So it's here. After long time as dumb SAP admin, I was learned, there are parts of SAP hidden to my ignorant self. OK, I know how to access Java part of SAP, but I did not had time to dig what exactly is that tool I'm using. And ignorance is not blessing in this time ...

So some theory about VNC tool first.
"VNC (Virtual Network Computing) is a useful collaboration tool which creates an X-Windows desktop on AIX and then serves up the desktop as an HTTP web page. The X-Windows desktop can be shared, so that several users can share control of the mouse and keyboard and all users can see what other users are doing, making it very easy to see what command someone else was typing or quickly and conveniently show others what command to type."
(cite from IBM site)


 I borrowed that from IBM site, where you can learn more about VNC ... for SAP admin, who have help of OS admin is not necessary to know all the stuff. If you are not so lucky, you could read original page. For rest of us is this short guide.

VNC is composed from 3 parts:
- VNC server
- server you want to access
- client on your PC
VNC server can reside on target server ... but do not need to.

That was theory, now rest in praxis (and a few commands).

Use command which vncserver on desired server. if you found vnc server, you are 'lucky' else you need to access server in your landscape where vncserver is running (or install it thanks to link above).

Now you can start on server where VNCserver is:
vncserver - rfbport <number> - by this command you will start your VNC session. Since default port is 59<vncdisplay_#no>, this port can be blocked for remote access. So use any of allowed ports (perhaps SAP dispatcher ports can help). If you don't need to change ports, you can use vncserver command only.
there are other parameters, but usually you don't need them to often.
If you did not set password during start of your session, use also command vncpassword to set password (you will need that in last step).

Then go to server where you need to export display (or stay where you are) and export that display by command: export DISPLAY=<VNCserver_servername>:<vncdisplay_#no> for Bourn shell (or setenv DISPLAY <VNCserver_servername>:<vncdisplay_#no> on case of C shell).
As last thing use command xhost + to allow server accepting of commands from remote hosts. Than we are done on AIX side.

Now you have your server part ready, so you can access your server session remotely (and display graphical data or let someone else see what you are doing).
For that you need to have desktop client (like RealVNC or anything simmilar) installed. Then start your client, write <IP_of_VNCserver>:<vncserver_port_#no> , than provide password you set during previous steps and you should be in.

If its not working - check if you can access server vith VNCserver from your desktop (IP, ports, DNS translation, if you use that instead of IP).

Now you have your session remotely displayued in VNCviewer. You could share this view with anyone else or you could submit commands for displaying graphical programs and interfaces on your AIX/Unix. For that some time other.

All of above in short:
which vncserver - to check presence of VNCserver
vncserver - rfbport <number> - to start your VNCserver session
vncpassword - to set pwd for your VNCsession
setenv DISPLAY <VNCserver_servername>:<vncdisplay_#no> - to forward your display
xhost + - to allow commands through VNC
- start VNC client on desktop and do your work.