-1

When logged in through virsh console on to KVM. hostname is not shown properly in bash prompt. We are using 63 character hostname.

bash_prompt

KVM Guest OS: Red Hat Enterprise Linux Server release 7.9 (Maipo) Host OS: Red Hat Enterprise Linux Server release 7.6 (Maipo)

I don't see above issue when logged in using ssh or virt-manager

hostname i'm using is Nikiabcdefdhijklmnopqrst898hd-uvwxyz-jkkdjkjdsdadjkjkkjdkjsdj90

Vijay S B
  • 1,057
  • 9
  • 22
  • "is shown properly" - hmm, you might want to proofread that one. What information would you like to get in an answer? It's not immediately clear to me what kind of help/information you are seeking here. – dratenik May 21 '21 at 13:40
  • Its not** shown properly. Updated question. I'm expecting hostname name should be showing completely in bash prompt. – Vijay S B May 21 '21 at 13:54
  • If you want the authors of libvirt to fix the display, no answer we could provide here will do that, such a bugreport belongs in their bugtracker. – dratenik May 21 '21 at 14:29
  • I'm not sure whether its configuration issue or bug. That's why posted here. I have logged redhat ticket also. – Vijay S B May 21 '21 at 14:30
  • It's launching some kind of telnet ("Escape character is ^]" is a telnet message) and wrapping because the print exceeded the length of the line. On the configuration front you could get a larger window or a shorter hostname. Or both. – dratenik May 21 '21 at 14:34
  • If so it should happen for all VMs. Why it is not wrapping for RHEL 8 based VM – Vijay S B May 21 '21 at 14:37
  • Something to do with the shell prompt? Compare the values of `$PS1` and `$PS2` between the machines. – dratenik May 21 '21 at 14:44

1 Answers1

0

adding below line in /etc/bashrc resolved the issue.

resize > /dev/null 2>&1

'xterm' rpm provides resize binary.

Vijay S B
  • 1,057
  • 9
  • 22