vscode-containerlab

March 31, 2026 ยท View on GitHub

GitHub releases VS Code extension page Doc DeepWiki Bluesky Discord

A Visual Studio Code extension that integrates containerlab directly into your editor, providing a convenient tree view for managing labs and their containers.

screencast


Key Features

  • Auto-discovery & Tree View: Automatically find .clab.yml/.clab.yaml files in your workspace and display them in a tree view. Labs are color-coded based on container states:

    • Green: All containers running
    • Red: All containers stopped
    • Yellow: Mixed (partial deployment)
    • Gray: Undeployed labs
  • Context Menu Actions: For labs and containers, quickly deploy, destroy, redeploy (with or without cleanup), save, inspect, delete undeployed lab files, or open lab files and workspaces. For containers, additional commands include starting, stopping, attaching a shell, SSH, viewing logs, and copying key properties (name, ID, IP addresses, kind, image).

  • Interface Tools: Capture traffic (via tcpdump/Wireshark or Edgeshark) and set link impairments such as delay, jitter, packet loss, rate-limit, and corruption. You can also copy an interfaceโ€™s MAC address.

  • Graphing & Visualization: Generate network graphs in multiple modes, with the UI-first workflow in TopoViewer:

    • Interactive TopoViewer: Launches a dynamic, web-based topology UI (view/edit mode depends on lab state).
    • Draw.io (Horizontal): Generates a .drawio file in a horizontal layout. (pos labels override the layout.)
    • Draw.io (Vertical): Generates a .drawio file in a vertical layout. (pos labels override the layout.)
    • Draw.io (Interactive): Runs containerlab graph generation in interactive Draw.io mode.
  • Clone Labs from Git: Easily clone labs from any Git repository or choose from a list of popular labs directly within the extension.

  • Help & Feedback View: Access documentation, community links, and other helpful resources from a dedicated tree view.

  • Inspection: Use webviews to inspect either all labs or a single labโ€™s deployed containers in a neatly grouped table.

  • Remote Labs: Works perfectly with the: SSH-Remote extension to manage labs on remote servers.

  • Remote Topology URLs: Deploy labs directly from GitHub or GitLab by providing a repository or file URL when using the "Deploy an existing lab" command.


Requirements

  • containerlab must be installed. The extension will offer to install it if not found.

  • You must be in the clab_admins and docker group. Podman is not supported for runtime features.

  • (Optional) Edgeshark for packet capture features - can be installed directly from the extension using the "Install Edgeshark" command.

    Edgeshark Integration

    • Install Edgeshark: installs Edgeshark using docker compose

    • Uninstall Edgeshark: removes Edgeshark containers

    • Configure session hostname: set hostname for remote connections (packet capture)

    • If you want to live capture traffic using Wireshark, please download the cshargextcap plugin for the OS/distribution and install it.

Note: The extension will automatically prompt to add your user to the clab_admins group during setup to enable running containerlab commands without sudo.


Getting Started

  1. Install the extension.
  2. Open a folder or workspace in VS Code containing .clab.yml or .clab.yaml files. Or just clone a popular lab.
  3. Click on the Containerlab icon in the Activity Bar to view your labs.
  4. Right-click on a lab or container to see context menu commands (Deploy, Destroy, Redeploy, etc.).

Extension Settings

Configure the extension behavior through VS Code settings (containerlab.*):

๐Ÿš€ Core Settings

SettingTypeDefaultDescription
binaryPathstring""Custom path to containerlab binary (leave empty to resolve from PATH)
showWelcomePagebooleantrueShow welcome page on activation
skipUpdateCheckbooleanfalseSkip extension update check
skipCleanupWarningbooleanfalseSkip warning popups for cleanup commands

The Containerlab Explorer listens to the containerlab event stream, so running labs update live without manual refresh intervals.

๐ŸŽฏ Command Options

SettingTypeDefaultDescription
deploy.extraArgsstring""Additional args for deploy/redeploy commands
destroy.extraArgsstring""Additional args for destroy commands
extras.fcli.extraDockerArgsstring""Additional docker args for fcli commands

๐Ÿ–ฅ๏ธ Node Configuration

SettingTypeDefaultDescription
node.execCommandMappingobject{}Map node kind to exec command
Example: { "nokia_srlinux": "sr_cli" }
node.sshUserMappingobject{}Map node kind to SSH user
Example: { "nokia_srlinux": "clab" }
node.telnetPortnumber5000Port for telnet connections

๐ŸŽจ TopoViewer

