Don’t Tear your Hair Out over Access to Cisco Devices
Posted by Sean Duffy in Cisco devices, IT Professional, SysAdmin, Tutorials on 12-05-2010
Tags: Cisco devices, IT Professional, SysAdmin, tutorial
I just about tore my hair out the other night trying to find the right equipment to connect up to a small Cisco 1721 router. I wanted to get the afore mentioned router configured for some training I was doing. The problem of course being that I lacked a PC with any COM ports to connect the Cisco console cable up to. Just to think a few years ago I had rejoiced when motherboard manufacturers ceased supplying COM ports on their boards and replaced them with extra USB ports.
I really do take back what I had said regarding the usefulness of these ancient communications ports back then. I had been pacing through the house trying to find a USB to Serial adaptor, but after an hour or two of searching I came out empty-handed. Suddenly it dawned on me that my old PowerEdge 2450 sitting in my home lab set up had two COM ports. “Why didn’t I think of that earlier?”, I muttered as I hauled my equipment over to the lab to begin setting up. The answer? Well it was running VMware ESX 3.5 and I had absolutely no clue how to display a device’s console via ESX’s service console!
Solution
If for any reason you need to connect to a Cisco device (or any device with a serial cable to connect to the console for that matter) via an ESX 3.5 or 4.0 server then the following should also work for you. I’m also quite confident that this will also work for other Redhat based distibutions of linux.
Start by logging in to your ESX service console as the root user.
You should by default be logged into the root user’s home folder. To ensure you are in the root home folder, you can run the following command:
[root@esx3lab root]# cd ~
Next, we need to download some RPM packages to get the terminal emulation software we are going to be using installed. You could probably download these straight from the service console’s command line, but I prefer to download them to my management machine first then use WinSCP to copy them across to the ESX server. We need two packages, namely: minicom-2.00.0-12 RPM for i386 and lockdev-1.0.0-16 RPM for i386. A google for these two packages turns up many download links, but here are two download links that are currently valid:
lockdev – ftp://ftp.linux.ncsu.edu/pub/realmlinux/realmkit-7.3/i386/RedHat/RPMS/lockdev-1.0.0-16.i386.rpm
Minicom – ftp://fr.rpmfind.net/linux/redhat/9/en/os/i386/RedHat/RPMS/minicom-2.00.0-12.i386.rpm
Once you have these two files we’ll need to copy them over to the ESX server and place them in the root user’s home folder. If you don’t already have WinSCP installed, go grab it from winscp.net now and install it on your Windows management machine.
On the service console of your ESX Host, we’ll need to make a quick change to allow SSH logins from the root user over the network. WinSCP uses an SSH login so this will be necessary if we are going to get anything transferred via WinSCP. Do the following to enable root logins to this ESX Host:
[root@esx3lab root]# nano /etc/ssh/sshd_config
Find the line that reads PermitRootLogin no and change this to read: PermitRootLogin yes
Press Ctrl + X to exit the nano editor and then press Y followed by the Enter key to save changes and exit. You’ll now need to restart the SSH service so do the following command:
root@esx3lab root]# service sshd restart
Back on the management machine with WinSCP installed, launch WinSCP and at the login window, type in the IP address of your ESX server, ensure that port 22 is selected and that you type in the username of root and your ESX server’s root password. Click the Login button, and click “Yes” when asked if you want to accept the private SSH key.
Once you are connected, you’ll be greeted by a file browser interface, with your host machine on the left and your ESX server on the right. The default location will the root user’s home folder on the right, so just select the two RPM packages you downloaded earlier on your host machine, then drag and drop them to the ESX server on the right. Select the “Copy” option when prompted. This will copy the two packages to your root user’s home folder on the ESX Server.
Now, back at the service console (ESX Server) issue the following commands to get the lockdev library and minicom terminal emulator installed:
root@esx3lab root]# rpm --install lockdev-1.0.0-16.i386.rpm
root@esx3lab root]# rpm --install minicom-2.00.0-12.i386.rpm
Note that seeing as though you now have root SSH access to the ESX server, you could also just login to the Service Console using PuTTy – use the same details to login as we did with WinSCP. This will save you the hassle of having to sit in front of the ESX server itself, or connecting via a Remote Access Card.
We’ll now identify the serial port interfaces that our physical ESX server has. Run the following command:
root@esx3lab root]# dmesg |grep tty
You should get an output similar to the image below:
ttyS0 refers to the COM1 port and ttyS1 refers to the COM2 port on the server I am working on. Note the values that you get down. We’ll be using these to set up minicom next.
To start configuring minicom (provided it installed in the previous step!) issue the following command on your ESX host:
root@esx3lab root]# minicom -s
Go to Serial port setup in the menu, press Enter, then press A to configure the Serial Device as illustrated in the screenshot below. Type in /dev/ttyS0 if you are going to be using COM1 to connect the serial cable to your Cisco / network device. Note that ttyS0 assumes that this is the device you found when you ran the “dmesg |grep tty” command previously. In my case I found ttyS0 and ttyS1 for COM1 and COM2. Press Enter to accept the entry. Now configure the “Bps/Par/Bits” setting. Press “E” to adjust this and ensure it reads 9600 8N1 – you should actually match this to the baud rate needed by the device you are connecting to. I used the above line as this is the standard for most default Cisco equipment. Press Enter to accept, then Enter again to go back to the main menu.
Next up, go to “Modem and dialing“. You’ll notice some strings entered in the “Init string” and “Reset string” lines. Erase these so that they are blank, then hit Enter to accept the setting and return to the main menu.
Now choose “Save setup as dfl” and then select “Exit from Minicom” to exit back to the ESX console.
Now, for the grand finale. Connect your serial console cable to the ESX server’s relevant COM port, then plug the other end into your Cisco or other network device that you want to configure. Type in the following from the ESX Service Console to connect:
root@esx3lab root]# minicom
You should be greeted by the Minicom welcome screen. Hit Enter and you should now see the console of your device you are plugged into!

Here are a few commands for minicom to get you started:
CTRL + A, then Q – Quit minicom and return to server console.
CTRL + A, then F – Send a “Break” to your connected device. (Quite useful for Cisco equipment).
CTRL + A, then Z – Show the minicom help screen, which displays other useful commands.
Conclusion
You should now have an ESX host that is able to interface with your equipment via a console cable. This how-to doesn’t necessarily only apply to ESX servers – you should be able to use it for just about any linux-based machine you have at your disposal. Hopefully, like it did with me, this process will save your sanity one day when you find you are without the means to connect to a device console over serial cable!




Excellent – worked like a champ! Really appreciate the effort your put into this posting!!!
Hi Sid,
You’re most welcome. Glad to hear it worked well for you!
Sean
I wasn’t able to grab the rpms listed..
I used:
ftp://fr2.rpmfind.net/linux/ASPLinux/i386/RPMS.7.3/lockdev-1.0.0-16.i386.rpm
and
ftp://fr.rpmfind.net/linux/redhat/9/en/os/i386/RedHat/RPMS/minicom-2.00.0-12.i386.rpm
Hi again Sid,
Thanks for pointing that out – I see your rpm links are working well. If anybody else has trouble downloading the rpms please mention in the comments and I’ll find new sources to list.