mirror of
https://github.com/retspen/webvirtmgr.git
synced 2026-04-25 15:45:51 +03:00
[GH-ISSUE #551] Console Access #414
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 @ghost on GitHub (May 9, 2015).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/551
Hi there!
I configured an environment like this:
Server01
Server02
When I access the 200.200.200.200 I got the webvirtmgr and I can create, delete, change VM, etc, but I can't access the VNC console. If I add a PREROUTING rule to 192.168.0.2 in the port 5900, I can access the VM console using the VNC Viewer.
Is there any way to access the console using the webvirtmgr ?
@brenard commented on GitHub (May 9, 2015):
Hi,
It's possible, please read the wiki page about it :
https://github.com/retspen/webvirtmgr/wiki/Console
@ghost commented on GitHub (May 9, 2015):
@brenard I read the page, but doesn't work. I have configured the certificate, the host, the port, etc and doesn't work.
my settings.py
WebVirtMgr settings
SECRET_KEY = None
LOCAL_PATH = None
TIME_JS_REFRESH = 2000
WS_PORT = 6081
WS_HOST = "cloud.upnetworks.com.br"
WS_PUBLIC_HOST = "cloud.upnetworks.com.br"
WS_CERT = "/etc/ssl/certificate.pem"
The nginx log say: 2015/05/09 15:22:41 [error] 5606#0: *570 connect() failed (111: Connection refused) while connecting to upstream, client: 187.66.175.204, server: , request: "GET /info/insts_status/1/ HTTP/1.1", upstream: "http://127.0.0.1:8000/info/insts_status/1/", host: "cloud.upnetworks.com.br", referrer: "https://cloud.upnetworks.com.br/instances/1/"
The port was changed because the nova novnc use the same. I add the firewall rule to this port 6081 too.
Each VM created I add the VNC port rule 5901, 5902, etc and access them via VNC Viewer so far.
Is there way to do a debug at the console? I would like to use the console via webvirtmgr.
Thanks buddy.
@brenard commented on GitHub (May 9, 2015):
Hi,
Ok, first check : do you verifid that webvirtmgr-console script is listenning ? The command netstat -lnp could help for that. Verify that the listenning address is correct. If it's ok, could you say me what kind of errors is reported ? On browser ? In log files ? You could increase webvirtmgr-console script log verbosity by adding -d parameter on the command run by supervisord.
@ghost commented on GitHub (May 10, 2015):
@brenard

The netstat command is below (this command was run at the webvirtmgr and not at kvm host)
The error when I open the console is:

At the nginx logs:
2015/05/09 15:22:41 [error] 5606#0: *570 connect() failed (111: Connection refused) while connecting to upstream, client: 187.66.175.204, server: , request: "GET /info/insts_status/1/ HTTP/1.1", upstream: "http://127.0.0.1:8000/info/insts_status/1/", host: "cloud.upnetworks.com.br", referrer: "https://cloud.upnetworks.com.br/instances/1/"
supervisor log:
File "/var/www/webvirtmgr/console/webvirtmgr-console", line 271, in
server.start_server()
File "/usr/lib/python2.7/dist-packages/websockify/websocket.py", line 905, in start_server
tcp_keepintvl=self.tcp_keepintvl)
File "/usr/lib/python2.7/dist-packages/websockify/websocket.py", line 694, in socket
sock.bind(addrs[0][4])
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address
WARNING:root:No local_settings file found.
WARNING:root:No local_settings file found.
WARNING:root:No local_settings file found.
WARNING:root:No local_settings file found.
Running the webvirtmgr-console with -d:
/var/www/webvirtmgr/console/webvirtmgr-console -d
WARNING:root:No local_settings file found.
Traceback (most recent call last):
File "/var/www/webvirtmgr/console/webvirtmgr-console", line 271, in
server.start_server()
File "/usr/lib/python2.7/dist-packages/websockify/websocket.py", line 905, in start_server
tcp_keepintvl=self.tcp_keepintvl)
File "/usr/lib/python2.7/dist-packages/websockify/websocket.py", line 694, in socket
sock.bind(addrs[0][4])
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
Thank you buddy!
@brenard commented on GitHub (May 10, 2015):
Hi,
Ok, so you'r first problem is that webvirtmgr-console script fail to start because :
This mean that another process (or an old process of webvirtmgr-console script) is already running when you tried to run it. I advice you to stop supervisord and check that port 6081 is free after that. If it's not, try to kill listening process by it's PID.
After, run again supervisord and verify that webvirtmgr-console script successfully started : check log and if another error (or trace) is present, and provide it here. If you find, the same error, it's possible that webvirtmgr-console script keep trying to start on 6080 port and not on 6081 port. To verify that theory, you could try to stop Nova novnc and restart supervisord.
It's could be not the only one error you have : Your browser HTML5 VNC client return Connect timeout that mean that it fail to connect to webvirtmgr-console websocket. It's could be network error, configuration error, SSL error, ... Please provide you web browser console content, it's could be helpful.
@ghost commented on GitHub (May 10, 2015):
Hi @brenard
I did stop supervidor and start again and the port 6081 is listening correctly.
At the supervisor log (webvirtmgr-console.log) says:
Traceback (most recent call last):
File "/var/www/webvirtmgr/console/webvirtmgr-console", line 271, in
server.start_server()
File "/usr/lib/python2.7/dist-packages/websockify/websocket.py", line 905, in start_server
tcp_keepintvl=self.tcp_keepintvl)
File "/usr/lib/python2.7/dist-packages/websockify/websocket.py", line 694, in socket
sock.bind(addrs[0][4])
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address
WARNING:root:No local_settings file found.
WARNING:root:No local_settings file found.
WARNING:root:No local_settings file found.
WARNING:root:No local_settings file found.
WARNING:root:No local_settings file found.
WARNING:root:No local_settings file found.
WARNING:root:No local_settings file found.
and webvirtmgr.log
2015-05-10 17:01:49 [28626] [INFO] Booting worker with pid: 28626
INFO:gunicorn.error:Booting worker with pid: 28626
WARNING:root:No local_settings file found.
About the Nova and novnc, are installed but no running.
About the firewall, I have opened the port 6081 at the webvirtmgr host ( is not the kvm host. The kvm host is behind the firewall).
The console error is:

