U.S. CMS
Search
uscms.org  www 

Show me how to setup Cygwin/X on Windows to connect to the cmslpc cluster

Text version of instructions alone back at: cmslpc getting started: cygwin

Download, Install, and Configure Cygwin/X for Windows

Follow this link to download Cygwin/X for Windows. We use the "setup-x86_64.exe" file.



Run the installer (you can download it or just run it):


Run the Cygwin Setup program, click "Next":


Leave the default choice to install from the Installer and click "Next":


The default option is to install for all users (unless you choose otherwise), click "Next":


Be sure the local package directory is set to C:\cygwin64, you may have to change this.


We presume you want to use System Proxy Settings for the installation:


You are asked to choose the mirror, here I've chosen a ".edu" site, the default also works at Fermilab. You may wish to choose a mirror which is physically close to you for faster network:


Next you are asked to select your packages and to choose what to install. This shows before anything has been selected other than the Cygwin/X default:


As a minimum we need Kerberos, openssh, and xinit, we search for and choose by clicking on the "Bin" box (this is the next series of images and summarized below) the following programs. Note that you can expand any category by clicking on the "+", or minimize by "-". Choose to install programs by clicking on the "Skip" on the particular line and the "Bin" checkbox will be checked. You do not need the src.
  • krb5-auth-dialog
  • krb5-workstation
  • openssh
  • xinit
Here we have chosen krb5-auth-dialog and krb5-workstation :


Here we have chosen openssh :


Here we have chosen xinit :


Optional but useful programs:
We can install the following optional programs (shown in the next few images and summarized below):
  • wget for getting programs to install under cygwin
  • emacs for local text editing on the cygwin command line
  • nano for local text editing on the cygwin command line
  • xclock for testing the local cygwin X11 server
This first screen shows an example of having searched for wget, but not selecting anything:


This shows the selection for wget :


Here we have chosen the emacs text editor, with a few possible other useful emacs packages:


Here we have chosen the nano text editor:


Here we have chosen xclock :


End of optional packages: Now the Cygwin setup will ask you to resolve dependencies. This is the same type of installation dialog one would get in Linux package installation. For the packages you have chosen, you may have other packages that are required for them to work, be sure you have the checkbox to "Select required packages (RECOMMENDED)":


We have seen this libsub0-Win32 driver error, but have not done anything other than click "OK", and haven't experienced any errors in typical cmslpc usage of Cygwin/X:


You will see a progress bar, in my tests it took about 10 minutes, it may take more if you chose to install more packages, or if you have a slow network connection to the mirror:


If packages fail to download, be sure to "Retry" instead of continue to get those missing packages. In most cases they will work. You can always install more packages using the Cygwin-X "setup-x86_64" installer that you have downloaded (choosing a different mirror site if need be).

You are then given the choice to create an icon on the Desktop or add it to the Start Menu, choose what is preferred for your Windows workflow:


This is the "Cygwin64 Terminal" icon on the Desktop, double click on it to start Cygwin to finish setting up (and to start it for your workday). Or choose "Cygwin64 Terminal" from the Start Menu, or however you like to start programs.


You will notice some messages about initial starting. Cygwin/X sets you up with a Linux environment with the bash shell, and creates a home directory under your username in C:\cygwin64\home. In this example, our Windows laptop has the user named temp


You now need to setup the Prerequisites for logging into the cmslpc cluster, we treat the setup mostly like a Linux machine here. This is shown in the next few images. The next steps are summarized as follows:
  • Getting the latest krb5.conf from Fermilab
  • Putting the krb5.conf into C:\cygwin64\etc - you may need Windows administration privileges to do this
  • Making a C:\cygwin64\home\username\.ssh directory
  • Creating C:\cygwin64\home\username\.ssh\config file and filling it with these settings:
    • 
      # - - - - - - - - - - - -  cygwin - - - - - - - - - - - - -
      Host cmslpc*.fnal.gov
          GSSAPIAuthentication yes
          GSSAPIDelegateCredentials yes
          StrictHostKeyChecking no
          UserKnownHostsFile /dev/null
          ForwardX11 yes
          ForwardX11Trusted yes
      # - - - - - - - - - - - -  cygwin - - - - - - - - - - - - -
      
  • Additionally, you will need to edit your ~/.bashrc to have the line at the start of the file: export DISPLAY=:0.0
