How to Install and Start Using CFD Tools
    Main Page
    Lab Hardware
    Lab Software
 

In the instructions below, substitute your UW Net ID wherever you see "uwnetid".

Last updated: 22 Nov 2022

CFD Tools

Vendor Description Common Tools
CFD

CFD is an Ubuntu virtual machine.

OpenFoam is installed.

Access to the server is via a remote desktop application — in our case, this is VNC. Once you install the environment, you set up an encrypted tunnel from your computer to the server, use a VNC client to connect to the server and open up a remote desktop as another window on your local computer's desktop. Inside the remote desktop, you open up a terminal window and run the appropriate commands or script to, say, change the display resolution or run the desired CFD tool.

Installation on Windows

Installing the local application or client involves downloading a .zip file and unzipping it.

  1. Download cfdman.zip
  2. Unzip cfdman.zip into the C:\ folder. If you are logged into a SET Lab computer or a UWT classroom computer, you can unzip it to your H: drive.
  3. Look at the contents of the C:\cfdman (or at UWT, your H:\cfdman) folder.

    You should see one cfdman.ini file and several .exe and .cmd files.

    The cfdman.ini file is where you can override some defaults; for example, if the server IP address or hostkey changes. You don't normally need to modify this file, although sometime it is useful if the username you logged in as in not the same as your UW NetID. You want to put your UW NetID and/or your password in that file — be very careful about saving your password, as it is saved in plain text.

Usage from Windows

Before you can use CFD tools, you must first connect to the server on which the CFD tools are installed.

Background

PuTTY's plink command is a remote shell command — basically, it is the command-line version of the putty.exe GUI. plink uses your login account on the remote server to start the remote display mechanism — the VNC remote display service. Your login account is the same as your UW NetID, and your MyUW password is required. plink is also used to provide an encrypted connection to the server, to protect passwords and your work.

When the VNC server is started, it sets a unique port per user. That port is used by plink to provide the encrypted tunnel, and the VNC viewer command (vncviewer.exe) to connect to the remote display service via the tunnel.

cfdman.exe automates all of that for you. It makes sure it can find plink.exe and vncviewer.exe, uses plink to start the VNC remote display service, gets the returned port number, opens up a tunnel using plink (which must remain open), and then starts vncviewer to use the tunnel and connect to the remote display service.

Using CFD from Windows

To use CFD tools after installation:

  1. Browse to the C:\cfdman (or H:\cfdman) folder.
  2. Run cfdman.exe

    By default, cfdman.exe uses the value of the USERNAME environment variable to login to the remote server. On a personal computer, this may not be the same as your UW NetID. In that case, you should do one of the following:

    • override the name shown in the window
           If needed, change xxxxxxxx to your UW NetID
           

      Change the textbox value "xxxxxxxx" to your UW NetID.

    • or, modify cfdman.ini
      1. close cfdman
      2. edit the cfdman.ini file, adding your UW NetID after uwnetid=
      3. start cfdman.exe

    • or, run cfdman.exe from the command line
      1. open a command shell or prompt

        For Windows 8.1 or 10, right-click on the Start Menu and select Command Prompt.

      2. Change folder to C:\cfdman (or H:\cfdman)
               cd /d c:\cfdman
               
      3. Run the script with your UW NetID as an argument.
               cfdman uwnetid cfd connect
               

        where "uwnetid" is your UW NetID.

  3. Click on the CFD tab.
  4. Click on the Connect to CFD Desktop via VNC Service button

    You may be prompted for your MyUW password — enter it when requested. It will be remembered until you close cfdman.

    A command shell will open, with some information that looks like:

    Port 5901 acquired.
    Starting the ssh tunnel...
    
    Connecting to CFD server
      

    If you see an error stating "unable to connect", close that window and click on the Connect to ... button until connected.

  5. Change the size of the remote display.

    You can use the entire full screen of your local display by pressing the F8 key (possible Fn-F8 keys on some laptops) and checking the box for "Full-screen". This is a feature of the TigerVNC remote viewing program (a.k.a., "vncviewer").

  6. Do your work in CFD.

    On the remote server, open a terminal window and enter commands.

    1. Follow the instructions provided by your instructor.
  7. When finished and you no longer want the VNC remote display service active, shut it down.

    The tunnel and the remote display service stay up until you explictly shut them down by clicking on the Kill CFD Desktop VNC Service button.

Usage from Mac OS

Using CFD from Mac OS