I believe that this problem is missing something configuration.....
If you wish, we can debug together at the skype and back here with the solution for the others guys.
Thanks buddy.
@ghost commented on GitHub (May 10, 2015):
@brenard
I have a big information about that.
Using the site http://kanaka.github.io/noVNC/noVNC/vnc.html I can connect to the console when the Encrypt Option is disable.
See this print:

when I enabled the Encrypt Option the error is the same:

How can I fix it?
Thanks buddy.
@ghost commented on GitHub (May 10, 2015):
@brenard
I changed the https to http and the console working fine. When enable just https, the error appears.
The console doesn't workinkg with https+ssl. Is there way to fix it?
Thanks again.
@brenard commented on GitHub (May 11, 2015):
Hi,
I see an certificate exception in your console web page (https://cloud.upnetworks.com.br), this mean that your SSL certificate is self-signed or not recognized by your web browser. It's possible to use a self-signed certificate but you have to add exception in your browser for both WebVirtMgr access and console access. For WebVirtMgr, it's ok, but for console access, you have to open in a tab of your web browser https://cloud.upnetworks.com.br:6081 and add an exception for this URL. After that, VNC HTML5 client could connect to webvirtmgr-console websocket.
@ghost commented on GitHub (May 11, 2015):
Hi @brenard
See the print:
And about the certificate, is not my self-signed certificate:

May be need change some config files?
Thanks.
@brenard commented on GitHub (May 11, 2015):
Hi,
I mean you have to upgrade your WebVirtMgr installation : WS_CERT configuration variable was added in the last version (of the end January 2015). For your first error (Error code 405), it's normal : webvirtmgr-console not handle standard GET HTTP method, just handle websocket access. The goal was only to add an exception for this certificate.
@ghost commented on GitHub (May 11, 2015):
@brenard
After the WS_CERT configuration,it's working fine!!
Thank you a lot!!!
@brenard commented on GitHub (May 11, 2015):
Nice, thank to close this issue.
@ghost commented on GitHub (May 11, 2015):
ops sorry!! closing now!