Torizon IDE/WSL error

Hi,
yesterday I did a fresh install of VSCode and Torizon IDE 3.4.2 on Win 11 Pro. After the installation process all was running fine. Today I get this error in Torizon WSL distro:

subprocess.CalledProcessError: Command ‘[’/usr/sbin/service’, ‘docker’, ‘status’]’ returned non-zero exit status 3.

The distro exits immediatly.
One of collegues did a fresh installation and runs into the same problem.
How can we fix it?

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Based on the error you’re encountering with the Torizon WSL 2 distro, this appears to be a known issue that has been documented and resolved.

Fix for WSL 2 Boot Issue

If you’re experiencing the WSL distro exiting immediately with Docker service errors, there’s a specific fix available (1):

Run the following command in a Windows terminal:

wsl sudo -E /opt/updater/updater.ps1 -User <distro_user>

Where <distro_user> must be the login name that you registered on your Torizon Development Environment for WSL 2 distro (1). This should resolve the issue.

Additional Troubleshooting Steps

If the above fix doesn’t resolve the problem, here are some additional steps to try:

1. Verify Docker Installation

Ensure you have Docker Engine properly installed in WSL 2 (2)(3):

  • Open a WSL terminal by running the wsl command in a PowerShell terminal (2)(3)
  • Follow the Docker Engine installation instructions for your specific Linux distribution installed with WSL (2)(3)
  • Set up Docker to run without root privileges (2)(3)

2. Check WSL 2 Configuration

Verify your WSL 2 setup (2)(3):

  • Ensure you’re running WSL 2 (not WSL 1) (2)(3)
  • Check which version of WSL you are running (2)(3)
  • If WSL 1 is installed, upgrade to WSL 2 (2)(3)

3. Docker Engine vs Docker Desktop

Make sure you only have Docker Engine installed in WSL 2, not Docker Desktop (4). Having both can cause conflicts with the Torizon IDE Extension.

The Torizon IDE team recommends using Docker Engine over Docker Desktop since Docker Desktop is licensed under the Docker Subscription Service Agreement, while Docker Engine is licensed under the Apache License, Version 2.0 (2)(3).

Prevention

To avoid similar issues in the future, always use the Installation Wizard for setting up the Torizon IDE Extension on Windows, as manual installation is not officially supported or tested by the Torizon IDE team (2).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI
I used the Installation Wizard.

The WSL 2 Boot Issue command returns:
sudo: /opt/updater/updater.ps1: command not found

I understand you used the Installation Wizard. Since the updater command isn’t found, let’s try a different approach to resolve the Docker service issue.

Alternative Solutions

1. Manual Docker Service Start

Try starting the Docker service manually in your WSL 2 environment:

sudo service docker start

2. Reinstall the Torizon WSL 2 Environment

Since you’re encountering this issue right after installation, you may need to reinstall the Torizon Development Environment for WSL 2 through the VS Code extension:

  1. Open Visual Studio Code
  2. Access the Torizon IDE Extension
  3. Try reinstalling the WSL 2 environment through the extension interface

3. Verify WSL 2 and Docker Setup

Let’s ensure your environment is properly configured (1):

  1. Check WSL version: Open a PowerShell terminal and run:

    wsl --list --verbose
    
  2. Verify Docker Engine installation: Open your WSL terminal and check if Docker is installed:

    docker --version
    
  3. Check Docker daemon status:

    sudo service docker status
    

4. Docker Engine Installation

If Docker isn’t properly installed, you’ll need to install Docker Engine in WSL (1)(2):

  1. Open a WSL terminal by running the wsl command in a PowerShell terminal (1)(2)
  2. Install Docker Engine following the instructions for your specific Linux distribution installed with WSL (1)(2)
  3. Set up Docker to run without root privileges (1)(2)

5. Check for Installation Issues

Based on similar reported issues (3), there might be problems with paths containing spaces in your Windows username. If your Windows username contains spaces (like “MY PC”), this could cause installation problems with the Torizon WSL 2 environment.

Next Steps

If these steps don’t resolve the issue, please let me know:

  • What’s your Windows username (does it contain spaces?)
  • The output of wsl --list --verbose
  • The output of docker --version from within WSL

This will help us identify the root cause of the Docker service issue.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI

This fixed it: In windows terminal, I enter this command:
wsl sudo service docker start

Great! I’m glad that resolved the Docker service issue.

What You Fixed

You successfully started the Docker service in WSL 2 by running:

wsl sudo service docker start

This command starts the Docker daemon directly in your WSL 2 environment, which was the root cause of the error you were encountering.

Why This Happened

The Docker service wasn’t automatically starting when the WSL 2 distro loaded, which caused the subprocess.CalledProcessError when the Torizon IDE Extension tried to check the Docker service status.

Making This Permanent

To prevent this issue from recurring, you may want to ensure Docker starts automatically. The Torizon documentation recommends properly setting up Docker to run without root privileges(1)(2), which typically includes configuring the service to start automatically.

Next Steps

Now that Docker is running, you should be able to:

  • Use the Torizon IDE Extension normally
  • Create new Torizon projects(3)
  • Deploy and debug applications on your target device

If you encounter this issue again after restarting your system, you can use the same command to start Docker manually, or investigate why the Docker service isn’t starting automatically in your WSL 2 environment.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.