Skip to main content
Version: 6

Set up the Torizon IDE Extension 2 Environment

Introduction​

This article provides a step-by-step guide on host machine setup for developing applications with TorizonCore devices using Visual Studio Code and the Torizon VS Code Extension 2. It includes instructions for Installing software and dependencies on your Windows or Linux-based host machine.

This article complies with the Typographic Conventions for Toradex Documentation.

Prerequisites​

  • Understanding the basics of the Torizon IDE Extension 2.

  • Host machine with:

    danger

    You have to install the Visual Studio Code from its Download page. The IDE Extension 2 will not work with VS Code installed via Snap or Flatpak!

    For WSL 2, the Visual Studio Code has to be installed on the Windows side.

Configure a Windows Host Machine​

Preparation Steps​

Before installing the Torizon IDE Extension 2 (MANDATORY)

Install the Windows Subsystem for Linux (WSL 2)​

The Windows Subsystem for Linux (WSL) enables the use of most Linux command-line tools, utilities and applications directly on Windows.

caution

WSL2 requires Windows 10, updated to version 2004 (also known as the Windows 10 May 2020 Update) or higher.

  1. Open Powershell as administrator.

  2. Install WSL: use the wsl --install -d Ubuntu-22.04 command.

    info

    Toradex recommends using Ubuntu 22.04. If you are familiar with a different Linux distribution, refer to the WSL documentation to ensure a correct installation, then follow the instructions in the Linux section to install Docker Engine.

  3. Restart your PC.

  4. A WSL terminal will be automatically opened. Do not close it!

  5. Input a username and password: you will use this password when running sudo commands in the WSL terminal.

  6. Proceed to the Docker engine installation: you will run the commands in the WSL terminal.

How to check the default Linux distribution of WSL

You can check the installed and default distributions of WSL by running the following command in PowerShell:

$ wsl -l -v

For detailed information, refer to the WSL documentation.

Install Docker Engine​

As Docker Desktop is licensed under the Docker Subscription Service Agreement, we recommend using Docker Engine.

  1. Install Docker Engine: run the following commands:

    $ sudo apt-get remove docker docker-engine docker.io containerd runc

    $ sudo apt-get update

    $ sudo apt-get upgrade

    $ sudo apt-get install -y \
    ca-certificates \
    curl \
    gnupg \
    net-tools \
    gnome-keyring

    $ sudo mkdir -m 0755 -p /etc/apt/keyrings

    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

    $ echo \
    "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
    "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
    sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

    $ sudo apt-get update

    $ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

After the Docker installation, you need to create the docker group and add your user to it. This is required to run the Docker commands without sudo. In a new terminal from the WSL 2 distro run the following commands.

  1. Create the docker group:

    $ sudo groupadd docker
  2. Add your user to the docker group.

    $ sudo usermod -aG docker $USER
  3. Restart your PC.

Before using Docker commands or the Torizon IDE Extension 2, you need to start the Docker service in a WSL terminal.

  1. Open a WSL terminal: you can search for wsl in the Windows search bar.

  2. Start the Docker service:

    $ service docker start

For detailed information, refer to the Docker Engine documentation.

Install WSL Extension​

The Visual Studio Code IDE enables you to work in the WSL filesystem, providing access to the Linux environment directly from Windows. It includes the git revision control system, Docker command line tools, and more.

To install the WSL extension, proceed with the following steps:

  1. Click the Extensions icon from the left menu bar in Visual Studio Code.

  2. Search for ms-vscode-remote.remote-wsl. Click Install.

Set up the Torizon IDE Extension 2 on Visual Studio Code​

  1. Uninstall previous versions: it is not recommended to have both IDE Extensions 1 and 2 installed in your VS Code installation at the same time. If you have the V1 extension installed, please uninstall it before proceeding with the next steps.

  2. Connect to the WSL environment: press F1, search for wsl, and select WSL:Connect to WSL. Then, you will be able to install extensions in the WSL environment.

  3. Install & Configure the IDE Extension 2.

    1. Click the Extensions icon from the left menu bar in Visual Studio Code.

    2. Search for toradex.apollox-vscode. Click install.

    3. Activate the extension: the Torizon icon will appear in the left menu bar. Click on it to activate the extension.

    4. Installing dependencies: during the first activation, the extension will check the necessary dependencies. If any missing dependencies are detected, the extension will attempt to install them and prompt you to enter your sudo user password.

    5. Accept the package installation.

    6. Install PowerShell: another terminal will open and try to install PowerShell. Enter your sudo user password.

Configure a Linux Host Machine​

Preparation Steps​

Before Installing the Torizon IDE Extension 2

Install Docker Engine​

As Docker Desktop is licensed under the Docker Subscription Service Agreement, we recommend using Docker Engine.

  1. Install necessary packages: before installing Docker Engine, install the following packages.

    $ sudo apt-get update

    $ sudo apt-get install -y \
    ssh\
    net-tools \
    gnome-keyring
  2. Install Docker Engine: The release of Docker provided by some distribution is not up to date. To be sure that you install docker in the correct way, chose the source for your distribution.

    Browse from one of those sources if you don't use any of these distributions. If you want to install from binaries, take a look at Install Docker Engine from binaries.

  3. Create the docker group: you will need to add your user to the docker group to allow you to run the Docker client without needing root privileges. In a new terminal, run the following commands.

    $ sudo groupadd docker
  4. Add your user to the docker group.

    $ sudo usermod -aG docker $USER
  5. Restart your PC.

Set up the Torizon IDE Extension 2 on Visual Studio Code​

  1. Uninstall previous versions: it is not recommended to have both IDE Extensions 1 and 2 installed in your VS Code simultaneously. If you have the V1 extension installed, please uninstall it before proceeding with the next steps.

  2. Install & Configure the IDE Extension 2.

    1. Click the Extensions icon from the left menu bar in Visual Studio Code.

    2. Search for toradex.apollox-vscode. Click install.

    3. Activate the extension: the Torizon icon will appear in the left menu bar. Click on it to activate the extension.

    4. Installing dependencies: during the first activation, the extension will check the necessary dependencies. If any missing dependencies are detected, the extension will attempt to install them and prompt you to enter your sudo user password.

    5. Accept the package installation.

    6. Install PowerShell: another terminal will open and try to install PowerShell. Enter your sudo user password.



Send Feedback!