Close menu Resources for... William & Mary
W&M menu close William & Mary

Connecting to HPC via Windows with PowerShell

Connecting directly to HPC clusters from on-campus (main or VIMS) via Windows PowerShell

Using ssh to connect to an HPC cluster front-end (such as bora.sciclone.wm.edu or james.hpc.vims.edu) consists of one command of the form:

ssh <username>@<hostname>

that you enter into a Windows PowerShell session. Note that <username> can be omitted if it matches your local computer username. It will be explicitly included in all examples.   For almost all HPC users, your <username> is your W&M username.  Here is an example with <username> = ejwalt making an ssh connection to the HPC front-end with <hostname> = bora.sciclone.wm.edu :

p1.pngThis is now a command-line session on bora.sciclone.wm.edu. 

Connecting directly to HPC clusters from on-campus (main or VIMS) via Windows PowerShell w/ Xming X11 forwarding 

To use X11 graphics on Windows from the HPC cluster, you will not only need to pass -Y, but you also need to install an X11 program for your Windows computer.  We recommend downloading and installing Xming

Additionally, one command must be entered into the PowerShell window:

setx DISPLAY "locallhost:0.0"

p22.png

Then be sure to close and restart Windows PowerShell

Once Xming is installed and running, a program running on the cluster will be able to display X based graphics on your local machine.  To log on to the bora.sciclone.wm.edu front-end from on-campus and allow X11 forwarding, the command is:

ssh -Y <username>@<hostname>

Here is an example with the -Y passed along, note that the session is able to launch the program xterm from bora which opens a new terminal on my local computer (the white window):

p3.png

This is now an X11 capable command-line session on bora.sciclone.wm.edu. 

Connecting to HPC clusters from off-campus via Windows PowerShell through the IT bastion host

To ssh through the IT bastion host to a HPC cluster front-end server, you must simply add -J <username>@bastion.wm.edu to the previous ssh command: 

If you do not have an ssh key added to the bastion host (see https://code.wm.edu/IT/bastion-host-instructions for more information), you will need to authenticate via DUO after entering your W&M password.  Once this is complete, you will then need to enter your W&M password again to log into bora.sciclone.wm.edu.   In this case, the command is:

ssh -J <WM username>@bastion.wm.edu <username>@<hostname>

p4.pngThis is now a command-line on bora.sciclone.wm.edu that connected through the bastion host.  

Connecting to HPC clusters from off-campus via Windows PowerShell through the IT bastion host w/ Xming X11 forwarding

To use X11 graphics on Windows from the HPC cluster, you will not only need to pass -Y, but you also need to install an X11 program for your Windows computer.  We recommend downloading and installing Xming

Additionally, one command must be entered into the PowerShell window:

setx DISPLAY "locallhost:0.0"

p22.png

Then be sure to close and restart Windows PowerShell

Once Xming is installed and running, a program running on the cluster will be able to display X based graphics on your local machine.  To ssh through the IT bastion host to a HPC cluster front-end server, you must simply add -J <username>@bastion.wm.edu to the previous ssh command: 

If you do not have an ssh key added to the bastion host (see https://code.wm.edu/IT/bastion-host-instructions for more information), you will need to authenticate via DUO after entering your W&M password.  Once this is complete, you will then need to enter your W&M password again to log into bora.sciclone.wm.edu.   To log onto the HPC cluster through the bastion host while forwarding X11 graphics, the  the command is:

ssh -Y -J <WM username>@bastion.wm.edu <username>@<hostname>

Here is an example with the -Y passed along, note that the session is able to launch the program xterm from bora which opens a new terminal on my local computer (the white window):

p5.pngThe is now an X11 capable command-line session on bora.sciclone.wm.edu connecting through the bastion host.