Configuring SVN on Windows

VisIt developers use a variety of scripts that automate subversion checkouts on UNIX systems, which already have svn installed. On Windows, the situation is different. There is no svn client installed by default. If you have Cygwin, it is probably possible to download its svn client and use it to download VisIt source code to your Windows computer. However, since VisIt is not configured to build under Cygwin, you might want a more Windows-centric solution.

Tortoise SVN

Tortoise SVN is an SVN client for Windows that is implemented as a shell extension. This means that once installed, your Windows explorer application will have SVN commands in some of its menus. These commands allow you to configure SVN, make checkouts, etc.

Downloading and installing

Tortoise SVN can be downloaded from the following URL: Tortoise SVN download. The download link downloads an .msi file that the Microsoft installer can use to download Tortoise SVN. Once you install Tortoise SVN, your Windows explorer application will be "SVN-enabled".

  • Be sure to choose the option to install the svn client command line tools during the installation. The command line tools are not installed by default but sometimes come in handy, such as when you start a Buildbot.
Windowssvnmenu.jpg

SSH access to SVN

VisIt's source code repository is available at NERSC on a machine called edison.nersc.gov (it used to be available via portal-auth.nersc.gov). You must have an account on that machine in order to download VisIt's source code. Access to edison.nersc.gov requires the use of SSH, which means that the SVN download location is:

svn+ssh://username@edison.nersc.gov/project/projectdirs/visit/svn/visit/trunk

All of this means that you must configure Tortoise SVN to access edison.nersc.gov via SSH before you can obtain VisIt's source code.

PuTTY

There are many different SSH programs for Windows but a good free package is called PuTTY. PuTTY provides among other things, a program called plink that can be used to SSH to remote computers. PuTTY can be downloaded from the following URL: PuTTY download. Run the installer from the link in order to install PuTTY. Once PuTTY is installed, a new PuTTY program group will be added to the Windows Start menu. You can access the various programs from the PuTTY suite from that menu.

PuTTY Program Description
puttygen Generates keys for SSH
pageant Manager program for keys. You can use pageant to tell the PuTTY applications the location of the private SSH key file that you generate with puttygen. This means that you don't have to specify the location of the SSH key file on the command line when you call other PuTTY programs, although you can.
plink Telnet/RSH/SSH client

Configuring PuTTY for passwordless SSH access

There are several steps involved in setting up passwordless SSH for PuTTY's plink application. These instructions are geared towards getting passwordless access to edison.nersc.gov, but they could work for any remote host.

  1. Make sure that you can log into edison.nersc.gov using plink and your password
  2. Run puttygen to generate a pair of SSH keys (public/private)
  3. Add the generated public key to your authorized_keys file on edison.nersc.gov
  4. Use pageant to tell PuTTY applications where to find the private key
  5. Test logging into edison.nersc.gov without a password

First of all, you need to see if you can successfully use PuTTY's plink program to log into edison.nersc.gov using your password. You will need to do so in order to get and send a .ssh/authorized_keys file. Open a Windows command line shell by running cmd.exe from the Start menu's Run window. Next, try running plink to log into edison.nersc.gov:

plink.exe -ssh -2 -l username edison.nersc.gov

When you are prompted for your password, enter it. If everything goes as intended, plink will log you into edison.nersc.gov and you can look at your home directory, which is most likely empty. Next, type ls -la to list all of your home directory's contents. If you do not have a .ssh directory then you should mkdir .ssh to create that directory. If you had to create the .ssh directory then you do not already have an authorized_keys file and you can create one on your Windows computer. If you have a file called .ssh/authorized_keys then we will need to download it to your Windows computer so we can add a new public SSH key to it once we have run the puttygen application. At this time, type exit to disconnect from edison.nersc.gov.

To download .ssh/authorized_keys (if you have one):

pscp.exe username@edison.nersc.gov:.ssh/authorized_keys .

Now, run the puttygen application from the PuTTY program group. The puttygen application is used to make a public/private key pair for SSH. By default, puttygen will want to create a 1024 bit RSA key, which is adequate for our needs. Next, click the Generate button to make puttygen generate a key pair. Note that puttygen will want you to move the mouse over part of its window as a source of randomness for its key generation algorithm. Once the key is generated, the public key will appear in a text box near the top of the window. The public key is the piece that you'll add to your authorized_keys file.

Puttygen.jpg

Next, type replace the "username@machine" comment with values that make sense for you. These comments can help you remember which the key to machine mapping if you ever need to edit the authorized_keys file again. Select all of the text located in the text box labelled "This is where your public key will appear" in the above image. Type Ctrl+C to copy the public key text to the Windows clipboard. Open the authorized_keys file that you downloaded or create a new text file with that name if you did not have that file. Type Ctrl+V to paste the public key into the end of the authorized_keys file. Make sure that you save the authorized_keys file now.

We're not totally done with puttygen just yet. Click the Save private key button to save the private key values to a file on your Windows computer. You will later use the file that you save to add the private key to PuTTY's pageant application so don't forget where you put the private key file.

Now that both keys are saved, we need to transfer the authorized_keys file back to edison.nersc.gov.

pscp.exe -scp -2 authorized_keys username@edison.nersc.gov:.ssh/authorized_keys

Now that we've done the hard part, run the pageant application from the PuTTY program group on your Windows computer. Click the Add key button and load the filename into which you saved the private SSH key. Once the private key is loaded into pageant, your other PuTTY applications should be able to connect to edison.nersc.gov without a password. Note: Each time you reboot your computer, you will need to run pageant and add the private key. Otherwise your plink application will not be passwordless.

Pageant.jpg

The final step is to test your passwordless connection to edison.nersc.gov. Try logging into edison.nersc.gov again using plink. If no password is required in order to log in then you've completed all of the steps to setting up passwordless ssh to edison.nersc.gov and you can proceed with setting up Tortoise SVN.

plink.exe -ssh -2 -l username edison.nersc.gov

Configuring Tortoise SVN to use PuTTY for SSH

Now that PuTTY is configured to connect to edison.nersc.gov without a password, we can configure Tortoise SVN to use PuTTY's plink program to access edison.nersc.gov. To configure Tortoise SVN, right click in Windows explorer and select the TortoiseSVN->Settings menu option from the context menu. This will open Tortoise SVN's configuration window.

Tortoisesvnssh.jpg

When the Tortoise SVN settings window opens, click on the Network option to open the configuration page for network settings. That's where we tell Tortoise SVN to use plink. Type the following into the SSH client text field:

C:\Program Files\PuTTY\plink.exe -ssh -2 -l username

Click the Apply button and then the Ok button to dismiss the settings. Note that other options can also be set in the TortoiseSVN settings window. One other property you may want to set is the text file differencing program that you want to use (if you have a fancy one).

Now that you've configured TortoiseSVN to access the VisIt source code repository, you can check out the source code and familiarlize yourself with some TortoiseSVN options.

Configuring Tortoise SVN to use Cygwin's ssh.exe for SSH

If you have Cygwin installed, you can easily use its ssh.exe program to communicate with VisIt's SVN repository. Simply replace plink with ssh in the above PuTTY example, entering the following for the SSH client text field:

C:\cygwin\bin\ssh.exe -l username