Here we go to the Fermilab Kerberos Configuration Files web page, and choose to save the Linux file:


Navigate to save the file in your C:\cygwin64\home\username directory (here our username is temp):


Back in the Cygwin64 Terminal window, you can use Linux commands to copy the file from your cygwin home directory to etc:
    cp krb5.conf /etc/.
    
If for some reason you downloaded the file as krb5.conf.txt, you will need to ensure the final file is named krb5.conf, so modify your command appropriately. We also check the file is there with ls -alh /etc to list files:


We then make the ssh directory and use nano to create and edit the ~/.ssh/config file. This is assuming we had installed the optional nano program above. Note that you can use vi (installed by default), or emacs (if installed), whichever editor is your preference.
    
    cd ~
    mkdir .ssh
    


This is what nano looks like, we put in these settings (which are only secure for the cmslpc*.fnal.gov nodes, do not use for other hosts by default)
    
    # - - - - - - - - - - - -  cygwin - - - - - - - - - - - - -
    Host cmslpc*.fnal.gov
        GSSAPIAuthentication yes
        GSSAPIDelegateCredentials yes
        StrictHostKeyChecking no
        UserKnownHostsFile /dev/null
    # - - - - - - - - - - - -  cygwin - - - - - - - - - - - - -
    
We then press Ctrl-X (^ means Ctrl button in nano):


Choose y to save the modified buffer text file:


Press "Enter" to save the file in .ssh/config (this is presuming you did these commands from your home directory:


We then need to edit the ~/.bashrc file to add the following line at the start of the file to set the DISPLAY so that X11 Windows can connect. Use your preferred text editor here.
    
    export DISPLAY=:0.0
    


Here we were sure to put this on a blank line near the top. At least one user had to remove all the default contents of the ~/.bashrc and only have the export DISPLAY=:0.0 line due to placement within the default file. You may note that most everything in the default file is commented out with #. We save the file as before with Ctrl X and accept writing the buffer.


Now to start the X11 Window server, we type on the Cygwin 64 Terminal command line:
    
    startxwin&
    
Note You will use this command at the start of a workday or work session to start the Cygwin/X11 window server. The & part puts the command in the background.


The first time you startxwin&, it will set some things up. If then you press "Enter", you will get your prompt back.


Here we are testing our local Cygwin/X11 server by running the optional xclock & program in the background. A clock Xwindow pops up and we can close it with the "X". Note that if this doesn't work, be sue you have your ~/.bashrc configured properly above, as well as your startxwin& having been run. You don't need to do this every day, this is just a useful test:


You will need to kinit username@FNAL.GOV every day, however, here it is shown for user tonjes:


We ssh to the cmslpc cluster following instructions from the Get connected page to ssh -Y username@cmslpc-sl7.fnal.gov. Be sure to put in your username instead, and a different machine address as appropriate for where you are connecting to.


Now you may work as normal. To test that you have remote X11 windows opening, you can setup CMSSW, then run root without any arguments. This should bring up a blue splash screen (here shown behind the Terminal window):


You can quit root as usual with .q, and you can close the Cygwin/X session with exit. Note that this will stop your Xwindow server as well.


Daily workflow to login to LPC CAF with Cygwin after it is setup

To summarize once you have Cygwin/X setup as above, you can start your daily work to connect to the LPC CAF with (using your Fermilab username below):
  • Open Cygwin 64 Terminal and do the following:
  • startxwin&
    kinit username@FNAL.GOV
    ssh -Y username@cmslpc-sl7.fnal.gov
    

Note: Documentation adapted from local FNAL instructions, and local cmslpc user instructions.
Webmaster | Last modified: Tuesday, 18-Aug-2020 16:22:26 CDT