A Visual Studio Code extension that integrates containerlab directly into your editor, providing a convenient tree view for managing labs and their containers.
- Auto-discovery of local
*.clab.yml
or*.clab.yaml
files in your workspace. - Tree view showing labs (green/red/gray/yellow icons) based on container states:
- Green: all containers in the lab are running
- Gray: undeployed (no containers found)
- Red: all containers are stopped
- Yellow: partially running (some containers running, others stopped)
- Right-click context menus on labs:
- Deploy, Destroy, Redeploy (with or without cleanup)
- Open Lab File, Copy Lab File Path
- Graph topologies (local Web or draw.io modes)
- Inspect single lab
- Add Lab to Workspace
- Open Folder in New Window
- Right-click context menus on containers:
- Start, Stop
- Attach shell (with user-defined exec commands per node kind)
- SSH
- View logs
- Copy submenu for container properties:
- Name, ID, IPv4, IPv6, Kind, Image
- Right-click context menus on interfaces:
- Capture interface: starts packet capture using tcpdump/Wireshark
- Capture interface (Edgeshark): uses Edgeshark/packetflix
- Set delay: configure link delay
- Set jitter: configure link jitter
- Set packet loss: configure packet loss percentage
- Set rate-limit: configure egress rate-limit
- Set corruption: configure packet corruption percentage
- Copy MAC address: copy interface MAC address
- Inspect commands:
- Inspect (All Labs): shows a webview with all labs in a grouped table
- Inspect Lab: show only the selected lab’s containers in a webview
- Graph:
- Graph Lab (Web): runs
containerlab graph
in a Terminal - Graph Lab (draw.io): runs
containerlab graph --drawio
, then opens the.drawio
file - Graph Lab (draw.io, Interactive): runs in Terminal with in interactive mode
- Graph Lab (Topoviewer): interactive, web-based interface for visualizing Containerlab topologies
- Graph Lab (Web): runs
- containerlab must be installed and accessible in your system
PATH
. The extension will offer to install it if not found. - (Optional) Edgeshark for packet capture features - can be installed directly from the extension using the "Install Edgeshark" command.
Note: The extension will automatically prompt to add your user to the clab_admins
group during setup to enable running containerlab commands without sudo.
- Install the extension.
- Open a folder or workspace in VS Code containing
.clab.yml
or.clab.yaml
files. - Click on the Containerlab icon in the Activity Bar to view your labs.
- Right-click on a lab or container to see context menu commands (Deploy, Destroy, Redeploy, etc.).
These are some key commands contributed by the extension:
- Deploy / Deploy (cleanup)
- Redeploy / Redeploy (cleanup)
- Destroy / Destroy (cleanup)
- Deploy lab file (choose a
.clab.yml/.yaml
from a file picker)
- Inspect (All Labs): Summaries all labs in one webview
- Inspect Lab: Summaries the containers for a single lab
- Graph Lab (Web): runs in Terminal
- Graph Lab (draw.io): uses a spinner and opens the
.drawio
file - Graph Lab (draw.io, Interactive): same but with additional
--drawio-args "-I"
. - Graph Lab (Topoviewer): interactive, web-based visualization
- Start node, Stop node
- Attach shell (exec into container—respects
containerlab.node.execCommandMapping
in settings) - SSH
- View logs (tails
docker logs -f ...
) - Copy menu (Name, ID, IPv4, IPv6, Kind, Image)
- Capture interface: starts packet capture on an interface using tcpdump/Wireshark
- Capture interface (Edgeshark): uses Edgeshark/packetflix for packet capture
- Set delay: configure link delay for an interface
- Set jitter: configure link jitter for an interface
- Set packet loss: configure packet loss percentage for an interface
- Set rate-limit: configure egress rate-limit for an interface
- Set corruption: configure packet corruption percentage for an interface
- Copy MAC address: copy interface MAC address to clipboard
- Install Edgeshark: installs Edgeshark using docker compose
- Uninstall Edgeshark: removes Edgeshark containers
- Configure session hostname: set hostname for remote connections (packet capture)
- Add Lab to Workspace: adds the lab’s folder to the current VS Code workspace
- Open Folder in New Window: opens a separate VS Code window rooted at the lab’s folder
All these commands are accessible via:
- Context menus on labs/containers (in the Containerlab Explorer)
- Editor title (top-right) when editing a
.clab.(yml|yaml)
- Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
, then type “Containerlab:”)
You can customize the following settings under containerlab.*
:
-
containerlab.defaultSshUser
(string)
Default SSH user for the SSH command (e.g."admin"
). -
containerlab.sudoEnabledByDefault
(boolean)
Whether to prependsudo
to containerlab commands. Default:true
. -
containerlab.refreshInterval
(number)
How often (in ms) the Containerlab Explorer refreshes. Default:10000
. -
containerlab.node.execCommandMapping
(object)
Mapping of nodekind
to the exec command used by Attach shell.
For example, if you have"nokia_srlinux": "sr_cli"
, thendocker exec -it <container> sr_cli
is used. -
containerlab.wsl.wiresharkPath
(string)
The path to Wireshark executable on Windows from inside WSL.
Default:/mnt/c/Program Files/Wireshark/wireshark.exe
-
containerlab.remote.hostname
(string)
The hostname to use for connections to/from this host. Can be either DNS resolvable hostname, or an IPv4/6 address.
Used for packet capture features.
Note: A configured hostname for this session of VS Code takes precedence. -
containerlab.drawioDefaultTheme
(string)
Default theme to use when generating DrawIO graphs.
Options:nokia_modern
,nokia
,grafana
Default:nokia_modern
When deploying labs, you can monitor the detailed progress in the Output window:
- Open the Output panel (
Ctrl+Shift+U
orView -> Output
) - Select "Containerlab" from the dropdown menu
- Watch the deployment logs in real-time
- The Containerlab Explorer automatically refreshes based on the
containerlab.refreshInterval
setting - Labs are consistently sorted:
- Deployed labs appear before undeployed labs
- Within each group (deployed/undeployed), labs are sorted by their absolute path
If you see this error message despite having containerlab correctly installed, there are two common causes:
- GitHub API Rate Limiting
- The version check makes API calls to GitHub to compare versions
- Without authentication, these calls are subject to rate limiting
- Solution: Set your GitHub token as an environment variable:
export GITHUB_TOKEN=your_github_token_here
- Sudo Permission Configuration
- The extension tries to run 'sudo containerlab version check'
- This requires passwordless sudo access for the containerlab command
- Solution: Configure passwordless sudo specifically for containerlab:
# Replace <user> with your actual username, e.g., john
sudo visudo -f /etc/sudoers.d/<user>
Add this line in the editor (replace with your username):
<user> ALL=(ALL) NOPASSWD: /usr/bin/containerlab
Note: Future versions of the extension will improve handling of these scenarios to provide a better user experience.
Labs which are deployed with containerlab < 0.64.0 , needing a redeploy.
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!