A procedure for creating a Cisco Catalyst 8000V Vagrant box for the libvirt provider.
- Cisco Modeling Labs subscription
- Git
- uv
- libvirt with client tools
- QEMU
- Vagrant >= 2.4.0
- vagrant-libvirt
- unzip
- Expect
- Telnet
0. Verify the prerequisite tools are installed.
which git uv unzip libvirtd virsh qemu-system-x86_64 expect telnet vagrant
vagrant plugin list
1. Point your web browser to the CML Software Download page.
2. Click the Download icon for the Cisco Modeling Labs reference platform ISO file (June 2025).
3. Save the refplat-20250616-fcs-iso.zip file to your Downloads folder.
4. Open your favorite terminal emulator, and change to the Downloads directory.
cd ~/Downloads
5. Create the cml29-refplat directory.
mkdir -p cml29-refplat
6. Uncompress the refplat-20250616-fcs-iso.zip file into the cml29-refplatdirectory.
unzip refplat-20250616-fcs-iso.zip -d cml29-refplat
7. Change to the cml29-refplat directory.
cd cml29-refplat
8. Create a mount point directory.
sudo mkdir -p /mnt/iso
9. Mount the ISO file.
sudo mount -o loop refplat-20250616-fcs.iso /mnt/iso
10. Copy (and rename) the disk image file to the /var/lib/libvirt/images directory.
sudo cp /mnt/iso/virl-base-images/cat8000v-17-16-01a/c8000v-universalk9_8G_serial.17.16.01a.qcow2 /var/lib/libvirt/images/cisco-cat8kv.qcow2
11. Unmount the ISO file.
sudo umount /mnt/iso
12. Modify the file ownership.
The owner and/or group will differ between Linux distributions.
sudo chown libvirt-qemu:libvirt-qemu /var/lib/libvirt/images/cisco-cat8kv.qcow2
13. Set the file as executable.
sudo chmod u+x /var/lib/libvirt/images/cisco-cat8kv.qcow2
14. Create the boxes directory.
mkdir -p ~/boxes
15. Start the default network (if not already started).
virsh -c qemu:///system net-start default
16. Clone this GitHub repo and cd into the directory.
git clone https://github.com/mweisel/cisco-catalyst-8kv-vagrant-libvirt && cd cisco-catalyst-8kv-vagrant-libvirt
17. Create a Python virtual environment for Ansible.
uv sync
18. Run the Ansible playbook.
uv run ansible-playbook main.yml
19. Copy (and rename) the Vagrant box artifact to the boxes directory.
cp cisco-cat8kv.box ~/boxes/cisco-cat8000v-17.16.01a.box
20. Copy the box metadata file to the boxes directory.
cp ./files/cisco-cat8000v.json ~/boxes/
21. Change the current working directory to boxes.
cd ~/boxes
22. Substitute the HOME placeholder string in the box metadata file.
sed -i "s|HOME|${HOME}|" cisco-cat8000v.json
awk '/url/{gsub(/^ */,"");print}' cisco-cat8000v.json
output:
"url": "file:///home/marc/boxes/cisco-cat8000v-17.16.01a.box"
23. Add the Vagrant box to the local inventory.
vagrant box add cisco-cat8000v.json
To view the telnet session output for the expect task:
tail -f ~/cat8kv-console.explog
This project is licensed under the MIT License - see the LICENSE file for details