Bug 1130077 - Unable to get the vm console while trying to connect to the KVM host through ssh option from remote virt-manager.
Unable to get the vm console while trying to connect to the KVM host through ...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager (Show other bugs)
7.0
x86_64 Linux
unspecified Severity urgent
: rc
: ---
Assigned To: Giuseppe Scrivano
Virtualization Bugs
: Upstream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-14 05:36 EDT by Udayendu Sekhar Kar
Modified: 2015-03-22 20:46 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-22 08:28:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Error message showing wheile trying to access the VM's console. (45.85 KB, image/jpeg)
2014-08-14 05:37 EDT, Udayendu Sekhar Kar
no flags Details
Logs before using ssh-keygen for passwordless ssh. (7.32 KB, text/plain)
2014-08-14 05:39 EDT, Udayendu Sekhar Kar
no flags Details
Logs after using ssh-keygen for passwordless ssh. (11.37 KB, text/plain)
2014-08-14 05:39 EDT, Udayendu Sekhar Kar
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1165553 None None None Never

  None (edit)
Description Udayendu Sekhar Kar 2014-08-14 05:36:43 EDT
Description of problem:
Unable to get the vm console while trying to connect to the KVM host through ssh option from remote virt-manager. Both KVM host and the client system(where running virt-manager) are in RHEL7 with same qemu-kvm and same virt-manager.

Version-Release number of selected component (if applicable):
RHEL7
qemu-kvm-common-1.5.3-60.el7_0.5.x86_64
qemu-kvm-1.5.3-60.el7_0.5.x86_64
virt-manager-common-0.10.0-20.el7.noarch
virt-manager-0.10.0-20.el7.noarch
openssh-askpass-6.4p1-8.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Install a RHEL7 KVM host and create a VM 
2. Install another RHEL7 system and install virt-manager and try to connect to the KVM host using the ssh option of the virt-manager
3. While trying it will ask to provide password as 'openssh-askpass' package is installed.
4. After giving passowrd client virt-manager will be connected to the KVM host. Then try to take the console, it will show blank or some time the error message as attached to this bugzilla.
5. But if will do a passwordless connecttion between the virt-manager client system and the KVM host and then will try to collect, its working perfectly.

Actual results:
With openssh-askpass option its not working but without passowrd its working perfectly.

Expected results:
With both option it should work.

Additional info:
Initially for 2-3 time I got the below error message:
---
SSH password dialog could not grab the keyboard input.This might be caused by application such as screensaver, however it could also mean that someone may be eavesdropping on your session.Either close the application which grabs the keyboard or log out and log in again to prevent this from happening
---
Comment 1 Udayendu Sekhar Kar 2014-08-14 05:37:33 EDT
Created attachment 926726 [details]
Error message showing wheile trying to access the VM's console.
Comment 2 Udayendu Sekhar Kar 2014-08-14 05:39:16 EDT
Created attachment 926727 [details]
Logs before using ssh-keygen for passwordless ssh.
Comment 3 Udayendu Sekhar Kar 2014-08-14 05:39:49 EDT
Created attachment 926728 [details]
Logs after using ssh-keygen for passwordless ssh.
Comment 5 Giuseppe Scrivano 2014-08-20 03:34:39 EDT
how do you run virt-manager?  If you run virt-manager from a terminal, you could get the password prompt there.
Comment 6 Udayendu Sekhar Kar 2014-08-20 06:57:21 EDT
Hello Giuseppe,

Please find the reply to your below query:

>> how do you run virt-manager?

   - On a client system virt-manager packages are installed.
   - So just use 'Alt+F2' and run virt-manager to open the virt-manager gui.
   - Then go to:
      File -> Add Connection -> Hypervisor(QEMU/KVM) -> Enable "Connect to remote host" -> MEthod(SSH) -> Username (root) -> Hostname(remote KVM host IP where the VM is running) 

 Then try to connect.

These are the steps I am following and experiencing this issue as mentioned in the description of this bugzilla.

