Doing Remote Development with Sun Studio SoftwareIn the past, most SunTM customers had a Sun workstation running the SolarisTM Operating System on their desktop. They could easily develop applications for deployment on other workstations or on large Sun servers. Today, many developers have a PC running Microsoft Windows on their desktop instead. How can these developers use Sun Studio software to develop their Solaris applications? One way is to use the features provided by the VNC (Virtual Network Computing) software available from Real VNC Ltd. The VNC product includes both server-side software and client-side software. To use VNC for remote development with Sun Studio software, a developer starts a VNC server session on a server running the Solaris OS or the Linux OS, and then starts a VNC viewer on his desktop to connect with the VNC server and run the Sun Studio software. The PC serves as a remote display of the Solaris or Linux server. Getting and Installing VNCThe VNC software is freely downloadable from the RealVNC web site at http://www.realvnc.com. It is available for general use under the conditions of the GNU General Public License. The authors of this article have used both VNC 4.0 and VNC 3.3.7. Our testing found fewer problems when we were running VNC 4.0 although we were able to complete our work with either version. The download page includes both installable packages and source code. Download the installable packages and install them according to the instructions in the README file. You need VNC software both for the remote system and the desktop system.
Don't forget to download the documentation package as as well as the software. This article is not intended as complete VNC documentation, and does not replace or supercede the documentation provided by RealVNC Ltd. To build the VNC software from the source code, download the source code files and follow the instructions in the README file. You can build all of the client-side VNC software from these files. However, the VNC 4.0 source distribution no longer contains the sources to build the Xvnc server program, so you cannot build the complete server-side VNC software from the files available on the RealVNC web site. The README file does direct you to where to get the source files for the Xvnc program and how to build them. Configuring Your VNC SoftwareYou start a VNC session by running the vncserver program on the Solaris or Linux server. Although you don't have a viewport to this session until you start a VNC viewer, the VNC server starts programs running that persist until you end the session. When you run the vncviewer program to start a VNC viewer, you open a viewport to the VNC session. You can start a VNC viewer, exit the viewer, and then start another viewer to rejoin the same VNC session at a later time. You can even go home and connect to your VNC session from a different desktop. If you have the Sun Studio software running when you exit the VNC viewer, it is still running when you reconnect to the VNC session with a new viewer. Several programs are started when you run the vncserver program
to start your VNC session. By default, the
#! /bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
if [ -r "$HOME/.vnc/Xresources.$VNCDESKTOP" ]
then
xrdb -merge "$HOME/.vnc/Xresources.$VNCDESKTOP"
fi
xsetroot -solid blue
case "$VNCDESKTOP" in
X)
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
;;
dt)
dtterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
dtwm &
;;
gnome)
metacity &
gnome-terminal --geometry 80x24+10+10 --title="$VNCDESKTOP Desktop" &
;;
ss)
metacity &
sunstudio -J-client &
;;
esac
The $VNCDESKTOP environment variable is set by the vncserver program before it runs the xstartup script. Its default value is X, but you can change the value with the -name option of the vncserver command. For example, the following command starts the metacity window manager and the gnome-terminal terminal emulator: vncserver -name gnome Many users won't want the choices the case statement in the xstartup file gives. You can modify the xstartup file to make the default session startup what you want. It is also useful to start a terminal emulator such as dtterm, gnome-terminal, or xterm as it simplifies starting other programs in your VNC session. Starting and Ending a VNC SessionTo start a session on the Solaris or Linux server, run the vncserver program. The first time you start a session you are asked for a password. The VNC server remembers this password and you don't need to supply it again. If your desktop is a Windows PC, you probably need to telnet to the Solaris server to start the vncserver program. When the vncserver program starts, it displays some startup information. The most important part of this information is the VNC server name, which is similar to a $DISPLAY variable you might use for X Windows applications. To end your VNC session, use the vncserver command on your Solaris or Linux server, with the -kill option and display name. For example: vncserver -kill foo:1 You can specify several options to the vncserver program when starting a VNC session. See the vncserver(1) man page for a complete list of options. If you have a display with 24-bit color, you might want to start a VNC session with the -depth 24. If your xstartup file contains several desktop models like the example xstartup file above, you need to specify the -name option to use one of the alternative desktop configurations. Starting the VNC ViewerTo connect to your VNC session, run the vncviewer program from your PC. The VNC viewer needs to know the name of your VNC server, which is the name the VNC server returned when you started your VNC session. (The VNC server name is usually the name of your Solaris or Linux server followed by a colon and a number; for example, myhost:1. It might also include the domain name of your Solaris or Linux server.) You can also find the name in your $HOME/.vnc directory. You can specify the VNC server name as an argument to the vncviewer command. Or when the Connections Details dialog box is displayed, enter the display name in the Server text field and click OK. The VNC viewer asks you for the password you used when you started the VNC server. When you have entered the password, the VNC viewer display your VNC session. You can specify several options to the vncviewer command. For a complete list of these options, see the vncviewer(1) man page. Two of our favorite options are -FullScreen and -FullColor. Maximizing PerformanceDoing remote development with VNC has the drawback of offloading the JavaTM Virtual Machine (JVM) software from your desktop to the server. If many developers are running VNC concurrently, the server machine can become overloaded and suffer performance problems.One solution is to run JVM software called the Java HotSpotTM Client VM (client VM). The VM software is typically started by the Java interpreter (java). The interpreter looks at system resources and starts either the Java HotSpot Server VM (server VM) or the client VM. The server VM uses more system resources than the client VM, so forcing the interpreter to use the client VM should minimize resource consumption. To run the client VM with Sun Studio, include the -J-client in the sunstudio command:
$ sunstudio -J-client
Note: The terms "Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java(TM) platform. Frequently Asked Questions
About the Authors
Gordon Prieur is the team lead for the Sun Studio Integrated Developement Environment (IDE). Gordon has worked on Sun's IDE tools for 7.5 years. Before coming to Sun, he worked on IDEs at Microtec Reasearch, Inc. and Pyramid Technologies. Ann Rice is a staff writer in the Sun Studio Technical Documentation group, and is responsible for documenting the dbx debugger and the Sun Studio IDE. Ann began her career as a programmer. She has documented network technology and development tools, as well as serving as a technical publications manager for several Silicon Valley companies, including 3Com Corporation and Sybase, Inc. Ann is a past president of the Silicon Valley chapter of the Society for Technical Communication. | |||||||||||||||||||||||||||
|
| ||||||||||||