Description of problem: If a user's bashrc contains print statements, libvirt cannot cope with it (it tries to interpret them as libvirtd messages maybe?). Version-Release number of selected component (if applicable): libvirt-1.0.5.5-1.fc19.x86_64 How reproducible: Every time Steps to Reproduce: 1. add 'echo this is text' to user ~/.bashrc file 2. virsh -c 'qemu+ssh://localhost/system' list --all Actual results: $ virsh -c 'qemu+ssh://localhost/system' list --all user@localhost's password: error: failed to connect to the hypervisor error: no valid connection error: packet 1952999791 bytes received from server too large, want 4194304 user@localhost's password: error: Failed to reconnect to the hypervisor Expected results: (what happens if you do not have the echo statement) $ virsh -c 'qemu+ssh://localhost/system' list --all user@localhost's password: Id Name State ---------------------------------------------------- 2 MyDomain running
In general, ALL ssh operations are liable to fail if you have a banner. The bug is on your end for having a noisy remote shell login, and libvirt can't be taught how to work around every whim of every person's banner. Instead, you should follow the usual conventions of fixing your .bashrc to output a banner ONLY for an interactive login, and to be silent for the case of remote command execution that does not require an interactive shell.
(In reply to Jonathan Lebon from comment #0) > Description of problem: > > If a user's bashrc contains print statements, libvirt cannot cope with it > (it tries to interpret them as libvirtd messages maybe?). When libvirt connects over SSH, the stdin + stdout of the SSH connection are used to transport the RPC protocol. Anything else printed to stdout will of course corrupt the protocol. > Steps to Reproduce: > 1. add 'echo this is text' to user ~/.bashrc file Really do not do this. If you want to a banner displayed to people at login time, the /etc/motd file can be used. This correctly displays the message on interactive shells, without corrupting data on non-interactive sessions as used by libvirt. $ cat /etc/motd I am the motd $ ssh localhost Last login: Mon Sep 16 17:26:51 2013 from localhost I am the motd # logout Connection to localhost closed. $ ssh localhost /bin/date Mon 16 Sep 17:30:45 BST 2013
You don't necessarily have to use /etc/motd (since that gives the same banners to all users); for any per-user stuff, just be sure to use the same principles as what system profile does for /etc/motd. when writing your .bashrc: # Limit banner to interactive logins case $- in *i*) your noisy banner here ;; esac