Feel free to let me know if you need more information or logs. Its 100% reproducible.

Regards,
Udayendu
Comment 7 Giuseppe Scrivano 2014-08-20 09:39:34 EDT
this should not happen anymore with the upstream version as ssh connections were serialized.  We are going to rebase virt-manager in RHEL-7.1
Comment 9 CongDong 2014-09-10 03:25:20 EDT
I test with virt-manager-0.10.0-20.el7.noarch on both hosts

Steps

1. open virt-manager on client system
# virt-manager
2. connect target host
File -> Add connection -> check connect to remote host -> file hostname -> Click Connect
3. double click to open the guest
4. open ssh dialog will come out and need to type password

Result:
The ssh dialog will come out 4 times, always get the error msg in description:
---
SSH password dialog could not grab the keyboard input.This might be caused by application such as screensaver, however it could also mean that someone may be eavesdropping on your session.Either close the application which grabs the keyboard or log out and log in again to prevent this from happening
---
After input password 4 times, will connect console successfully. Cannot get the error msg like attachment.

Also test with virt-manager-1.1.0-1.el7.noarch, just input password 4 times, don't get any error msg, can connect the console successfully.

Hi, Udayendu:
You cannot connect the console everytime?
As my result, I can connect the console, could help me to check my steps are right?
Comment 10 CongDong 2014-09-18 03:59:21 EDT
Hi, gscrivan
could you provide some suggestions for my test in comment 9.
Comment 11 Giuseppe Scrivano 2014-09-18 06:43:48 EDT
I have tried several times here to connect trough ssh to another host but I couldn't reproduce the problem with virt-manager-1.1.0-1.el7.noarch.  I didn't need to type my password 4 times to get it connected.

Do you need to repeat it 4 times even if you type correctly your password the first time?
Comment 12 CongDong 2014-09-18 07:25:00 EDT
(In reply to Giuseppe Scrivano from comment #11)
> I have tried several times here to connect trough ssh to another host but I
> couldn't reproduce the problem with virt-manager-1.1.0-1.el7.noarch.  I
> didn't need to type my password 4 times to get it connected.
> 
> Do you need to repeat it 4 times even if you type correctly your password
> the first time?

It happens when I try to open a spice guest on remote host.
Comment 13 Giuseppe Scrivano 2014-09-18 10:32:52 EDT
it is not a bug, spice needs more ssh connections.  The solution is to setup properly a ssh key for the ssh connection to the server.
Comment 14 CongDong 2014-09-19 05:14:15 EDT
(In reply to Giuseppe Scrivano from comment #13)
> it is not a bug, spice needs more ssh connections.  The solution is to setup
> properly a ssh key for the ssh connection to the server.

Yes, I know it. But I think the problem in the description is that after input password several times, but cannot connect the guest.
I use the same version with description, but I can connect the guest after input password.

So I'm not sure my test steps are right.
Comment 15 Giuseppe Scrivano 2014-09-19 11:05:19 EDT
I could reproduce the problem after setting a higher latency on the connection (as CongDong suggested privately to me) and from a first sight, it looks like a race condition while opening more ssh tunnels.  I will investigate better next week, for now I reassign it to me.
Comment 16 Giuseppe Scrivano 2014-09-22 08:28:18 EDT
I've looked more into this issue and the root cause doesn't seem easy to fix as this ssh-askpass error message can be raised any time a window is trying to get the focus, not only from virt-manager.

It is highly suggested to use a password-less[1] login (really, nobody should want to type the same password so many times) or to setup a shared ssh connection[2].

1)

ssh-keygen
ssh-copy-id user@host

2)

Add something like the following:

Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p

to the ~/.ssh/config file.  Please refer to "man 5 ssh_config" for more details.

(other details here: https://bugzilla.redhat.com/show_bug.cgi?id=811346)

Given the above, I am going to close this as WONTFIX.

Note You need to log in before you can comment on or make changes to this bug.