> For the complete documentation index, see [llms.txt](https://docs.mitchell.science/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mitchell.science/computational-work/connecting-to-our-hardware.md).

# Connecting to our hardware

This page detailas how to connect to the various servers, storage devices etc you will need

## The Computational Servers

We have 3 main computational servers:

* simon-HP-Z6-G4-Workstation (139.184.170.218)
  1. 72 cores @ 2.3GHz
  2. 62GB of RAM
* Jean Luc Packard Bell (JLP) (139.184.170.218)
  1. 104 cores @ 2.1GHz
  2. 188 Gb of RAM
* Priti TheDell (139.184.171.6)
  1. 12 cores @ 4GHz
  2. 62GB of RAM

Our main computational server is situated in Simon's office and snappily named: simon-HP-Z6-G4-Workstation. This is a 72 Core (2.3GHz) Intel Xeon workstation with 64GB of RAM running Ubuntu. Everyone doing computational work will be given an ssh user on this machine, let Simon know if you haven't been given one.&#x20;

You can connect to the server using SSH from any machine in BSMS (and potentially when on the Sussex VPN). If the VPN does not work try accessing your BSMS machine using Team Viewer and then running ssh from there.

`ssh username@139.184.170.218`

You should be able to launch graphical applications, such as MATLAB remotely using

`ssh -X richard@139.184.170.218`

If you are using Mac OSX you're best using XQuartz to launch graphical applications on the server <https://www.xquartz.org/>. If you are using Windows, Cygwin/X provides this functionality <https://x.cygwin.com/>.

You may find connecting to the server using the computer name rather than the IP is more successful, so try `username@simon-hp-z6-g4-workstation.local` in place of any IP addresses on this page.

### Using FTP to download files from the server

Your SSH logins will also allow you to have sFTP access to the servers. I recommend using [FileZilla](https://filezilla-project.org/). You will need to use the SFTP protocol, and the same username and password you usually use to FTP into the server, so your settings will look like this:

<figure><img src="https://814488410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_LiQgIbmSryTB3vZjm%2Fuploads%2FkbHNQ3S06c0QDQeiJ8I6%2FScreenshot%202022-11-16%20at%2012.50.05.png?alt=media&amp;token=5ec936a3-6959-4de9-9c4c-e70afce7aa61" alt=""><figcaption><p>FTP settings for FileZilla. Add these to your site manager to remember them </p></figcaption></figure>

### Using Chrome Remote Desktop to connect remotely

*Note: setup must be done from campus for the first time.* \
\
Follow the instrutions here: <https://remotedesktop.google.com/headless>

Briefly:

* Navigate to <https://remotedesktop.google.com/headless> in Firefox or chrome on your laptop/remote machine, and log in with a Google account you want to use to access the server.
* simultaneously ssh into the server in a terminal (as described above, `ssh username@139.184.170.218`)
* on the server download chrome remote desktop\
  [`wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb`](https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb)
* install chrome remote desktop\
  `sudo dpkg -i chrome-remote-desktop_current_amd64.deb`&#x20;
* if you get an error due to unmet dependencies run\
  `sudo apt-get -f install`\
  then try again\
  `sudo dpkg -i chrome-remote-desktop_current_amd64.deb`
* hit next and authorize on the web page <https://remotedesktop.google.com/headless>
* Copy the command displayed on the web pageunder Debian Linux, which should look something like this:\
  `DISPLAY= /opt/google/chrome...`
* paste this command into the ssh window, it will ask for a 6 digit pin, which you should enter twice.
* When prompted with:\
  `[sudo] password for [username]:`\
  You need to enter your password for your user on the server.
* You are done, head to the below link:\
  <https://remotedesktop.google.com/access>\
  Click on simon-HP-Z6-G4-Workstation and enter the pin you chose above. You probably want to tick 'remember the pin on this device'.
* Click ok on the gray pop-up window to launch the default XSession
* If you want to access jupyter hub from the server itself you need to put the below IP into the web browser (Firefox) on the server, and then login with your username and password on the server:\
  `127.0.0.1:8000`

*Note: you cannot be simulateously logged in with multiple graphical sessions so if you are logged into the server with ssh -X your chrome remote desktop session will not work. Close any active graphical sessions before using Chrome Remote Desktop.*<br>

## Running your Julia Notebooks on the Server

### Preferred: Using Jupyter Hub

Point a web browser to port 8000 of the IP of the server:\
[`http://139.184.170.218:8000`](http://139.184.170.218:8000/)

Login with your ssh username and password for the server. You should then see your home folder in the Jupyer Notebook browser and can launch Julia notebooks from there.&#x20;

If you have mounted the NAS in your home director as [described below](/computational-work/connecting-to-our-hardware.md#mounting-the-nas-on-the-server) you should be able to navigate to your folder on the NAS. If you have the synology software s[ynchronising your changes from your laptop to the NAS ](/computational-work/connecting-to-our-hardware.md#backup-your-work-to-the-nas-at-least-once-a-week)you should be able to see all your code there.

#### Problems and solutions

If Julia isn't installed on the server:

* Copy the link to the latest version of Julia from the [Julia Downloads Page](https://julialang.org/downloads/), use the glibc Linux link highlighted below.
* &#x20;![](https://814488410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_LiQgIbmSryTB3vZjm%2Fuploads%2FTVGUDDNhJcZgxL7JhN7P%2Fimage.png?alt=media\&token=ac82d1e1-b80c-4664-a3fa-a02f7cc02b43)
* ssh into the server.
* wget the link above, for example\
  `wget` [`https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.5-linux-x86_64.tar.gz`](https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.5-linux-x86_64.tar.gz)
* unzip the file\
  `tar xzvf julia-1.8.5-linux-x86_64.tar.gz`
* Launch the julia you just installed\
  `./julia-1.8.5-linux-x86_64/bin/julia`
* You probably now want to install the Julia kernal in python notebooks as shown below.
* add julia support to Jupyter notebook with the following command:\
  `using Pkg`\
  `Pkg.add("IJulia")`
* create a new julia kernel with an environment variable setting the number of threads (there are 72 cores on the server so chose a number close to, but slightly less than, 72):\
  `using IJulia`\
  `IJulia.installkernel("Julia 64 threads",env=Dict(`\
  &#x20; `"JULIA_NUM_THREADS"=>"64"`\
  `))`

#### If JupyterHub is not working

If JupyterHub is not running (perhaps the server has been restarted), you need to relaunch it.

* SSH into the server
* Start a new "screen" so you can keep JupyterHub running after you log off.\
  `screen`\
  press enter if anything pops up asking you to confirm
* launch jupyter hub:<br>

  ```
  cd /etc/jupyterhub
  sudo -u rhea jupyterhub --JupyterHub.spawner_class=sudospawner.SudoSpawner
  ```
* Now detach from the "screen" by pressing and holding ctrl and pressing A then D all while still holding ctrl.\
  `Ctrl + A, D`
* You can now exit the server by typing `exit` or just close your terminal

#### To add new users to Jupyterhub:

* add the user to the server:\
  `sudo adduser johndoe`
* then add the user to the sudoers file as a user able to use jupyterhub \
  `sudo visudo /etc/sudoers`
* Add their name to the Runas*Alias as shown below:*\
  `Runas_Alias JUPYTER_USERS = rhea, simon,..., johndoe`

### Alternative: Connecting to the server with port forwarding

This is more difficult, talk to Simon if trying this approach. Rather than doing all your development on the server, it is possible to develop locally and execute remotely on the server. You can run your Julia Notebooks on the server so that the Julia kernel is run on the server to make the most of the available computing power. To achieve this follow the below steps:\
*Note: You may first (before step 1) need to install Anaconda to your user on the server as each installation of Anaconda is stored in the user's home folder. You may need to add the Julia kernal to the iPython environment as well.*

1. ssh into the server\
   `ssh username@139.184.170.218`
2. launch jupyter without a browser front-end \
   `./anaconda3/bin/jupyter notebook --no-browser`
3. On your local machine/laptop in a new terminal, forward the port used by jupyter notebook to the server\
   `ssh -L 8888:localhost:8888 simon@139.184.170.218`
4. Now launch a web browser and go to <http://localhost:8888>

You may be asked for a password, in which case follow the steps here: <https://jupyter-notebook.readthedocs.io/en/stable/public_server.html>

## Network Attached Storage

We have a Synology NAS DS1520+ with around 20TB of storage available at <http://mitchelllabnas.quickconnect.to> or <http://139.184.169.71:5000/>

You should have a username and password to connect. You will have a user folder in volume1/General which you have write access too. You also have read-only access to the other user folders. There is also a shared folder we all have read and write access to to enable us to send things to each other easily.

You can mount the NAS on your laptop/desktop as if it is a local hard disk drive.

* on Mac OSX open Finder, and in the menu at the top Go > Connect to server and enter [`afp://MitchellLabNas.local`](afp://MitchellLabNas.local)You will then be asked for your NAS username and password, which you should know, if you don't, ask Simon.
* On Windows, enter the following address into Windows Explorer `\\MitchellLabNas`
* From Linux, follow the below instructions on Mounting the NAS on the server.

### **Backup your work to the NAS at least once a week!**

This can be automated and scheduled using the *Synology Drive Client* available here:\
<https://www.synology.com/en-uk/support/download/DS1520+#utilities>

### Mounting the NAS on the server

If you wish to read-and-write from your user folder on the NAS, while running your computational jobs on the server you can mount the NAS from the server using the following command:

`cd ~`

`mkdir synology`

`sudo mount -t nfs 139.184.169.71:/volume1/General/<your username> ~/synology/`\
replace \<your username> above with your username for example:

`sudo mount -t nfs 139.184.169.71:/volume1/General/simon ~/synology/`

`cd synology`

Alternatively the server should already be mounted in `/mnt/Synology/<your username>`

## BinderHub for teaching.

Binderhub provides each student with a small computing environment for teaching purposes on the server (<http://139.184.170.218:8005>). It works exactly the same as <https://mybinder.org/> and both can be used interchangeably. To start our binder service on the server the key commands are:\
`cd /media/simon/ssd2/binderhub`&#x20;

`helm upgrade teaching jupyterhub/binderhub --version=0.2.0-n880.hd19a36a --namespace=teaching -f secret.yaml -f config.yaml`

`kubectl port-forward --address 139.184.170.218 service/binder 8005:80 --namespace=teaching`

Then in a new shell:

`sudo microk8s.kubectl port-forward --address 139.184.170.218 service/proxy-public 8006:80 --namespace=teaching`

Now Binderhub should be accessible at [139.184.170.218:8005](http://139.184.170.218:8005) **🙏**

## Sussex Staff VPN

Sussex staff (which is everyone in the lab apart from PhD students, can connect to the Sussex Staff VPN in order to connect to all of our hardware from home. This will also enable paper access from home.&#x20;

[Instructions for accessing the VPN are provided here.](https://mitchell.science/Connecting%20to%20the%20Staff%20VPN%20v4.1.pdf)

For Linux users they will need to follow the above PDF instructions, but instead of getting the GlobalProtect software from Palo Alto (which isn't available for Linux), they will need to use the files and follow the instructions in [this file and the included Readme](http://mitchell.science/vpn-openconnect-master%20\(6\).zip).
