Building a Cisco IOS XR Vagrant Libvirt Box
Cisco IOS XR is supported by the netlab libvirt package command. To build an IOS XR box:
Create an empty directory on a Ubuntu machine with libvirt and Vagrant.
Download IOS XR software and unpack the image archive to get the
qcow2
disk image (example:xrv9k-fullk9-x-7.4.2.qcow2
).Execute netlab libvirt package iosxr virtual-disk-file-name and follow the instructions.
Warning
If you’re using a netlab release older than 1.8.2, or if you’re using a Linux distribution other than Ubuntu, please read the box-building caveats first.
Initial Device Configuration
During the box-building process (inspired by this solution), you’ll have to copy-paste the initial device configuration. netlab libvirt config iosxr command displays the build recipe:
Creating initial configuration for IOS XR
=========================================
Don't despair, the system boot takes forever. After the boot is complete, the system
might displays the "Administrative User Dialog", in which case create root-system
username 'vagrant' with password 'vagrant'.
* Login with username 'vagrant' and password 'vagrant'
* Use 'config' to enter configuration mode and copy the following configuration:
-----------------------------------------
hostname xrv
domain name lab.local
!
aaa authorization exec default local
aaa authentication login default local
vrf MGMT
!
ssh server v2
ssh server logging
ssh server vrf MGMT
ssh server vrf default
ssh server netconf vrf MGMT
ssh server netconf vrf default
!
username vagrant
password vagrant
netconf agent tty
session timeout 5
!
netconf-yang agent
ssh
!
interface MgmtEth0/RP0/CPU0/0
no shutdown
vrf MGMT
ipv4 address dhcp
!
commit
-----------------------------------------
* Exit the configuration mode and disconnect from console (ctrl-] usually works).