Unfortunately, there is no Mac equivalent for the Windows app cfdman. However, there is a script to simplify the common connection process.

  1. Using the cfd.sh script to connect:
    1. Right-click on this link to download the script to your Downloads folder.

      Once downloaded, you should be able to run the script to run the script from that folder, duplicating the commands listed in the command line instructions.

    2. Open a terminal window on your Mac.

    3. Change to the Downloads directory:
      cd ~/Downloads
      

    4. Change its permissions to allow executing by name:
      chmod +x cfd.sh
      

    5. Enter this command in that terminal window:
      ./cfd.sh
      

      You will be prompted for your UW Net ID. Enter that or q to quit. If you enter the wrong UW Net ID, press and hold the control key, then press the c key and release both to terminate the script, and start over again.

      The default VNC password for the CFD server will be shown. This is not necessarily your password, if you changed it at some point with the setvncpw command — we won't be able to display the one you changed it to, but you can override it by setting it again.

      Use the VNC password for the last prompt, to connect to the VNC server via 127.0.0.1.

    6. Continue with these instructions.

  2. To connect to the CFD server via the command-line:

    You will enter commands in a terminal window to set up and control the remote display session, including establishing an encrypted tunnel between your computer and the server. You may like portions of these instructions better if you prefer the graphical user interface (GUI) approach, but you will still need to know the specific information here and adapt it to filling in the information in the GUI.

    To Connect to CFD Desktop via VNC Service:

    1. Open a terminal window on your Mac

    2. Start the VNC service to get the remote port number.
      ssh uwnetid@cfd.d.insttech.washington.edu vncstart
      

      For uwnetid, provide your UW Net ID. When prompted for a password, use your MyUW password.

      For example, my UW Net ID is srondeau, so I would run:

      ssh srondeau@cfd.d.insttech.washington.edu vncstart
      

      and enter my MyUW password when prompted.

      You should eventually see something similar to the output below:

      
      New Xtigervnc server 'cfd:9 (srondeau)' on port 5909 for display :9.
      Use xtigervncviewer -SecurityTypes VncAuth -passwd /home/srondeau/.vnc/passwd :9 to connect to the VNC server.
      
      vncport 5909
      

      My remote port number is 5909, as can be seen from this line above:

          vncport 5909
      

      Remember this number to replace remport in the next step, which sets up an encrypted tunnel between your computer and the server.

      If the vncport line is the only line shown, you may need to run the vncstop command before running the vncstart command again, as the port may no longer be active.

    3. Establish an ssh (encrypted) tunnel to protect your VNC session:
          ssh -f uwnetid@cfd.d.insttech.washington.edu -L 15900:127.0.0.1:remport sleep 300
      

      Again, substitute your UW Net Id for uwnetid. Substitute the VNC port number (from the vncstart command) for remport. For example:

          ssh -f srondeau@cfd.d.insttech.washington.edu -L 15900:127.0.0.1:5909 sleep 300
      

      What is that command doing? It is setting up the ssh tunnel from a local port (15900 — this is an example of a random number between 1025 and 65535, used as a concrete example) on my local computer (127.0.0.1, also known as "localhost") to the remote port (5909, in the example) on the remote computer or server (cfd.d.insttech.washington.edu). This tunnel is only established between the local computer and the server for this user (srondeau in the example). The sleep 300 command passed to the server tells it to keep the tunnel open for encrpyted communication (mainly, the VNC password) for 300 seconds.

      If you are returning to an already-established VNC session — that is, one you previously started via vncstart — you can ask what your VNC port is and use that directly in the ssh tunnel command:

          ssh uwnetid@cfd.d.insttech.washington.edu vncport
      

      For example:

          ssh srondeau@cfd.d.insttech.washington.edu vncport
      

      should show:

          vncport 5909
      
    4. Display the default VNC password (which will work unless you changed it).
      ssh uwnetid@cfd.d.insttech.washington.edu vncpw
      
    5. Open a VNC session to the remote computer:
      open vnc://127.0.0.1:15900
      

      Note that the IP address 127.0.0.1 is the "localhost" address always, and 15900 is the same as the local port number on the ssh tunnel command.

    6. Enter the VNC password when prompted.

      The default VNC password is listed in the command shell window. You should change that password (eventually) by following the Set VNC Service Password instructions — note that setting the password will shut down the existing VNC remote display service to change the password.

  3. Change the size of the remote server's display.

    A possible way to do so is to select one of the following Retina screen resolutions: 1680x1050, 1440x900, or 1280x800. Use it in a command issued in a terminal window inside the remote server's displays.

    For example, to set the remote server's display to 1440x900:

    xrandr -s 1440x900
    

  4. Do your work in CFD.

    On the remote CFD server's desktop:

    1. Follow the instructions provided by your instructor.

  5. When finished and you no longer want the VNC remote display service active, stop or kill the service.

    The remote display service stays up until you explictly stop or kill it. That is done by following the Kill CFD Desktop VNC Service instructions.

  6. Set VNC Service Password

    This is a means of forcing a new password to be what you set it.

    1. Open a terminal window on your Mac
    2. Change the password
          ssh uwnetid@cfd.d.insttech.washington.edu setvncpw "newpw"
          

      where newpw is the new password you want.

      You will not be able to see what this password is via vncpw, as it is not the default password. You can, however, set it to something else if you can't remember it.

  7. Kill CFD Desktop VNC Service
    1. Open a terminal window on your Mac
    2. Stop the VNC service
          ssh uwnetid@cfd.d.insttech.washington.edu vncstop
          

