WSL 2 Vivado

With WSL 2 one can run Vivado on linux with a windows computer. Below one can find a step by step instruciton.

  1. Install WSL 2 (check also the following page)
    1. Search for Turn Windows features on or off
    2. Check “Windows Subsystem for Linux
    3. restart
    4. set version in powershell with wsl --set-default-version 2
      1. Note: When you use windows 10 use wsl --set-default-version 1
    5. Install wsl with wsl --install -d Ubuntu-20.04
      1. When there should be an error run the wsl_update_x64.msi
  2. Install vcxsrv (This allows linux to open windows on the windows machine, when you encounter problems in this step google after xeyes)
  3. Go to the installation folder (in my case it was C:\Program Files\VcXsrv) and execute the xlaunch.exe.
    1. Select the standard settings and check Disable access control in the end.
    2. Save the configuration under C:\Users\<your_username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. ==> The programm gets automatically started when the windows machine boots up
  4. Additionally add the following to the .bashrc on the linux machine. (Once done you can type in xeyes in wsl and a window should pop up)
export DISPLAY="$(grep nameserver /etc/resolv.conf | sed 's/nameserver //'):0"
# For Windows 10 type in:
# export DISPLAY=:0
  1. Install the usb drivers
    1. Since the connection of USB devices is not natively supported by WSL 2, one has install them seperatelly. An full explanation can be found under the following link or in short on this page.
      1. The easiest way for that is to use winget (windows package manager). For that open Powershell in the adminitrator mode and execute the following command:
winget install --interactive --exact dorssel.usbipd-win
  1. Go to wsl (type in wsl in the powershell terminal) and execute the following two commands:
sudo apt install linux-tools-5.4.0-77-generic hwdata
sudo update-alternatives --install /usr/local/bin/usbip usbip /usr/lib/linux-tools/5.4.0-77-generic/usbip 20
  1. Exit wsl with the exit command and reboot wsl with wsl --shutdown. Then open a new Powershell terminal in administrator mode and type in the following command:
usbipd wsl list
  1. Connect usb device and check what has changed, afterwards add the usb port with the following command:
usbipd wsl attach --busid 9-4

Where 9-4 corresponds to the port. (Note step 7 and 8 must be done everytime a usb device should be connected to linux)

  1. Install Vivado on Linux(WSL)
    1. Download the Xilinx_unified_<…>_Lin64.bin
    2. create a new folder in the WSL home directory mkdir Downloads
    3. Copy the downloaded file into the new folder cp /mnt/c/Users/<username>/Downloads/Xilinx_unified_<…>_Lin64.bin Downloads/
    4. Execute the .bin file with sudo ./Xilinx_unified_<…>_Lin64.bin
      • When one should see issues run the following command: sudo apt install openjdk-11-jdk
  2. Start wsl again with the wsl command. Then go to the following folder: /tools/Xilinx/Vivado/2022.1/data/xicom/cable_drivers/lin64/install_script/install_drivers and execute the following command: (note maybee your folder structure looks different then you can find the xicom folder with the following command: find . -name xicom )
sudo ./install_drivers
  1. Add Vivado to the bashrc
alias vivado="sudo /tools/Xilinx/Vivado/2022.1/bin/vivado"
  1. Intsall gcc on wsl with the following command:
sudo apt-get update
sudo apt install gcc -y
  1. Try to run vivado
    • When it does not work, run the following commands:
      sudo locale-gen "en_US.UTF-8"
    • sudo update-locale LANG=en_US.UTF-8
    • sudo apt update
    • sudo apt install libtinfo-dev
    • sudo ln -s /lib/x86_64-linux-gnu/libtinfo.so.6 /lib/x86_64-linux-gnu/libtinfo.so.5
  2. Add github repo with ssh.
    1. go to your home directory /home/<your name>
    2. create a .ssh folder with the following command: mkdir .ssh
    3. go into the folder and execute the following code:
ssh-keygen -t ed25519 -C "<your-email>"
#Enter
#Enter
ssh-add ~/.ssh/id_ed25519
#install clipboard
sudo apt install xclip
xclip -selection clipboard < id_ed25519.pub

once executed you have the public key in the clipboard ==> to to your github account and go to settings, ssh, new ssh key and paste in the key as well as giving a name.

Then clone a repo with the ssh url

  1. One is now able to start vivado with the vivado command

Leave a Reply