How to use Workshop from VS Code

The Workshop extension for Visual Studio Code connects a VS Code window to a running Workshop environment. The editor, terminal, and debugger run inside the container, while the window stays on the host. Workshop provides the Zephyr SDKs and toolchains inside the development environment. Each developer gets the same base and SDK channel, and VS Code keeps IDE features such as code completion and debugging.

Prerequisites

Before starting, ensure you have these requirements satisfied:

The extension uses the Remote - SSH extension, which VS Code installs automatically as a dependency.

Install the extension

Install the Workshop extension published by Canonical from the Extensions view or from the command line:

$ code --install-extension canonical.workshop
Installing extensions...
Installing extension 'canonical.workshop'...
Extension 'canonical.workshop' v0.5.2 was successfully installed.

Open the project in the Workshop

Open the project folder in VS Code. The folder must contain .workshop/zephyr-26-04.yaml, and the Workshop must be launched:

$ workshop launch zephyr-26-04
$ code .

A Workshop panel appears in the Activity Bar. It lists the Workshops defined for the project.

Click Reopen in Workshop next to your Workshop in the panel, or run Workshop: Reopen in Workshop from the Command Palette. VS Code reconnects the window inside the container.

The remote indicator in the status bar shows the Workshop name when the window is connected.

Verify the connection

Open an integrated terminal with Terminal ‣ New Terminal. The prompt shows a shell inside the Workshop:

workshop@zephyr-26-04:/project$

Build and run the Hello World sample to confirm that the toolchain is available:

workshop@zephyr-26-04:/project$ west build -p always \
    -b qemu_x86 zephyr/samples/hello_world
workshop@zephyr-26-04:/project$ west build -t run

The terminal prints the Zephyr boot banner and the Hello World! message. The window now uses the SDKs and toolchains installed in the Workshop instead of the tools on the host.

Return to the local window

To close the connection without stopping the Workshop, click Reopen Locally in the Workshop panel or in the remote indicator in the status bar.

The Workshop keeps running after you return to the local window. Stop it from the host when you no longer need it:

$ workshop stop zephyr-26-04

Allow the extension in untrusted workspaces

When VS Code opens a folder in Restricted Mode, it disables most extensions, including this one. The Workshop panel cannot reconnect or reopen locally in an untrusted workspace.

To allow the extension to run in untrusted workspaces, add the following to your user settings.json (Ctrl+Shift+P, then Preferences: Open User Settings (JSON)):

{
  "extensions.supportUntrustedWorkspaces": {
    "canonical.workshop": {
      "supported": true
    }
  }
}

The Workshop panel stays active in Restricted Mode, so you can open the project in a Workshop sandbox while the host treats the workspace as untrusted.

See also

Tutorial:

How-to:

Reference: