mirror of
https://github.com/retspen/webvirtmgr.git
synced 2026-04-26 08:05:54 +03:00
[GH-ISSUE #490] novnc wont connect #365
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @grantpasley on GitHub (Jan 19, 2015).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/490
hi there - when i try connect to console i get errror "connect timeout". this is a new install and all working fine up until trying to connect to console to configure guest - any advise / ideas?
thanks,
grant.
@aafanasyev commented on GitHub (Jan 19, 2015):
Hi,
do you want connect to ssh of the guest?
do you have ssh server installed on the guest?
what is your network topology? How guests connected to the internet? Bridged or NAT?
@aafanasyev commented on GitHub (Jan 19, 2015):
For vnc
do you use in your vnc client (I use tiny vnc) configuration like ip:5900 address?
what OS do you use as a Virtual host server?
@grantpasley commented on GitHub (Jan 19, 2015):
hi there - this is for console access - i create the guest instance then start up in order to configure i get a timeout from the console pop-up window, please see attached screenshot.

@kestel commented on GitHub (Jan 22, 2015):
Hello,
The same problem for me.
My network structure: WebVirtMgr (192.168.20.10) -> NAT (10.20.10.254) -> KVM server (10.20.10.20).
Host added to the WebVirtMgr with SSH connection. SSH connection from the WebVirtMgr host to the KVM host works fine.
VNC connection to 10.20.10.20:5900 works fine too.
The guest VM connected with bridged network.
When I trying open noVNC from the WebVirtMgr I get error "Server disconnected (code: 1006)".
All hosts have no Internet connection, only local net.
UPD: all machines is Ubuntu 12.04 or 14.04.
@aafanasyev commented on GitHub (Jan 22, 2015):
I had the same problem when I installed on Ubuntu Server 14.04.1 in:
Like it described in installation documents. However, when I installed everything (with changing paths in the related config files) to:
It is worked for me just fine.
@kestel commented on GitHub (Jan 22, 2015):
It don't work for me =(
@brenard commented on GitHub (Jan 22, 2015):
Hello,
The console connection is pretty simple to understand : The web console use a websocket to connect on port 6080 of your WebVirtMgr host, on this port, the console/webvirtmg-novnc script must be listening. This script open a TCP socket to VNC console of the guest using the hostname of the KVM host and the port of the VNC console. After that, the script will made proxying between the websocket and the VNC socket.
To troubleshot, you have to verify :
Actualy, if you use reverse proxy in front of you WebVirtMgr instance, your browser can not connect to the websocket because the hostname that is use is the same of the one use to connect to WebVirtMgr : with a reverse proxy, this address is 127.0.0.1. I write a patch for that permitting to manually configure the public hostname to use for the websocket. It's available here :
github.com/brenard/webvirtmgr@731bc3304bIf you have NAT between WebVirtMgr host and you KVM host, I mean you WebVirtMgr host can not connect to the VNC console of your guests. In this topology, WebVirtMgr have to open a SSH tunnel to connect to your KVM host. I'm working on this feature and a pull request is pending for that : https://github.com/retspen/webvirtmgr/pull/488
You could try it if you want, and give me feedback. It's could be usefull for me to debug it in others use-cases.
@kestel commented on GitHub (Jan 23, 2015):
Hello brenard,
Thanks for your patch ( brenard@731bc33 ), it works well and helps me for half.
Now noVNC works fine with http connection without encryption and doesn't work via https.
I think, I need read something about wss.
When I try run webvirtmgr-novnc by hands I get next:
1, 2 - trying connect by https
3 - successfully connection by http
10.10.11.11 (my workstation) -> NAT (10.20.10.254) -> KVM server (10.20.10.20)
@brenard commented on GitHub (Jan 23, 2015):
Hello kestel,
I mean your installation is too old, could you try to upgrade it ? WSRequestHandler does not exist for me in the current version.
Concerning HTTPS access, you have to know that WebVirtMgr automatically enable SSL on websocket too. So you have to configure a correct SSL certificate and key for webvirtmgr-novnc. You have to edit webvirtmgr-novnc and modify CERT variable at the top of the file. This file must content both private key and public key (as you can see in cert.pem file in console folder). This certificate must be consider as valid for your web browser.
@goshlanguage commented on GitHub (Apr 21, 2015):
After changing the WS_CERT param in webvirtmgr/settings.py, I am getting the following errors:
Is there anything else I should consider? This is supposed to be a regular crt converted via openssl x509 to a .pem file, with no password protection, right?
Thanks for any help!
@brenard commented on GitHub (Apr 21, 2015):
@RyanHartje : I mean your cert file content is incorrect. It must content both private and public in x509 format (private key first). You could verify the file format in the example file provide in console/cert.pem. Check also if your cert file path is correctly handle by the script (use absoluted path to be sure) and check if this file is readable by user that running webvirtmgr-console script (user configured in supervisord).
@goshlanguage commented on GitHub (Apr 22, 2015):
Thanks for the help Brenard, I'm still having a bit of trouble.
I have converted my .key and .crt to pem (key first, followed by crt), I have also tried the crt and key by themselves (the key with rsa), but I am receiving errors for all of them.
Am I supposed to use the CA Bundle? The file is chowned by nginx:nginx, and is the correct permissions (644 should suffice). I have also tried using full paths, but I believe my issue is with my understanding of what the cert.pem should contain.
I am using the crt and key from the SSL that is connecting to the Hypervisor running webvirtmgr-novnc, is this correct?
@brenard commented on GitHub (Apr 22, 2015):
@RyanHartje : I don't understand what you mean about CA Bundle. Here, an example of your cert.pem file content :
Concerning rights, check that the directory that contain cert.pem file is accessible by that the user running webvirtmgr-console script.
You could also try to connect to this script socket using openssl s_client command to view witch certificate is indeed used :
@goshlanguage commented on GitHub (Apr 22, 2015):
Thank you for pointing that out, my key and crt were already in pem format, so just pasting them together in cert.pem resolved that, now I get return data on openssl s_client (thank you for showing me this as well, very helpful!):
It says its not able to verify it, but its actually connecting, I'm not sure what behavior to expect from webvirtmgr-novnc from this. The cert is issued from a trusted source.
My connection is still dropping, and I am getting this again:
This kind of brings me full circle though, as I tried to apply the crt files from the client server on the hypervisor, to allow novnc to connect over SSL. Do you have any recommendations?
Just a note, I am changing the ssl_only=False to true, to force SSL. If this is problematic, please let me know.
Another note, my key, if converted with openssl rsa will end up in ==, but converting my .crt to .pem with openssl x509 does not result in the same outcome. If I paste these outputs together, I get similar errors to my initial error from webvirtmgr-novnc. If you find this problematic, can you explain your process of converting the SSL?
These are the commands I've tried:
This results in the _ssl.c:365: error:140DC009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM type issues. Alternatively, what I've done to resolve the errors is this:
We can ignore perms issues, as Im running webvirtmgr as root to test, and its owned by nginx/644.
@goshlanguage commented on GitHub (Apr 22, 2015):
The more I look into it, the more I suspect the cert isn't associated with a known CA. I'll try a different SSL provider shortly and see if this resolves the issue.
@brenard commented on GitHub (Apr 22, 2015):
@RyanHartje : You'r write, it's a CA certificate problem :
You have to put your CA chain certificate(s) in cert.pem file as explain here :
https://docs.python.org/dev/library/ssl.html#certificate-chains
Your private key must at the top of the file, your certificate in second position and after put the CA chain certificate(s). I just try with this kind of cert.pem file and it's work well. After that, if you use openssl s_client command to connect on the webvirtmgr-console script, you could see that more than one certificate is provide.
Example :
@goshlanguage commented on GitHub (Apr 22, 2015):
Great! Thank you for this help! I now have the cert working great! Although novnc still doesn't work, I think its from a modification I am testing:
I know its out of scope at this point, but do you have any further ideas for how to troubleshoot this issue? The cert is certainly correct now:
As you see, the cert is correct, but I'm still getting the last_code issue. I appreciate any advice you might have.
Thanks again for all your help.
@brenard commented on GitHub (Apr 22, 2015):
Great ! For your problem, you are not the first with this last_code error. After some search, I found that is could only append if you are using Nova novnc python lib. Personally, I'm using lib from websockify package (from Debian Jessie websockify package) and I don't have this error. Could you try to install websockify package ? Webvirtmgr will firstly try to use this lib. If you don't use Debian, you could install websockify package by using command :
@goshlanguage commented on GitHub (Apr 22, 2015):
I use websockify:
Is it possible its old? I'm on Centos7:
websockify (0.5.1)
I upgraded it to 0.6.0 but webvirtmgr-console no longer starts up.
@brenard commented on GitHub (Apr 22, 2015):
Furthermore, I'm working on a patch that permit (amongst others things) to pass parameter to webvirtmgr-console and in particular -d parameter to enable debug. This could be help full to understand your problem. I also fix a problem when using SPICE console over HTTPS.
You could get this patch on my fork : https://github.com/brenard/webvirtmgr
@brenard commented on GitHub (Apr 22, 2015):
It's not the laster version, the version 0.6.0 is available and I'm using it : https://pypi.python.org/pypi/websockify
You could try to upgrade.
@johnerramirez commented on GitHub (Oct 15, 2015):
Im also having the same error
I already updated with git pull
what I can see is there is no file
console/webvirtmg-novnc script
Please explain clearly what is the solution
@pitachx commented on GitHub (Nov 2, 2015):
Change all webvirtmg-novnc to webvirtmg-console in /etc/supervisor/conf.d/webvirtmgr.conf and restart supervisor (work fine on Debain 7)