SettingTypeDefaultDescription
editor.customNodesarraySee below*Custom node templates for TopoViewer
editor.updateLinkEndpointsOnKindChangebooleantrueAuto-update link endpoints on kind change
editor.lockLabByDefaultbooleantrueLock the lab canvas by default to prevent accidental edits
drawioDefaultThemestringnokia_modernDraw.io theme (nokia_modern, nokia, grafana)

*Default custom nodes include SRLinux and Network Multitool templates. They ship with sensible interface naming patterns (for example nokia_srlinux: "e1-{n}", cisco_xrd: "Gi0-0-0-{n}"). Patterns accept optional start indices ({n:0}), finite ranges ({n:1-6}), and comma-separated fallbacks (1/1/c{n:1-6}/1, 2/1/c{n:1-12}/1). Existing custom nodes without an Interface Pattern are automatically upgraded to use the defaults.

๐Ÿ“ฆ Packet Capture

SettingTypeDefaultDescription
capture.preferredActionstringWireshark VNCPreferred capture method (Edgeshark, Wireshark VNC)
capture.wireshark.dockerImagestringghcr.io/kaelemc/
wireshark-vnc-docker:latest
Docker image for Wireshark VNC
capture.wireshark.pullPolicystringalwaysImage pull policy (always, missing, never)
capture.wireshark.themestringFollow VS Code themeWireshark theme
capture.wireshark.stayOpenInBackgroundbooleantrueKeep sessions alive in background
capture.edgeshark.extraEnvironmentVarsstringHTTP_PROXY=,
http_proxy=
Environment variables for Edgeshark
capture.remoteHostnamestring""Hostname/IP for Edgeshark packet capture
capture.packetflixPortnumber5001Port for Packetflix endpoint (Edgeshark)

๐ŸŒ Lab Sharing

SettingTypeDefaultDescription
gotty.portnumber8080Port for GoTTY web terminal

Example Configuration

{
  "containerlab.deploy.extraArgs": "--timeout 5m --max-workers 88",
  "containerlab.destroy.extraArgs": "--graceful --cleanup",
  "containerlab.node.execCommandMapping": {
    "nokia_srlinux": "sr_cli",
    "arista_ceos": "Cli"
  },
  "containerlab.node.sshUserMapping": {
    "nokia_srlinux": "admin",
    "cisco_xrd": "clab"
  },
  "containerlab.editor.customNodes": [
    {
      "name": "SRLinux Latest",
      "kind": "nokia_srlinux",
      "interfacePattern": "e1-{n}"
    }
  ]
}

Monitor Deployment Progress

When deploying labs, you can monitor the detailed progress in the Output window:

  1. Open the Output panel (Ctrl+Shift+U or View -> Output)
  2. Select "Containerlab" from the dropdown menu
  3. Watch the deployment logs in real-time

Live Updates

  • The Containerlab Explorer streams containerlab events, so running labs refresh immediately without polling
  • Labs are consistently sorted:
    • Deployed labs appear before undeployed labs
    • Within each group (deployed/undeployed), labs are sorted by their absolute path

Known Issues

"I do not see any interfaces on my deployed lab"

Labs deployed with containerlab versions older than 0.64.0 may require a redeploy.

Running Tests

The extension includes a suite of unit tests located in the test folder. To run them:

  1. Install dependencies with npm install if you haven't already.
  2. Compile the test TypeScript using npm run test:compile.
  3. Execute npm test to run Mocha and generate an HTML report in mochawesome-report.

See test/README.md for a short overview of the test setup and stub utilities.


UI Dependency Mode

By default, this repository consumes the published @srl-labs/clab-ui package from GitHub Packages after npm install.

This is the default path for normal development, CI, and packaging.

If you are working in a sibling checkout with clab-ui and want to test local unpublished UI changes, opt in explicitly:

CLAB_UI_SOURCE=local npm run build
CLAB_UI_SOURCE=local npm run package

Convenience scripts are also available:

npm run build:local-ui
npm run package:local-ui

The local override resolves against ../clab-ui/dist, so make sure that the package repo is built before running the local override scripts.

The local override affects only bundling/runtime resolution. The default install path remains the published npm package.


Feedback and Contributions

If youโ€™d like to request features or report issues:

  • Open an issue on our GitHub repository.

  • PRs are welcome! Let us know how we can improve the extension.

  • GitHub Issues: Create an issue on GitHub.

  • Discord: Join our Discord community

Enjoy managing your containerlab topologies directly from VS Code!