Computing - VNC

Background
VNC stands for Virtual Network Computing. It allows you to access your graphical desktop on a Linux server from your Windows or Mac computer. When you create a VNC "session", it lives until the server is rebooted, or until you explicitly kill it.

Requirements

  • An account on a Linux server that supports VNC
  • An SSH client
  • A VNC viewer client

Creating/Accessing a VNC session

  1. Log in to the server with your SSH client. You should get a command prompt.
  2. Type "get_vnc".
  3. Hit Enter.
    • If you already have a VNC session, you will see something like this:
      Here is your current vnc session:
      big_server:6
      
      In this example, your VNC session number on "big_server" would be 6. Make a note of the actual number.
    • If you don't already have a VNC session, you will see something like this:
      New 'big_server:6 (some_user)' desktop is big_server:6
      
      Starting applications specified in /home/some_user/.vnc/xstartup
      Log file is /home/some_user/.vnc/big_server:6.log
      
      which would mean that VNC session number 6 was just created for you on the server. Make a note of the actual number.
  4. Now use your VNC viewer to open a connection to your VNC session on server. If all goes well, you should get a window containing your Linux desktop.

Closing a VNC session
Restarting your VNC session might be necessary if system-wide environment variables have been changed.

  1. Log in to the server with your SSH client. You should get a command prompt.
  2. Type "vncserver -kill :6", where 6 should be replaced by your actual VNC session number. If all goes well, you should see something like "Killing Xvnc process ID 10909" without any error messages afterward.

Checking on VNC sessions
This is helpful if you think you might have multiple VNC sessions on the server.

  1. Log in to the server with your SSH client. You should get a command prompt.
  2. Type "vnc_report". This will list all active VNC session numbers and their users. For example:
    [some_user@big_server some_user]$ vnc_report
    1       alfred        Oct10
    2       ben           Oct10
    3       chad          Oct11
    4       david         Oct12
    5       eddie         Oct24
    6       some_user     16:18
    

Help
If you have any problems or questions, please contact Scott Martin (916-734-4595, ).

Back to Computing