OpenSolaris has Remote Desktop (RD) pre-installed, however RD has its constraints: someone at the local console can see exactly what the remote user is doing, and vice versa. This is sometimes not desirable. For example I have my Solaris box sitting in lab while my cubicle is somewhere else, I don't wish to let everyone in the lab to see what I am doing at my box remotely. Even though I can shut-off or even remove the local console, RD still is not a good solution for remote access. Luckily, Virtual Network Connection (VNC) fits my purposes, though there are some work involved which I shall discuss below.
My set up is as follows: in lab the OpenSolaris box has a hostname of 'Solaris', while in cubicle a Linux box named 'Ubuntu'.
- First of all, enable the default Remote Desktop at Solaris. Enabling RD serves two purposes: test the box's network connectivity, and RD is useful for subsequent troubleshooting of the VNC setup. I shall skip RD setup in this post.
- Once RD is up and running, goto Solaris and invoke System->Administration->Package Manager. Type 'vnc' in the search box and you should see two packages: One is vncviewer, another is vncserver. Install both.
- At command line, run vncserver as follows:
- To access the VNC sessions at Solaris, from Ubuntu, I use Vinagre, a VNC viewer for GNOME.
- The last piece of hurdle we need to clear is on running Gnome desktop under VNC. By default the VNC is configured to run TWM, a fine desktop manager, albeit not as pretty as Gnome. To accomplish this mission, we will edit xstartup under
/.vnc (note the period in front of 'v')
- Comment out the following line by adding a hash sign (#) in front
The commented out line will look like:
- Add the following lines in the xstartup
Whenever Gnome (or other session managers like KDE) runs, it will set the variable SESSION_MANAGER, and by default Gnome will not run when another session manager is active. We unset this variable to circumvent the check.
- Finally, to end a VNC session:
vncserver -kill :[session number]
In our case, the correct command will be
vncserver -kill :1
If this is your first time running vncserver, vncserver will ask you to supply a password, this is the password to access your VNC session only, therefore for security purpose, it is recommended not to use the same password as your current login account. The following is the output from a session running at my Ubuntu machine. Output from OpenSolaris will be similar. Observe the output is in the form of [hostname]:[number]. The number identifies your session number, and yes, you can have more than one sessions running at the same time.
You will require a password to access your desktops.
New 'ubuntu:1 (chai)' desktop is ubuntu:1
Creating default startup script /home/chai/.vnc/xstartup
Starting applications specified in /home/chai/.vnc/xstartup
Log file is /home/chai/.vnc/ubuntu:1.log