FPGA Student Classroom tutorial

De la WikiLabs
Jump to navigationJump to search

Fpga Student Classroom Access Tutorial

This is a guide that aims to show how to connect to the classroom resources remotely, in order to access the software and hardware resources (FPGAs) available at the university. The goal is to create a remote desktop session to one of the computers in the lab. This session can then be used to run software (eg. Vivado) and to program hardware FPGAs.

Before you can connect to the classroom cluster, you will need to obtain the following from a system administrator:

  • a VPN configuration file (eg. fsc00-myname.conf)
  • a username and password
  • an assigned workstation and FPGA board (eg. station07 & pynq07)

The connection process consists of the following steps:

1. Connect via VPN to the cluster network. 2. Connect to your workstation via SSH and create a remote desktop (VNC) instance. 3. Connect to the remote desktop instance.

Step 1 -- VPN


To connect to the cluster network via VPN you will need the provided VPN configuration file (eg. fsc00-myname.conf) and a Wireguard VPN client.

For a full guide on how to use the Wireguard VPN check [this page](https://link).

Step 2 -- SSH


In order to connect to your workstation via SSH to open the remote desktop instance, you will need a terminal application or a dedicated SSH client.

Windows 11 comes with Windows Terminal. Windows 10 users can download the [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701) from the Microsoft Store or use the older Command Prompt application.

macOS has a pre-installed Terminal application. [iTerm2](https://iterm2.com/) is a popular community alternative with more features.

Firstly, connect to the workstation using the following command:

```bash > ssh myname@station07

(myname@station07) Password: Password expired. Change your password now. (myname@station07) Current Password: (myname@station07) New password: (myname@station07) Retype new password:

myname@station07:~$ ```

Replace `myname` and `station07` with your username and your assigned workstation. If it is your first time logging in, you will be prompted to change your initial password, as in the example above.

Note: the terminal will not echo the password you enter, so you will not see what you are typing!

Once connected you can launch a VNC instance with the following command:

```bash myname@station07:~$ vncserver -localhost no

You will require a password to access your desktops.

Password: Verify: Would you like to enter a view-only password (y/n)? n A view-only password is not used /usr/bin/xauth: file /ghome/myname/.Xauthority does not exist

New Xtigervnc server 'station07.fsc00.arh.pub.ro:3 (myname)' on port 5903 for display :3. Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /tmp/tigervnc.Dp5IoV/passwd station07.fsc00.arh.pub.ro:3 to connect to the VNC server.

myname@station07:~$ ```

The `vncserver` command launches a VNC instance for your user. The `-localhost no` argument allows accessing the VNC instance from different machines.

If this is your first time launching an ssh instance, you will be prompted to choose a password for the VNC session. This can be the same password as the one for your account or it can be something different.

You will need to note two things from the program output, which you will use later: the VNC port used (5903 in the example above), and the X display number (:3 in the example). If you forget these numbers, you can run the `vncserver -list` command, to list your active VNC sessions and their associated ports and X display numbers.

Once you have an active VNC session, you can close your terminal application or SSH client. Your VNC session will remain active until you stop it manually.

Once you are done working on the system, you can close your VNC session manually with:

```bash myname@station07:~$ vncserver -kill :3 ```

Replace :3 with the X display number you noted earlier.

Step 3 -- VNC


You are now ready to connect via remote desktop to your station, using VNC. You will need a VNC client in order to connect. TigerVNC is a popular VNC client that is very easy to use. There are also other VNC clients which provide more features (RealVNC, TightVNC, Remmina), but they may be less reliable.

You can install TigerVNC on Windows by downloading it from [here](https://sourceforge.net/projects/tigervnc/files/stable/1.15.0/).

You can install TigerVNC on macOS by downloading it from [here](https://tigervnc.macupdate.com/).

You can install TigerVNC on Linux via Flatpak by running `flatpak install flathub org.tigervnc.vncviewer` (without `sudo`). If Flatpak is not configured on your system, you can follow the guide [here](https://flatpak.org/setup/) to set it up. Alternatively, you may be able to find TigerVNC in your distribution's packages.

Once TigerVNC is installed, running the program will bring up a prompt with an address field. Enter your workstation name, followed by a colon, and the port of your VNC instance, as shown below.

![Image of TigerVNC address prompt](

Tigervnc.png

"Enter your workstation and port here")

Click connect any you will be prompted for a password. This is the password you entered when you first started a VNC instance, not the password for your user account.

![Image of TigerVNC password prompt](image2.png "Enter your VNC password here")

If you enter the password correctly, you will be greeted with a view of the desktop on your machine.


![Image of GNOME desktop](image3.png "You are finally connected!")


You can open a terminal on this desktop and run `vivado` and wait for the Vivado IDE to open in order to check that everything is set up correctly.

![Image of Vivado open on GNOME desktop](image4.png "Connected to Vivado!")

  1. FAQ

Q: I can not connect to my VNC session. A: Connect to your workstation via SSH and make sure your VNC session appears when running `vncserver -list`. Additionally, make sure you have launched the VNC server using the `-localhost no` option.

Q: I can not connect via SSH, the workstation appears to be powered off. A: The workstations you are working on are used in the classrooms by students for lab activites. Some students have the tendency to close the stations when leaving the lab, against the teacher's instruction. If your workstation is powered off, contact a system administrator and they can power it on remotely.

Q: I can connect to VNC, and it shows a login screen, but I can not type my password and it shows an "Authenthification error" message. A: This is a [known bug](https://askubuntu.com/questions/1224957/i-cannot-log-in-a-vnc-session-after-the-screen-locks-authentification-error) in the TigerVNC server. With your VNC client still active, connect via SSH and run the `loginctl unlock-sessions`/