Posted on | October 15, 2008 | 2 Comments
I love the ability to console in to a paravirtualized domain, especially when making changes to firewall rules. What I do not like is what the redirect does to the terminal when using stuff that heavily depends on ncurses, like ‘top’ or the midnight commander.
If your not familiar with minicom, its a simple ‘telex style’ terminal emulator. Most people use it when communicating over a null modem cable, or for direct AT command access to a modem. You might use it if you access your router’s serial console from a Linux box.
Using xenstore-ls and minicom, you can get a slightly better console into a paravirtualized guest. The steps are really simple:
1 – Make sure you have minicom. A simple apt-get install minicom (or yum install minicom) should suffice. As far as I know, every distribution under the sun packages it.
2 – Obtain the psuedo terminal of the guest. For this you will need to find out the guest’s domain ID and then use xenstore-ls to discover which terminal you need to use. An example is this:
# xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 802 2 r----- 773.3
Mini1 1 32 1 -b---- 0.2
Mini2 2 32 1 -b---- 0.2
# xenstore-ls /local/domain/1/console | grep ^tty
tty = "/dev/pts/3"
Now we know that we need /dev/pts/3 to get a console to domid 1.
So we fire up minicom with a few special switches, telling it to skip initializing of the device and that we’re connecting to a psuedo terminal.
minicom --noinit --ptty=/dev/pts/3
Now your in console Tap enter once or twice to see it come to life. Once in, hit CTRL-A, release, then press Z .. you’ll see a menu of stuff you can configure. Minicom also supports startup configuration files, so you can set your common preferences there.
Don’t expect the world, you’re still looking at a dumb terminal .. however curses/dialog based things will behave much better and your screen won’t kludge up as often.
If you want something much lighter than minicom, try Ivan’s one shot simple tiny serial terminal. Using that you would just issue the following:
./com /dev/pts/3 115200
Hopefully you found this tip to be of use