[GH-ISSUE #551] Console Access #414

Closed
opened 2026-02-27 16:39:12 +03:00 by kerem · 14 comments
Owner

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

  • IP External 200.200.200.200
  • IP internal 192.168.0.1
  • Nginx with webvirtmgr (https mode)

Server02

  • IP internal 192.168.0.2
  • KVM

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 ?

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 - IP External 200.200.200.200 - IP internal 192.168.0.1 - Nginx with webvirtmgr (https mode) Server02 - IP internal 192.168.0.2 - KVM 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 ?
kerem closed this issue 2026-02-27 16:39:12 +03:00
Author
Owner

@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

<!-- gh-comment-id:100451027 --> @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
Author
Owner

@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.

<!-- gh-comment-id:100528898 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:100557484 --> @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.
Author
Owner

@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)
image

The error when I open the console is:
image

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!

<!-- gh-comment-id:100569318 --> @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) ![image](https://cloud.githubusercontent.com/assets/3639439/7552695/13a49964-f69a-11e4-978d-8e58fe62c492.png) The error when I open the console is: ![image](https://cloud.githubusercontent.com/assets/3639439/7552698/61e40948-f69a-11e4-852b-37e11ba69247.png) 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 <module> 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 <module> 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!
Author
Owner

@brenard commented on GitHub (May 10, 2015):

Hi,

Ok, so you'r first problem is that webvirtmgr-console script fail to start because :

socket.error: [Errno 98] Address already in use

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.

<!-- gh-comment-id:100642576 --> @brenard commented on GitHub (May 10, 2015): Hi, Ok, so you'r first problem is that _webvirtmgr-console_ script fail to start because : ``` socket.error: [Errno 98] Address already in use ``` 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.
Author
Owner

@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:
image

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.

<!-- gh-comment-id:100692035 --> @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 <module> 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: ![image](https://cloud.githubusercontent.com/assets/3639439/7556048/8fdc42fa-f737-11e4-91b6-9b6f46992833.png) 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.
Author
Owner

@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:
image

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

How can I fix it?

Thanks buddy.

<!-- gh-comment-id:100701318 --> @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: ![image](https://cloud.githubusercontent.com/assets/3639439/7556217/3f48b100-f73e-11e4-966f-b33574443356.png) when I enabled the Encrypt Option the error is the same: ![image](https://cloud.githubusercontent.com/assets/3639439/7556221/5e5c8940-f73e-11e4-83c8-3aa9f613a79e.png) How can I fix it? Thanks buddy.
Author
Owner

@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.

<!-- gh-comment-id:100704739 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:100802361 --> @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.
Author
Owner

@ghost commented on GitHub (May 11, 2015):

Hi @brenard

See the print:

image

And about the certificate, is not my self-signed certificate:
image

May be need change some config files?

Thanks.

<!-- gh-comment-id:100936705 --> @ghost commented on GitHub (May 11, 2015): Hi @brenard See the print: ![image](https://cloud.githubusercontent.com/assets/3639439/7567735/0aa828ee-f7d5-11e4-98ed-d2ac72230036.png) And about the certificate, is not my self-signed certificate: ![image](https://cloud.githubusercontent.com/assets/3639439/7567783/4ae63e64-f7d5-11e4-8561-f5c0112715d4.png) May be need change some config files? Thanks.
Author
Owner

@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.

<!-- gh-comment-id:100946476 --> @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.
Author
Owner

@ghost commented on GitHub (May 11, 2015):

@brenard

After the WS_CERT configuration,it's working fine!!

Thank you a lot!!!

<!-- gh-comment-id:100977576 --> @ghost commented on GitHub (May 11, 2015): @brenard After the WS_CERT configuration,it's working fine!! Thank you a lot!!!
Author
Owner

@brenard commented on GitHub (May 11, 2015):

Nice, thank to close this issue.

<!-- gh-comment-id:100981673 --> @brenard commented on GitHub (May 11, 2015): Nice, thank to close this issue.
Author
Owner

@ghost commented on GitHub (May 11, 2015):

ops sorry!! closing now!

<!-- gh-comment-id:100984883 --> @ghost commented on GitHub (May 11, 2015): ops sorry!! closing now!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#414
No description provided.