HACC-mlcluster Enabling VNC (GUI) Access

We offer VNC support for the HACC-mlcluster development VM (unlike HACC). This means you can do GUI-based development. However, getting a GUI working will require several steps.

  1. Locally, you must install TigerVNCViewer. TigerVNC can be found at this website https://tigervnc.org/.
  2. SSH into the development VM.
  3. Open ~/.vnc/xstartup  in your favorite text editor.
    Paste the following into that file (overwriting any existing contents)      

    #!/bin/sh
    
    # Start xfce-4 Desktop 
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    
    vncconfig -iconic &
    
    dbus-launch --exit-with-session xfce4-session &
    
    xhost +
  4. In the terminal, type
    vncserver
    Create a secure password for your VNC sessions. Note: If you do not password protect your VNC sessions, other users may be able to access your sessions! The view-only password is less important and is optional.
  5. You should receive a message telling you that a VNC session has been created. You will also be told what port that session is on. It will be in the format of a colon followed by the port number (e.g. :5). Write down or remember this port number. If you forget the port number, you can type
    vncserver –list
    to see your active sessions. Note: these sessions may close or crash. If so, you can start another by repeating step 4 (you won’t need to set the password again).
  6. Exit your SSH session.
  7. SSH back into the node, but this time add the following argument:
    -L <port_number>:127.0.0.1:<port_number>
    Where <port_number> is the value you got in step 5.
    For example,
    ssh fakeuser@10.0.69.26 -L 5905:127.0.0.1:5905
    This creates a secure, encrypted tunnel which enhances the security of your VNC connection.
  8. Open up TigerVNCViewer and type the following into the VNC server field, and then press connect.
    <port_number>:127.0.0.1:<port_number>
  9. Enter your VNC password.
  10. Viola! It should work now.