mirror of
https://github.com/retspen/webvirtmgr.git
synced 2026-04-25 23:55:57 +03:00
[GH-ISSUE #535] Access VNC Console through Wan #400
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 (Mar 29, 2015).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/535
Hi there!
I have setup my test lab with it:
I can connect to the KVM Server through Web Server using the IP tunnel with OpenVPN (192.168.25.2). I can create, destroy, etc, but I can't connect to the VM console. Maybe why the connections to console use the 127.0.0.1. Is possible to solve this ?
Thanks.
@brenard commented on GitHub (Mar 29, 2015):
Hello,
You have to use last version with SSH tunneling to access VM console. Your KVM host have to be configure using SSH connexion. It's require if you want to use SSH tunneling. Another solution is to configure your VM console to listen on 0.0.0.0 or the IP address of your KVM host in your OpenVPN tunnel.
@ghost commented on GitHub (Mar 29, 2015):
Hello brenard,
I will try with SSH first. In cause of failure, how can I change the VM console to listen on 0.0.0.0 ??
Thanks.
@brenard commented on GitHub (Mar 29, 2015):
Use XML configuration editor of your VMs and in graphics XML balise you have to add listen attribute to specify the listen address. Refer on libvirt documentation for more details.
@ghost commented on GitHub (Mar 29, 2015):
I did this config, but the console show time out. I changed directly to xml file.
@ghost commented on GitHub (Mar 29, 2015):
I can see the nginx logs that the connection is go to correct IP but try at port 8000. But this port is listen to 127.0.0.1. How can I change this?
@brenard commented on GitHub (Mar 29, 2015):
In your local_settings.py file, you have to put this variables :
WS_PORT = 6080
WS_HOST = '0.0.0.0'
WS_PUBLIC_HOST = ip address or fqdn of your webvirtmgr host
You have to use the latest version of webvirtmgr, I' m not sure that old versions have all this variables.
@ghost commented on GitHub (Mar 29, 2015):
I give up!!! :)
Doesn't work!!! :(
@ghost commented on GitHub (Mar 29, 2015):
WebSocket server settings:
Traceback (most recent call last):
File "/var/www/webvirtmgr/console/webvirtmgr-console", line 218, in
server.start_server()
File "/usr/lib/python2.7/dist-packages/websockify/websocket.py", line 751, in start_server
lsock = self.socket(self.listen_host, self.listen_port, False, self.prefer_ipv6)
File "/usr/lib/python2.7/dist-packages/websockify/websocket.py", line 193, 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
@brenard commented on GitHub (Mar 30, 2015):
This IP address is your KVM host IP address, right ? This process is normaly running on your web server host on the public IP address. Your web browser have to be able to connect on this port (websocket connection).
@ghost commented on GitHub (Mar 30, 2015):
Correct, this IP is my KVM server. I'm using Google Chrome! Insinde my LAN is OK, but outside no.
Is there any files that need to be changed too?
@brenard commented on GitHub (Mar 30, 2015):
This service must running on a public IP address to be accessible outside of your LAN. You have to move this service on a host that is both connect on public and private network (or make NAT). This service is use to connect your web browser and your VM console throught a websocket so firewalling have to be opened for that.
@ghost commented on GitHub (Mar 30, 2015):
Ah Ok, so this case is the same to vpn, right? If doens't has a NAT, doens't work!
@ghost commented on GitHub (Mar 30, 2015):
I have setup the NAT at my router (NAT 5900 and 6080) and now I got the other error.
Failed to connect to server (code: 1006)
@brenard commented on GitHub (Mar 30, 2015):
Consider this service as another webserver (as Nginx) that permit to access console. So as your HTTP webserver, this service as to be running on your webvirtmgr host and being accessible directly from your web client.
This error is really common. To understand your problem, check the javascript console of your web browser and the log of webvirtmgr-console script.
@ghost commented on GitHub (Mar 30, 2015):
I did other setup. I'm using the KVM Server and Webvirt WebServer in the same LAN.
Now, I can reach the console. I set up the NAT on the ports 5900, 6080 to my KVM Server.
When I access from my Webserver and try to access the console, the console is show with sucess!
The only config changed was the settings.py at WS_HOST = '192.168.0.55'
I need protect to VNC access now.
One more question, can I add two or more KVM server at the webvirtmgr?
Thank you @brenard