Search code examples
virtual-machinekvmvirsh

virsh console to KVM


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


Solution

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

    resize > /dev/null 2>&1
    

    'xterm' rpm provides resize binary.