Minicom, Cisco and xmodem
I recently broke a cisco 1700 router by uploading a bad IOS. Rather than reconfigure a bunch of networking stuff, I decided to try uploading the image via xmodem.
I decided that i’d dust off some old skills and upload the new image via xmodem.
The router was giving me a Machine Check Exception error, which was due to selecting an image that required a bit too much memory. I decided that i’d dust off some old skills and upload the new image via xmodem. I also didn’t mind an excuse to leave something running overnight.
Back in school, when we did IOS recoveries like this, we’d use HyperTerminal from our windows PC. Since then, i’ve started using Screen and Minicom.
I’ve always been a huge fan of Screen, and have been using it a lot to configure devices via serial from my mac, but Minicom has a built in xmodem feature; I figured it would be cooler than futzing about with the sz command. I happened to have access to an ubuntu box that was connected via serial to the router.
Transferring 11MB over a 9600 bps serial connection is not a fast process and should be run inside of a screen session.
You’ll need a copy of the IOS on a mounted filesystem. Then make sure that the correct software is installed. Assuming you’re not root, run:
sudo apt-get install screen minicom lrzsz
The first thing to do, even before firing up screen, is to configure Minicom – the escape key for it is the same as screen (^A), and there are some serial port settings that need changing.
Since you’re not using a modem, you don’t want Minicom to initialize it, which is what the -o option below does
minicom -o
From there, run ^A – C to enter the configuration dialog. Here, you can set the path to your serial port and such, which will usually be something like ttyS0, as well as the speed, which should be 9600 8N1. You’ll also want to edit the escape key under the “screen and keyboard” section- I usually set mine to ^S. Then I save the setup as default. Alternately, you can change the screen escape key, but I use screen much more than minicom, so it’s not worth it. Quit Minicom by issuing the ^A – Q command, and leave the application without a reset when prompted.
From there, you’ll want to start a screen session and minicom by running
screen minicom -o
Then, power up the router and press ^S – F to send a break to the device. You’ll end up with a prompt that looks like
rommon 2 >
From there, you can prepare the router for the upload by running
xmodem -c -x new-ios
Wait until the router prompts you to upload the file, then, using minicom run ^S – S to send a file, select xmodem and follow the instructions for uploading your file.
After the upload is complete, you can run the reset command to boot into your new IOS.
reset
You can find more information about the process on Cisco’s website. Some devices may allow you to set a higher console speed, which can greatly decrease the time it takes to load up a new image.
You can also TFTP a new IOS using the tftpdnld command from the rom monitor, which will result in a significantly faster upload.




I recently booted a cisco 3620 image on a 3640, and was trying to xmodem upload the good IOS image to the thing, and it kept failing! Not until I read this post did I realize I was missing the lrzsz package. So, thanks!
Aaron
@Aaron Meehan
Glad to help! It would be nice if minicom had lrzsz as a dependency, but with such wide support for tftp in new devices and CF cards for primary storage, xmodem isn’t as relevant these days.