Table of Contents

VNC Virtual Network Computing

These directions are for remotely connecting to a Linux computer using a VNC server.

Must have a good internet connection in order for it to not be extremely slow, but note that the school's VPN may be the issue if connection is really slow.

We will be using either TigerVNC or RealVNC, which include the VNC Viewer and the VNC Server.

First Time Access via VNC to UND Linux Servers (Aircraft/Littlestorm) as of 06/2026

  1. A secure shell (ssh) client is required. On Windows, use PuTTY.
  2. The UND VPN is also required. UNDvpnInstructions
    1. When logging into the vpn, use vpn.ndus.edu instead of vpn.und.edu
  3. Login to PuTTY with your NDUS login. (firstname.lastname, ndus password)
  4. Enter vncpasswd into PuTTY to create a password file in ~/.vnc. The password can only be up to 8 characters long.
  5. Create a file in ~/.vnc called xstartup containing the following code:
    #!/bin/sh
    
    vncconfig -iconic &
    
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    exec /usr/bin/xfce4-session
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
  6. Make this file executable with the command chmod +x xstartup
  7. Create another file in ~/.vnc called config that contains this line:
    session=xfce
  8. If you have not already been assigned a display number, scroll down and add your name with the next available number, or ask to be given the number of an inactive user.
  9. You will need a VNC viewer. (May need to be downloaded). Name: Either TigerVNC or RealVNC Viewer. (Preference for Tiger, download latest version https://tigervnc.org/)
  10. Run PuTTY and start your VNC session with the command systemctl start vncserver@:#.service, replacing the # with your display number.
  11. Run your VNC viewer and enter the hostname, e.g. littlestorm.atmos.und.edu:#, again replacing # with your display number.
  12. Log in with the password you created earlier
  13. You should now be looking at a window containing a linux desktop!
  14. When you are finished with the VNC, please return to PuTTY and enter the command systemctl stop vncserver@:#.service, again replacing # with your display number. This will end your VNC session on the server, freeing up important resources.

* Simplified steps for future use after initial set up:

  1. Start the UND VPN
  2. Open PuTTY and login.
  3. Enter systemctl start vncserver@:#.service
  4. Open VNC Viewer, enter host name, and login.
  5. When you are finished, return to PuTTY and enter systemctl stop vncserver@:#.service

Desktop Environment to Use

Linux has several options for a desktop environment, which include GNOME and Xfce. GNOME is the default, but it seems to take up to 20GB of memory on busy servers like Littlestorm after running for several weeks/months. Hence, users should use the Xfce environment instead of GNOME on Littlestorm.

If you set up your VNC using the 06/2026 instructions at the top of the page, then you will already be using Xfce. To be sure, look at the top left of the VNC window. If the symbol to the left of Applications is a blue X with a mouse in front, you're running Xfce. If your VNC was set up previously and uses GNOME, please swap to Xfce when possible. To do so, edit your xstartup file and make sure it contains the lines

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /usr/bin/xfce4-session

Get rid of the line exec /etc/X11/xinit/xinitrc if it is present. You will also need to create a config file in ~/.vnc that contains

session=xfce

If you already have a config file, make sure it contains this line. The next time you start your VNC session, it should be running Xfce.

Creating a VNC file on Other Remote Linux Computers

  1. You must first create a vnc file on the computer you are wishing to gain external access to (the server computer).
  2. Make sure you add this file to /home/<username>/.vnc/
  3. To make the new file (an xstartup file), paste the sample code below into a text file.
  4. After you have created the startup file, go to a terminal window and type vncpasswd, next enter the password you would like to use when accessing the server computer. (This will only be your VNC password when you are starting VNC)
  5. In a terminal window type in vncserver to start the server. More information and functions about starting and killing the server in the Extra Information section of this page.
  6. Make sure this file is executable. If not, make executable by typing chmod +x xstartup in terminal window

xstartup code for Linux Mint Computers (for example Clifford Hall 422 computers)

#!/bin/sh


# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
mate-session &

xstartup code for Ubuntu

#!/bin/sh

#Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey 
vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
mate-session &

Starting and Killing the Remote Linux VNC Server (Can't do on Aircraft/LittleStorm)

#!/bin/bash
# Shell Access Aircraft using vnc client
export VNC_VIA_CMD='/usr/bin/ssh -2 -c aes128-cbc -x -p 22 -f -L %L:%H:%R %G sleep 2'
/usr/bin/vncviewer -FullColor -passwd ~/.vnc/passwd -via aircraft.atmos.und.edu :1
ls ~/.vnc/*.pid
computer_name:1.pid
ps -ef | grep -i Xvnc

Accessing the VNC server using Windows Operating System

Downloading RealVNC VNC Viewer

  1. Select your OS and click Download VNC Viewer
  2. Install as you would normally per your OS

Setting Up VNC Viewer on Windows (Putty)

1) Connect to the campus' VPN

2) Use PuTTY or the like to connect to the computer you want to remotely access

3) Start the VNC server as described in the Starting and Killing the Remote Linux VNC Server section and take note of the display number you are assigned

  New 'computer_name.atmos.und.edu:1 (username)' desktop is computer_name.atmos.und.edu:1

4) Exit out of PuTTY while keeping the previous terminal open, reopen PuTTY, and type the following:

5) Open VNC Viewer and type into the VNC Server box: localhost:?? where ?? is the display number assigned to you

Accessing the VNC server using Linux Terminal

You can access vnc through a Linux (i.e. Redhat) terminal window with the following command:

vncviewer -via <IP address> :<display number>

With the case of esxfedoralo, it would be the following command:

vncviewer -via 134.129.214.58 :<display number>

Other things you will need

Accessing the VNC server on OS X

OS X has a built in VNC viewer, so no extra software is needed to access the VNC server.

To access the VNC server: — David Delene 2020/10/19 23:12

To change the VNC viewer resolution:

Extra Information for those interested

Terms and Definitions

List of VNC Display Numbers Used by People

To allow scripting to access VNC, people may want to use the same display number, Hence, below is list, please add your name and number. Please use vncserver :? where ? is your display number.

* Active Users

To see who is using VNC Server session use the command “ps -ef | grep -i Xvnc”. This can also be used to check if your own session is running. To kill your session, use systemctl stop vncserver@:#.service, where # is your display number.

- Error Example: Attempting to run VNC, you may get the error 'Timed out waiting for a response from the computer.' Use above command to check your session. If your session is not running, start it with systemctl start vncserver@:#.service, where # is your display number.