Containerlab is rapidly emerging as a viable solution on macOS, thanks to the increasing availability of ARM64-based NOS container images. The following Containerlab kinds work excellent with macOS on Apple Silicon:
Prerequisites
- Mac computer with Apple silicon
- macOS 13.0 or later
- Git
Steps
Download OrbStack and open it.
Open your favorite terminal emulator.
We will work from the command line for the following steps.
- Change to the
Documents
directory.
cd ~/Documents
- Clone the containerlab-orbstack repo from GitHub.
git clone https://github.com/mweisel/containerlab-orbstack.git
- Change to the
containerlab-orbstack
directory.
cd container-orbstack
- Create a Python virtual environment for Ansible.
source init_venv.sh
- Verify Ansible is installed.
ansible --version
- Start OrbStack (if not already started).
orb status || orb start
- Create the
clab
Linux machine.
orb create ubuntu:noble clab
- Verify the
clab
Linux machine is listed and in arunning
state.
orb list
output:
NAME STATE DISTRO VERSION ARCH
---- ----- ------ ------- ----
clab running ubuntu noble arm64
- Test Ansible connectivity to the
clab
Linux machine.
ansible all -m ping
output:
clab@orb | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python3.12"
},
"changed": false,
"ping": "pong"
}
- Deploy the server.
ansible-playbook server.yml
The automated process should take less than a few minutes to complete.
- Verify the installation of the components.
orb -m clab -s 'containerlab version && docker version && gh version && go version'
- Deactivate the Python virtual environment.
deactivate
Lab
- Log in to the
clab
Linux machine.
orb -m clab
- Change to the
srl01
directory.
cd ~/labs/srl01
- Deploy the lab.
clab deploy
output:
INFO[0000] Containerlab v0.64.0 started
INFO[0000] Parsing & checking topology file: srl01.clab.yml
INFO[0000] Creating docker network: Name="clab", IPv4Subnet="172.20.20.0/24", IPv6Subnet="3fff:172:20:20::/64", MTU=1500
INFO[0000] Pulling ghcr.io/nokia/srlinux:24.10.2-357-arm64 Docker image
INFO[0031] Done pulling ghcr.io/nokia/srlinux:24.10.2-357-arm64
INFO[0031] Creating lab directory: /home/marc/labs/srl01/clab-srl01
INFO[0031] Creating container: "srl"
INFO[0033] Running postdeploy actions for Nokia SR Linux 'srl' node
INFO[0040] Adding containerlab host entries to /etc/hosts file
INFO[0040] Adding ssh config for containerlab nodes
╭────────────────┬─────────────────────────────────────────┬─────────┬───────────────────╮
│ Name │ Kind/Image │ State │ IPv4/6 Address │
├────────────────┼─────────────────────────────────────────┼─────────┼───────────────────┤
│ clab-srl01-srl │ nokia_srlinux │ running │ 172.20.20.2 │
│ │ ghcr.io/nokia/srlinux:24.10.2-357-arm64 │ │ 3fff:172:20:20::2 │
╰────────────────┴─────────────────────────────────────────┴─────────┴───────────────────╯
- Test SSH connectivity to the
mgmt0.0
interface of theclab-srl01-srl
node.
ssh clab-srl01-srl show version
- Destroy the lab.
clab destroy -c