-   Linux - Virtualization and Cloud (
-   -   What packages do I need for a properly working serial console? (

PeterSteele 10-04-2012 11:08 PM

What packages do I need for a properly working serial console?
I've created a minimal CentOS VM where my kickstart includes only

%packages --nobase

plus a small handful of other packages. I can open a serial console to my VM via virsh, and it works reasonably well, but full screen apps like vi don't function quite right. There are definite screen draw issues.

I've noticed that when I do a full install, the serial console works fine, just like an ssh session, with apps like vi working as expected.

What do I need to include in my custom minimal install that would give me a better working console?

ShadowCat8 10-05-2012 06:33 PM


Actually, it sounds like the terminal settings are the issue.

When you log into the minimal VM, what do you get for 'echo $TERM'?
Is that the same thing you get when you do it on the full install?

HTH. Let us know.

PeterSteele 10-05-2012 08:32 PM

TERM is set to vt100-nav when I connect to the VM via its virtual serial console. Things like vi, less, and even using the up-arrow for command history do not work properly. Curiously, when I connect to it via ssh, TERM is set to vt100 and vi, command history, etc., all work fine, but if I set TERM to vt100 in my console session, there is no change in behavior compared to the original vt100-nav setting.

PeterSteele 10-06-2012 02:31 PM

The other behavior I see is double echoing during login. See the session below. This was generated when I connected to the console and logged into the root account with password "mypasswd". Note that the password I entered is echoed back to the screen, and the user name (root) appears twice for the same reason:


CentOS release 6.3 (Final)
Kernel 2.6.32-279.el6.x86_64 on an x86_64

localhost.localdomain login: root
Password: mypasswd


Any commands that I type after I login are also double echoed, although the text they output are not. It acts like the terminal thinks it is in half-duplex mode but it is actually in full duplex.

ShadowCat8 10-08-2012 12:26 PM


Well, I might recommend trying a couple other settings for TERM, namely "linux" or "xterm".

Going through the /etc/terminfo directories, I see both are still reflected, and both should bring the behavior that you've come to expect.

HTH. Let us know.

PeterSteele 10-08-2012 01:35 PM

Neither xterm nor linux work any different. I'll have to do a full VM install and see if I can figure out what is different compared to when I do a minimal install.

ShadowCat8 10-09-2012 01:48 PM

Question: What do you have under /etc for either terminfo or termcap?

Under one of my gentoo servers, I have the following:

dev7 ~ # ls /etc/terminfo/
a/ d/ l/ r/ s/ v/ x/
dev7 ~ # ls /etc/terminfo/v/
vt100  vt102  vt200  vt220  vt52 
dev7 ~ # file /etc/terminfo/v/vt100
/etc/terminfo/v/vt100: Compiled terminfo entry
dev7 ~ #

Now, those are the compiled terminfo files, and the database for them is under /usr/share/terminfo;

dev7 ~ # ls /usr/share/terminfo/
.keep_sys-libs_ncurses-5  5/                        A/                        P/                        c/                        h/                        m/                        r/                        w/
1/                        6/                        E/                        Q/                        d/                        i/                        n/                        s/                        x/
2/                        7/                        L/                        X/                        e/                        j/                        o/                        t/                        z/
3/                        8/                        M/                        a/                        f/                        k/                        p/                        u/                       
4/                        9/                        N/                        b/                        g/                        l/                        q/                        v/

However, for an actual "termcap" file, the only one I see is under /usr/share/vte/. And, that gave me an idea...
How about using 'vte' to try to run down where the issue is:

dev7 ~ # vte --help
  vte [OPTION...]  - test VTE terminal emulation

Help Options:
  -?, --help                    Show help options
  --help-all                    Show all help options
  --help-gtk                    Show GTK+ Options

Application Options:
  -A, --antialias                Disable the use of anti-aliasing
  -B, --background              Specify a background image
  -C, --console                  Watch /dev/console
  -D, --dingus                  Highlight URLs inside the terminal
  -S, --shell                    Disable spawning a shell inside the terminal
  -T, --transparent              Enable the use of a transparent background
  -2, --double-buffer            Disable double-buffering
  -a, --audible                  Use visible, instead of audible, terminal bell
  -b, --blink                    Disable the blinking cursor
  -c, --command                  Execute a command in the terminal
  -d, --debug                    Enable various debugging checks
  -f, --font                    Specify a font to use
  -g, --geometry=GEOMETRY        Set the size (in characters) and position
  -h, --highlight                Enable the cursor highlighting
  -i, --icon-title              Enable the setting of the icon title
  -k, --keep                    Live on after the window closes
  -n, --scrollback-lines        Specify the number of scrollback-lines
  -r, --color-cursor            Enable a colored cursor
  -s, --scroll-background        Enable a scrolling background
  -t, --termcap                  Specify the terminal emulation to use
  -w, --working-directory        Specify the initial working directory of the terminal
  --reverse                      Reverse foreground/background colors
  -G, --no-geometry-hints        Allow the terminal to be resized to any dimension, not constrained to fit to an integer multiple of characters
  -W, --scrolled-window          Use a GtkScrolledWindow as terminal container
  -P, --scrollbar-policy        Set the policy for the vertical scroolbar in the scrolled window (0=always, 1=auto, 2=never; default:0)
  -N, --object-notifications    Print VteTerminal object notifications
  --display=DISPLAY              X display to use

dev7 ~ #

So, what about trying to ssh into the minimal and then use vte (e.g. vte -t xterm) to switch between the terminal emulators and try vi after each switch to see which one operates normally for you.

The reason I know a bit about this issue is thanks to PuTTY, the windoze ssh app. By default, PuTTY is set to "ESC[n~" for "Function Keys and Keypad" which causes all sorts of issues with vi and other apps, but setting it to "Xterm R6" gets the terminal to behave properly.

HTH. Let us know.

PeterSteele 10-09-2012 06:38 PM

There is nothing under /etc/terminfo, but I have a similar set of directories that you have under /usr/share/terminfo.

The xte command you mentioned is not on any of the systems I have, neither full installs nor minimal installs.

ShadowCat8 10-10-2012 01:10 PM

Well then...

I think we may have found the issue. Just to make sure we are on the same page, you *do* have an /etc/terminfo directory, but *no* subdirectories or files under it?

Next question becomes; Do you have an /etc/termcap file? I'm not expecting that you would have one, but best to make sure.

And, now, what do have for the variable TERM in both the login account's home directory as well as the different profile(.xxx) and/or (xxxx)rc files under /etc? Put another way, what is setting the TERM variable on your logins to the minimal install?

It might be the fact that you are setting a TERM in your minimal somewhere that the system doesn't think is available and/or defined. You might just have to copy the desired terminfo files from /usr/share/terminfo/... to /etc/terminfo/...

HTH. Let us know.

PeterSteele 10-11-2012 08:44 AM

When I log in to the serial console, the default TERM is vt100-nav. When I log in via ssh, the TERM is vt100. The system sets these automatically. There is nothing explicit that I can find that determines the values for these in either .bashrc, .bash_profile, or /etc/bashrc. I'm using all of the system's default settings. However, even if I add an explicit entry in .bashrc to set TERM to vt100, the terminal's behavior is the same.

I tried copying /usr/share/terminfo to /etc/terminfo but that did not help the problem. Remember that this behavior only occurs when I log in to the pseudo serial console on my VM, using the command

virsh --connect qemu:///system console myvm

When I connect via ssh or when I use the same minimal install on a real system and connect to it via its real console, everything works as expected. The problem only occurs on a VM connected to via virsh.

ShadowCat8 10-18-2012 04:10 PM


This has been simmering in the back of my brain, and I think I have an answer, but I am not sure how much it will help you...

I found this link which indicates that the issue you are experiencing is an issue with virsh. :doh:

Now that page has a suggestion that worked for one of them... I'm not sure if it will help in your situation, but you can try.

Originally Posted by Robert Edmonds
ok, i tried "virsh console" from a real linux virtual console and it worked just fine with d-i.

HTH. Let us know.

PeterSteele 10-18-2012 06:31 PM

Hmmm. It doesn't surprise me that virsh may be the cultprit. I'll have to tackle it from this perspective and see if I can make any headway.

Thanks for the link.

All times are GMT -5. The time now is 06:15 PM.