Skip navigation

STANFORD UNIVERSITY

INFORMATION TECHNOLOGY SERVICES

Using X-windows and VNC

Introduction

UNIX applications with a graphical user-interface require the use of X-windows or other remote display software when connecting from a remote location. Two methods are currently supported: X-windows (using Apple X11) on Macintosh computers, and VNC on Windows systems.

Using Apple X11 on Mac OS X

Apple X11 requires Mac OS X 10.3 (Panther) or later. It is included with recent versions of the operating system and can be specified as an option when installing OS X, or else installed at a later time using a separate package located on the OS X installation media (i.e., the OS X DVD or Install Disc 3). It is also available for download at the Apple website.

  1. Verify that Apple X11 is installed and launch the X11 application (located in the Utilities subfolder of the Applications folder).



    An xterm window should open by default. If no terminal window opens, start one by selecting Terminal from the File menu or pressing command-N.


  2. At the $ prompt, run the OpenSSH client using the ssh command. This command takes a single argument specifying the user's SUNet ID and the target host, and requires a single option, -Y, specifying that ssh should additionally arrange for an X-windows connection; for example:

    ssh -Y sunetid@bramble.stanford.edu

    If you are using OS X 10.3, it may be necessary to use -X instead of -Y:

    ssh -X sunetid@bramble.stanford.edu

  3. After entering a password the remote machine will present a standard UNIX prompt. Remote applications with a graphical user-interface will automatically use the local display.
  4. To end the remote display session, quit all running UNIX applications, type exit to close the ssh connection, and quit the X11 application.

Using VNC on Windows

VNC is freely available software that supports remote display on a variety of computer platforms. The University maintains the necessary server application for use with Stanford UNIX hosts, but users must download and install the VNC Free Edition Viewer for Windows, available online at the RealVNC website. Please note that personal details are requested, but not required, for download.

  1. Connect to a UNIX host using a (secure) terminal emulator like SecureCRT, available online from the ESS website.


  2. If VNC has not been used before a password must be created to control access to the remote display. First, create the VNC application directory if it does not already exist:

    mkdir ~/.vnc

    Then, set the password using the vncpasswd command; this password is not very secure, so it should not be the same as any password associated with a SUNet ID.

  3. Once a password has been set, launch the VNC server application using the vncserver command. Depending upon how many remote displays are already present on the current system, several warning messages may be displayed before vncserver reports that it has created a new X11 desktop; take note of the host name and display number so reported:

    New 'X' desktop is bramble01.Stanford.EDU:3

  4. Set the DISPLAY environment variable to reflect the new display using the following command:

    setenv DISPLAY localhost:n

    n should be replaced with the number of the display reported by vncserver.
  5. Launch the VNC Viewer application on the local computer.



    VNC Viewer will display a dialog box requesting the server to which the viewer should connect. Enter the host name and display number as they appeared in the notification message displayed by vncserver.



    Provide a VNC password when required.


  6. A window should open displaying the remote desktop. Remote applications with a graphical user-interface will automatically use this window for local display.
  7. To end the remote display session, quit all running applications and close the VNC Viewer application. Then, terminate the vncserver application using the following command:

    vncserver -kill :n

    n should be replaced with the number of the display originally reported by vncserver. Finally, type exit to end the remote terminal session and quit the terminal emulator.

Please note that when using VNC software it is advisable to use the original terminal session to launch other applications or issue shell commands. If the session is idle for an extended period of time the remote host may automatically disconnect, causing the vncserver process and other running applications to quit unexpectedly.

Last modified Monday, 07-Apr-2008 03:59:30 PM

Stanford University Home Page