Troubleshooting Problems

  1. FATAL ERROR: Host key did not appear in manually configured list

    You ran cfdman before and saved the host key, but the host key has changed because the cfd server changed. You probably have an older version of cfdman and need to download, unzip and use the latest version.

  2. Access Denied

    There are a few possibilities:

    1. The MyUW password you supplied was not accepted by the remote server.

      You probably entered the wrong password. You may have to close cfdman and then start it again to "forget" the wrong password.

      Also, see this troubleshooting topic.

    2. USERNAME is not the same as UW NetID

      The default user name is the value of the Windows USERNAME environment variable. The most likely cause of this error is that the USERNAME value is not the same as your UW NetID, and that UW NetID should be all in lower case. Refer to this explanation to determine how to resolve that.

    3. Unknown login account for valid UW NetID

      Another possibility is that a valid UW NetID (must be typed in lower case!) is used, but there is no login account that matches it on the remote server. In that case, please contact your instructor or lab staff.

    4. Your computer login account has spaces in its name.

      Spaces in file names can cause problems because they need to be specially handled, such as putting quotes around a path to a file. Older versions (prior to 2.84) of cfdman.zip did not handle this well, resulting in the Access is denied error. Please download the latest version.

  3. FATAL ERROR: Network error: Software caused connection abort

    This indicates that your IP address is being blocked by the remote server, probably due to too many failed login attempts. Please contact lab staff via email and provide your IP address. Your IP address can be seen by visiting this web page.

  4. Connection Abandoned

    This usually occurs when plink required an answer to a question, but the script failed to answer it. If you try to connect manually:

      plink uwnetid@140.142.71.50
      

    using your UW NetID instead of "uwnetid", you should answer "y" to the question about caching information, then provide your MyUW password when prompted. If you login successfully, simply enter exit to log out. After that, you can use cfdman.exe to connect to the server using the remote desktop service.

  5. FATAL ERROR: Host key did not appear in manually configured list

    The hardcoded host key provided in cfdman.exe and cfdman.ini no longer match the host's key. Try downloading and unzipping cfdman.zip in case there is an updated version (the version number appears in the window title). If cfdman.exe still fails with this message, please contact lab staff.

  6. plink: the -pw option can only be used with the SSH protocol

    The wrong protocol is selected in the "default settings" for the PuTTY configuration.

    To fix it:

    1. Start putty.exe

      The window title should be the "PuTTY Configuration".

    2. Under the "Saved Sessions" label, select Default Settings and click on the "Load" button.
    3. Under the "Connection type:" label, check the radio button for SSH
    4. Click on the Save button.
    5. Close putty, and try cfdman again.

  7. Opening a VNC session on a Mac fails

    This could be due to too many ssh tunnel connections from your computer to the server. To resolve the problem, find all of your tunneled ssh sessions:

      ps auxxwww | grep ssh | grep L
      

    Then using the process ID (or pid) of each process (the second column after the user name), kill all of those processes. For example, if the above command displayed lines containing these pids: 31383 45141 45214:

      kill -KILL 31383 45141 45214
      

    After all of the old tunnels are destroyed by killing the process, re-establish the tunnel and and open a VNC session.

  8. TigerVNC Viewer: Unable connect to socket: Connection refused (10061)

    The student who reported this error also solved it — his personal computer's default language was NOT "English", and when he changed it to "English", this problem was resolved.

    In an attempt to fix this viewer error without changing the default language (this is untested), the version of TigerVNC Viewer was upgraded from 1.8.0 to 1.10.0, which is reflected in cfdman version 2.85. Later cfdman versions may have TigerVNC Viewer versions that are higher.

  9. FATAL ERROR: Network error: connection timed out

    It may be that you don't have a login account on the CFD server. Only students currently (i.e., in the current quarter) enrolled in a course requiring CFD have login accounts. If you had access in a past quarter, it is normally revoked at the end of that quarter. If you need access, have your instructor send an email to SET Labs Computing Staff requesting access to CFD for you (provide your name and UW Net ID).

  10. The MyUW password was not accepted.

    Two possibilities:

    1. If you enter your password when prompted, then you must have entered your password incorrectly.

      Check for the CAPS Lock key being on.

      Sometimes it helps to type your password in a temporary file (using notepad or some other editor), copy the password to the clipboard, then paste it when prompted.

      Alternatively and MUCH LESS SECURELY, put the password in your cfdman.ini file, but make sure you change that file if you change your MyUW password.

    2. If you were NOT prompted for a password, you have an old or incorrect password in the cfdman.ini file.

      Change the password to the correct one, or remove it so cfdman will prompt you for a password.

Change Log

22 Nov 2022 Added Mac instructions to use a script, and clarified Mac command-line instructions.
14 Oct 2022 Original document



Hours  |  Support Information  |  News  | 
Policies  |  Emergencies