{"id":25690161,"url":"https://github.com/mweisel/cisco-iosxrv-vagrant-libvirt","last_synced_at":"2025-02-24T22:16:35.590Z","repository":{"id":229240630,"uuid":"230986933","full_name":"mweisel/cisco-iosxrv-vagrant-libvirt","owner":"mweisel","description":"A procedure for creating a Cisco IOS XRv Vagrant box for the libvirt provider.","archived":false,"fork":false,"pushed_at":"2021-05-23T19:38:51.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-22T23:46:50.431Z","etag":null,"topics":["cisco-ios-xr","libvirt-provider","vagrant-box"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mweisel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-12-30T22:15:41.000Z","updated_at":"2024-03-22T23:46:52.818Z","dependencies_parsed_at":"2024-03-22T23:46:52.557Z","dependency_job_id":"0efd5af9-0cce-4a6b-9237-3136ef622007","html_url":"https://github.com/mweisel/cisco-iosxrv-vagrant-libvirt","commit_stats":null,"previous_names":["mweisel/cisco-iosxrv-vagrant-libvirt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mweisel%2Fcisco-iosxrv-vagrant-libvirt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mweisel%2Fcisco-iosxrv-vagrant-libvirt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mweisel%2Fcisco-iosxrv-vagrant-libvirt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mweisel%2Fcisco-iosxrv-vagrant-libvirt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mweisel","download_url":"https://codeload.github.com/mweisel/cisco-iosxrv-vagrant-libvirt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240564597,"owners_count":19821422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cisco-ios-xr","libvirt-provider","vagrant-box"],"created_at":"2025-02-24T22:16:34.989Z","updated_at":"2025-02-24T22:16:35.582Z","avatar_url":"https://github.com/mweisel.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg alt=\"Vagrant\" src=\"https://img.shields.io/badge/vagrant%20-%231563FF.svg?\u0026style=for-the-badge\u0026logo=vagrant\u0026logoColor=white\"/\u003e\n\n# Cisco IOS XRv Vagrant box\n\nA procedure for creating a Cisco IOS XRv Vagrant box for the [libvirt](https://libvirt.org) provider.\n\n## Prerequisites\n\n  * [Cisco Modeling Labs - Personal](https://learningnetworkstore.cisco.com/cisco-modeling-labs-personal) subscription\n  * [Git](https://git-scm.com)\n  * [Python](https://www.python.org)\n  * [Ansible](https://docs.ansible.com/ansible/latest/index.html) \u003e= 2.7\n  * [libvirt](https://libvirt.org) with client tools\n  * [QEMU](https://www.qemu.org)\n  * [Expect](https://en.wikipedia.org/wiki/Expect)\n  * [sshpass](https://linux.die.net/man/1/sshpass)\n  * [Telnet](https://en.wikipedia.org/wiki/Telnet)\n  * [Vagrant](https://www.vagrantup.com) \u003e= 2.2.10\n  * [vagrant-libvirt](https://github.com/vagrant-libvirt/vagrant-libvirt)\n\n\u003e Vagrant version **2.2.16** introduced a bug that *breaks* SSH connectivity - [#12344](https://github.com/hashicorp/vagrant/issues/12344)\n\n## Steps\n\n0\\. Verify the prerequisite tools are installed.\n\n\u003cpre\u003e\n$ \u003cb\u003ewhich git python ansible libvirtd virsh qemu-system-x86_64 expect sshpass telnet vagrant\u003c/b\u003e\n$ \u003cb\u003evagrant plugin list\u003c/b\u003e\nvagrant-libvirt (0.4.1, global)\n\u003c/pre\u003e\n\n1\\. Log in and download the CML-P reference platform ISO file to your `Downloads` directory.\n\n2\\. Create a mount point directory.\n\n\u003cpre\u003e\n$ \u003cb\u003esudo mkdir -p /mnt/iso\u003c/b\u003e\n\u003c/pre\u003e\n\n3\\. Mount the ISO file.\n\n\u003cpre\u003e\n$ \u003cb\u003ecd $HOME/Downloads\u003c/b\u003e\n$ \u003cb\u003esudo mount -o loop refplat-20201110-fcs.iso /mnt/iso\u003c/b\u003e\n\u003c/pre\u003e\n\n4\\. Copy (and rename) the Cisco IOS XRv disk image file to the `/var/lib/libvirt/images` directory.\n\n\u003cpre\u003e\n$ \u003cb\u003esudo cp /mnt/iso/virl-base-images/iosxrv-6-3-1/iosxrv-k9-demo-6.3.1.qcow2 /var/lib/libvirt/images/cisco-iosxrv.qcow2\u003c/b\u003e\n\u003c/pre\u003e\n\n5\\. Unmount the ISO file.\n\n\u003cpre\u003e\n$ \u003cb\u003esudo umount /mnt/iso\u003c/b\u003e\n\u003c/pre\u003e\n\n6\\. Modify the file ownership and permissions. Note the owner may differ between Linux distributions.\n\n\u003e Ubuntu 18.04\n\n\u003cpre\u003e\n$ \u003cb\u003esudo chown libvirt-qemu:kvm /var/lib/libvirt/images/cisco-iosxrv.qcow2\u003c/b\u003e\n$ \u003cb\u003esudo chmod u+x /var/lib/libvirt/images/cisco-iosxrv.qcow2\u003c/b\u003e\n\u003c/pre\u003e\n\n\u003e Arch Linux\n\n\u003cpre\u003e\n$ \u003cb\u003esudo chown nobody:kvm /var/lib/libvirt/images/cisco-iosxrv.qcow2\u003c/b\u003e\n$ \u003cb\u003esudo chmod u+x /var/lib/libvirt/images/cisco-iosxrv.qcow2\u003c/b\u003e\n\u003c/pre\u003e\n\n7\\. Create the `boxes` directory.\n\n\u003cpre\u003e\n$ \u003cb\u003emkdir -p $HOME/boxes\u003c/b\u003e\n\u003c/pre\u003e\n\n8\\. Start the `vagrant-libvirt` network (if not already started).\n\n\u003cpre\u003e\n$ \u003cb\u003evirsh -c qemu:///system net-list\u003c/b\u003e\n$ \u003cb\u003evirsh -c qemu:///system net-start vagrant-libvirt\u003c/b\u003e\n\u003c/pre\u003e\n\n9\\. Clone this GitHub repo and _cd_ into the directory.\n\n\u003cpre\u003e\n$ \u003cb\u003egit clone https://github.com/mweisel/cisco-iosxrv-vagrant-libvirt\u003c/b\u003e\n$ \u003cb\u003ecd cisco-iosxrv-vagrant-libvirt\u003c/b\u003e\n\u003c/pre\u003e\n\n10\\. Run the Ansible playbook.\n\n\u003cpre\u003e\n$ \u003cb\u003eansible-playbook main.yml\u003c/b\u003e\n\u003c/pre\u003e\n\n11\\. Copy (and rename) the Vagrant box artifact to the `boxes` directory.\n\n\u003cpre\u003e\n$ \u003cb\u003ecp cisco-iosxrv.box $HOME/boxes/cisco-iosxrv-631.box\u003c/b\u003e\n\u003c/pre\u003e\n\n12\\. Copy the box metadata file to the `boxes` directory.\n\n\u003cpre\u003e\n$ \u003cb\u003ecp ./files/cisco-iosxrv.json $HOME/boxes/\u003c/b\u003e\n\u003c/pre\u003e\n\n13\\. Change the current working directory to `boxes`.\n\n\u003cpre\u003e\n$ \u003cb\u003ecd $HOME/boxes\u003c/b\u003e\n\u003c/pre\u003e\n\n14\\. Substitute the `HOME` placeholder string in the box metadata file.\n\n\u003cpre\u003e\n$ \u003cb\u003eawk '/url/{gsub(/^ */,\"\");print}' cisco-iosxrv.json\u003c/b\u003e\n\"url\": \"file://\u003cb\u003eHOME\u003c/b\u003e/boxes/cisco-iosxrv-631.box\"\n\n$ \u003cb\u003esed -i \"s|HOME|${HOME}|\" cisco-iosxrv.json\u003c/b\u003e\n\n$ \u003cb\u003eawk '/url/{gsub(/^ */,\"\");print}' cisco-iosxrv.json\u003c/b\u003e\n\"url\": \"file://\u003cb\u003e/home/marc\u003c/b\u003e/boxes/cisco-iosxrv-631.box\"\n\u003c/pre\u003e\n\n15\\. Add the Vagrant box to the local inventory.\n\n\u003cpre\u003e\n$ \u003cb\u003evagrant box add cisco-iosxrv.json\u003c/b\u003e\n\u003c/pre\u003e\n\n## Debug\n\nView the telnet session output for the `expect` task:\n\n\u003cpre\u003e\n$ \u003cb\u003etail -f ~/iosxrv-console.explog\u003c/b\u003e\n\u003c/pre\u003e\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmweisel%2Fcisco-iosxrv-vagrant-libvirt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmweisel%2Fcisco-iosxrv-vagrant-libvirt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmweisel%2Fcisco-iosxrv-vagrant-libvirt/lists"}