The better part of a year ago when the Cisco CSR1000V was publicly released, I quickly tested the notion of running the Cloud Services Router in VMWare Fusion on the Mac, rather than on a full vSphere server. Since then, I occasionally see that some readers land on my blog after searching for the terms “CSR1000V GNS3” looking for assistance in integrating the CSR with the popular networking simulation platform. The CSR1000V is attractive as it provides a means to run IOS-XE, the same variant as on the ASR-series routers, and unlike Dynamips, Cisco has blessed use of the CSR with the 2.5 Mb/s throughput-limited trial license as a legitimate labbing platform. Last night I decided to see if it could be done. Turns out, it’s easy.
Download the Image
The key to running the CSR1000V in GNS3 is running it in VirtualBox. Well, OK, perhaps it’s possible to get it going with QEMU as I also noticed in the release notes for the 3.11 release that Linux KVM is a supported hypervisor now, but VirtualBox seemed the path of lesser resistance to me so that’s the way I went. In order to install the CSR in a non-VMWare environment, you need to download the ISO install image rather than the OVA. I simply went to Cisco’s site, logged in (even a guest-level account should be able to access this download) and found the current version of the CSR (3.11 as of this writing) in the downloads section. Make sure you pick the ISO.
Save the ISO locally, and you’re ready to build a router.
Build the CSR in VirtualBox
I expected installing the CSR to a VirtualBox VM to be a serious pain. It turns out with the current version, it’s really quite trivial. In some cursory investigation, I found this blog article which suggests that the CSR’s flexibility only came around in the 3.10 release. I didn’t go back and try this with the 3.9 release to see, so that may well be true. Anyway, if you haven’t already, install Oracle VirtualBox. I should note that I did all this on a Windows machine as I feel that is actually the best platform for GNS3 these days — or at least it’s the one that in my experience requires the least fiddling to get all the extra bits working. I’m sure this can be done on Mac OS X or Linux but I’ve always had trouble getting GNS3 and VirtualBox both working nicely with each other on any platform besides Windows. YMMV. The VM settings for the CSR are very straight-forward:
OS: Other Linux (64-bit)
RAM: 2560-4096 MB (as of 3.10, a minimum of 2.5 GB is supported for basic operation)
Hard Disk: 8GB IDE
Important: Serial Ports: Enable Serial port 1, but you can leave it in Disconnected port state for now.
Just about everything else can be left to defaults. In the screenshot below you’ll see that I added additional NICs, but this wasn’t necessary. GNS3 will handle this for us later.
Set the CD-ROM to use the install ISO image, and boot the VM. During the first boot, the CSR will install itself to the hard drive:
After the install is complete, it will reboot itself. If you wait for it to reboot you will eventually get to the familiar IOS boot messages and a “Router>” prompt. You can power down the VM at this point, and remove the ISO from the CD configuration of the VM. Note that if you want multiple CSRs in your lab, you will need to create multiple VMs. You could either create them individually, or use the “Clone” function within VirtualBox. If you clone them, just make sure to select the option to generate new MAC addresses for the interfaces. Cloning the CSR through VirtualBox does correctly result in the clone router generating a new UDI/serial number on its next boot. Make no mistake that even with the somewhat reduced RAM requirement for the CSR with version 3.10 and later, running more than a couple of these will require a pretty beefy machine. My Windows laptop has 8 GB of RAM, and I can basically run two CSRs with 3 GB of RAM allocated before I’m maxing out my host’s RAM.
Adding the serial port (even without connecting it) was important here as I discovered that without the serial port, the GRUB boot loader hangs at a “press any key to continue” prompt pretty much indefinitely. It appears to be a bug related to serial console setups, and I found that by just making sure the VM actually has a serial port present, the “press any key” prompts appear 10 times over 10 seconds and then the normal GRUB boot menu appears and auto-boots within another second or two.
Add the CSR to GNS3
Now we’re getting somewhere. Once you have a CSR (or several) built in VirtualBox, fire up GNS3. Go to Edit > Preferences:
In the preferences dialog box, go to the VirtualBox section. In the “General Settings” tab, hit the “Test Settings” button to ensure the GNS3 vboxwrapper program has found your VirtualBox implementation. When it’s happy, click over to the “VirtualBox Guest” tab. Here, you can start defining one of your CSR instances, but it won’t appear in the dropdown until you click the “Refresh VM List” button:
Then, your CSR will appear in the “VM List” dropdown and you can select it:
Tweak a few more settings, like giving it several interfaces. Uncheck the “Reserve first NIC for NAT to Host OS.” Also, make sure “Enable Console Support” is selected, or else you’ll run into the GRUB issue I described in the previous section. Also, we want it for serial console access:
When you click the “Save” button here, your CSR VM will show up in the list of available VirtualBox VMs. Now, you can OK your way out and proceed to build your topology. When you drag the VirtualBox Guest object onto the GNS3 workspace, it will prompt you to pick which VM you are deploying. Select one of your CSR instances:
The CSR will appear as a “computer” icon in GNS3, but you can always right-click on the object and change the symbol to something that looks like a router. Then you can add your connections like normal. I always choose “Manual” connections in GNS3 because otherwise it tends to pick strange port pairs.
Now you can click the “Play” button to launch your simulation. My CSR was hooked up to a normal 7200 Dynamips image in this case. After they both booted, I started to configure. In order to get useful console access to the CSR and not be stuck configuring it from a no-history, fixed-width VM console window, we want to redirect the console to serial. This procedure is unique to the CSR1000V since in its intended deployment of cloud data centers, you may not have means to access a virtual serial port and may prefer to work from the VM console or a management interface in a dedicated VRF. To redirect the console output, we enter the following:
conf t platform console serial end write reload
This is entered within the VirtualBox VM console:
When the router reboots, you’ll see only OS-level stuff like the GRUB bootloader and some services startup messages on the VM console window. However, now you can right-click on the object in the GNS3 window and select “Console” which will open the serial console using a named pipe and it will act just like normal console sessions into Dynamips routers.
After some basic addressing, and remembering that the CSR has CDP disabled by default (and thus needs the global “cdp run” and the interface-level “cdp enable”, I got CDP connectivity. I threw on a basic OSPF configuration just to prove that link-local multicast and OSPF adjacency worked, and indeed, it did:
And there we have it. Running the CSR1000V in GNS3, successfully connecting with Dynamips emulated routers as well. Happy labbing!
Nice!! Never even thought about this.
Thanks for the walkthrough
Like I said, this is a “Googler requested” post… It came up because I see people searching for it. I’m just pandering to the masses 😉
Thanks for reading!
Great idea and thanks for these very helpful guidelines and tips.
I tried the same, CSR to CSR is working fine but CSR to 7200 is not. I wondr it is my local machine issue.
Hi Mahir,
It must be something with your topology or local configuration. In my test lab, I had a topology that went CSR—7200—CSR and was able to get end-to-end connectivity and routing information.
Best of luck!
Totally working fine !!! great job !!
Nice tutorial. I set this up and had no trouble communicating between another CSR and XRv using Ethernet interfaces with IP configured. However… if I tried to use 802.1Q sub interfaces (single and double tagged), I found that there is no connectivity between devices. On the XRv I see arp requests for the CSR, but the CSR never sees the reply even though the XRv sends it back. When testing this between two CSRs the second CSR does not see the arp request. have you tested sub interfaces or seen anything similar?
Hi Dave,
I didn’t try 802.1q sub-interfaces when I was labbing this up. I do remember some funkiness when playing with other router virtualization technologies where tagged/untagged sub-interfaces didn’t really work together and everything had to be a tagged sub-int.
I’ll lab your setup myself when I get a chance and see if I can at least confirm your observations.
Thanks for reading!
Hi Bob, I copied exactly what you suggested. But CSR console stucks at below
Unble to open /dev/varied
INIT: Entering runlevel: 2
INIT: Switching to runlevel: 3
I tried to re install but in vain. Please advise. I badly need CSR in my GNS3 topology.
Thanks.
Hrm, I’ve not come across that situation. A clean install in an appropriately outfitted VM certainly should work. I’d guessing maybe it’s something with the VM settings, like what hardware the VM has, but that’s about all I can guess. Another option for getting virtual routers up and running quickly is either installing CSR1000V in a vSphere environment using the OVA, or perhaps trying Cisco VIRL now that it’s available for purchase.
Good luck and thanks for reading!
[…] ISO version. As far as firing up a IOS3 XE in GNS3, thanks to googling, I came upon this article https://herdingpackets.net/2014/02/06/using-the-cisco-csr1000v-in-gns3-with-virtualbox/. Wasn’t a big deal getting the CSR1Kv up and running in GNS3 on windows but it’s sort […]
Hello,
Thank you for this post,
Currently I am working on a topology in parts of which I am required to connect a Cisco IOU router to a CSR 1000v. It’s all done on VMware workstation.
Everything else can ping in/out: IOU to IOU, IOU to XR…etc except IOU to CSR and XR to CSR.
Actually, XR can ping CSR1000v while CSR1000v cannot ping XR…
I am stuck here, please help.
Thank you,
AZ
Hey Dude,
Many thanks for the nice article,
I am not able to connect through the console port in GNS3, even I followed your instruction, my csr1000v screen shows or stuck on
unable to open /dev/cdrom0
INIT: Entering runlevel: 2
INIT: switching runlevel: 3,
which I assume it may not showing the prompt because it is redirecting the output to the console ?
on GNS3, when I click to connect to the console, nothing happened
Any help would be appreciated.
Nice guide! Thanks….got my first (of many to come) CSR setup in VB. It was constantly crashing on me until I changed the OS type to Redhat 64….unless it’s just a coincidence. Of course following this guide I gave it the full 3GB of ram, 8gb fixed disk, etc.
I also added the following line to my GNS3 preferences- General-Terminal Settings in order to use Superputty for the CSR VB VM console instead of putty (in addition to the commands above for console output)
Serial.: SuperPutty.exe -serial “%s -wt \”%d\” -gns3 5 -skin 4″
Now all my GNS3 routers and CSRs will be in the same SuperPutty tabbed console.
@rafi…..have the same issue, has anyone figured this out? Normally happens after I set the console platform serial command and reload.
Hi Murph,
Follow the tutorial as normal and then rather then connecting via console in GNS3, open the putty locally and copy the \\.\pipe\VBOX\<your_vm_name> under the serial port setting of your instance, then open the putty, select serial connection and paste the \\.\pipe\VBOX\<your_vm_name> in the Serial Line and press connect and press enter couple of time and wait for a couple of sec, it may be take little bit longer, so be patient.
let me know how you get on with that and report me any issue.
thanks
Muhammad
Kind Regards, Muhammad Rafi Network Engineer MSc Telecom & Computer Networks CCNA, CCNA Wireless, CCNP, MCP, VCA, CCA
Sent: Wednesday, October 29, 2014 at 5:05 AM
Hey, just wanted to let you know that your post was absolutely helpful and i got it working with no issues whatsoever. Thanks for the play by play!!
[…] PM #2 This may help? Using the Cisco CSR1000V in GNS3 With VirtualBox | Herding Packets Got a blog going – http://virtual10.com VCDX Stage 1 in progress – Putting my design together […]
I tried to run this on a 2.5GHz Mac Mini with I5 processor and 8GB RAM, but got the following error message during int initial CSR installation:
%IOSXEBOOT-4-CPU_POPCNT CPU Population Count not met
(or something close to that; the error ID string is exact)
VB won’t let me increase the CPU count beyond 1, and this is a dual-core machine (albeit hyperthreaded). I think this means I’m sunk, at least on the Mac Mini. Dang. It’s working so well for all kinds of other platforms, including IOS and Junos!
Hi, take a look at this blog entry. It may be of some help. I think the POPCNT message may be about a CPU feature not the actual CPU count.
http://vinciconsulting.com/blog/-/blogs/troubleshooting-a-cloud-services-router-csr-1000v-install
Hopefully that will give some insight. Not sure off hand if Vbox can do CPU feature masking like VMware can. Best of luck!
[…] Using the Cisco CSR1000V in GNS3 With VirtualBox | Herding Packets […]
Hi,
I followed your tutorial and configured the CRSV1000 on GNS3 with VB. Everything went fine but the connected interfaces don’t communicate. Ping doesn’t work; not even self ping.
Instead with CDP they see each other as neighbors. Please see bellow:
R3#sh cdp nei
Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge
S – Switch, H – Host, I – IGMP, r – Repeater, P – Phone,
D – Remote, C – CVTA, M – Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID
R2 Gig 0 148 R I CSR1000V Gig 0
R3#sh ip int b
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0 10.10.10.1 YES manual up up
R3#ping 10.10.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)
R3#ping 10.10.10.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)
Do you have any idea ?
Thanks in advance,
Quda
With just that little bit of info, it’s very hard to say. I’d verify that you have ARP on each end, and go from there. Good luck!
Hi guyzm
I am having troubles trying to install the ISO of the CSR1000
http://postimg.org/image/r2mwu2n03/
http://postimg.org/image/6tjtgumyb/
My computer is a toshiba i7
8gbs ram
can anyone help me?
I am working on my ccnp route exam
Thanks in advanced,
Edilmar Santizo
NOC Enginner
CCNA Voice, CCNA R&S
It looks like your CSR VM is up. If it’s trying to open a configuration via TFTP, that means it’s booted all the way and is coming up fresh (no startup-config) with a network port activated. What part of installing doesn’t work?
Hi Bob,
thank you for this great article. I used this to get my CSR1000Vs in GNS3 to work. Unfortunately I have the exact same issue as Dave here stated. If I use “normal GigabitEthernet1 interfaces my two 1000Vs will see each other via CDP and can ping each other, untagged dot1q subinterfaces work as well but as soon as i use tagged subinterfaces this does not work anymore.
Seems that other people have similar problems:
https://community.gns3.com/thread/22092
Have you tried it in the meanwhile with tagged subinterfaces ?
Great Article ! Thanks
Thanks a lot, it’s more useful.
Hakim.
Hello…..has anyone solved the issue with using sub-interfaces, I would like to practice Bi-Directional Forwarding Detection…..but using the CSR maybe the only want to go with practicing this technology?
**only way to go with practicing this technology?