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.
Here we have chosen
Here we have chosen
Optional but useful programs:
We can install the following optional programs (shown in the next few images and summarized below):
wgetfor getting programs to install under cygwin
emacsfor local text editing on the cygwin command line
nanofor local text editing on the cygwin command line
xclockfor testing the local cygwin X11 server
wget, but not selecting anything:
This shows the selection for
Here we have chosen the
emacstext editor, with a few possible other useful
Here we have chosen the
Here we have chosen
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
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\configfile 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 - - - - - - - - - - - - -
~/.bashrcto have the line at the start of the file:
export DISPLAY=:0.0Here 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\usernamedirectory (here our
Back in the Cygwin64 Terminal window, you can use Linux commands to copy the file from your cygwin home directory to etc:
If for some reason you downloaded the file as
cp krb5.conf /etc/.
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 /etcto list files:
We then make the ssh directory and use nano to create and edit the
~/.ssh/configfile. This is assuming we had installed the optional
nanoprogram 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
nanolooks like, we put in these settings (which are only secure for the
cmslpc*.fnal.govnodes, do not use for other hosts by default)
We then press Ctrl-X (
# - - - - - - - - - - - - cygwin - - - - - - - - - - - - - Host cmslpc*.fnal.gov GSSAPIAuthentication yes GSSAPIDelegateCredentials yes StrictHostKeyChecking no UserKnownHostsFile /dev/null # - - - - - - - - - - - - cygwin - - - - - - - - - - - - -
^means Ctrl button in nano):
yto 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
~/.bashrcfile to add the following line at the start of the file to set the
DISPLAYso that X11 Windows can connect. Use your preferred text editor here.
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
~/.bashrcand only have the
export DISPLAY=:0.0line 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 Xand accept writing the buffer.
Now to start the X11 Window server, we type on the Cygwin 64 Terminal command line:
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
~/.bashrcconfigured 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.GOVevery day, however, here it is shown for user
We ssh to the cmslpc cluster following instructions from the Get connected page to
ssh -Y email@example.com. Be sure to put in your
usernameinstead, 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
rootwithout any arguments. This should bring up a blue splash screen (here shown behind the Terminal window):
You can quit
rootas 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 setupTo 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
- Open Cygwin 64 Terminal and do the following:
Note: Documentation adapted from local FNAL instructions, and local cmslpc user instructions.
startxwin& kinit username@FNAL.GOV ssh -Y firstname.lastname@example.org