Univention Bugzilla – Bug 36105
noVNC error when "Globally available" disabled, Failed to connect to server (code: 1006)
Last modified: 2015-01-29 11:49:40 CET
Created attachment 6151 [details] patch for /usr/lib/pymodules/python2.6/univention/uvmm/node.py The VNC HTML client cannot connect to noVNC. Web site shows error "Failed to connect to server (code: 1006)". Reason is an empty tokens file on the UVMM server in /var/cache/univention-virtual-machine-manager-daemon/novnc.tokens/. In uvmm/node.py write_novnc_tokens() ~ line 786 gfx.listen seems to be "None" for a kvm listening on 127.0.0.1:5900. The appended patch fixes it for me.
Created attachment 6524 [details] Check for matching host with local VNC 1. Thank you for the patch, but 2. The patch is missing the case, where UVMMd/noVNC-proxy and the VM are running on a separate hosts: In that case running VNC on 127.0.0.1 is not enough, as then the port is not reachable for the noVNC proxy. FYI: With "globally available" disabled the data looks like this: 'graphics': [{'autoport': True, 'keymap': u'de', 'listen': None, 'passwd': None, 'port': 5902, 'type': u'vnc'}],
r56692 | Bug #36105 UVMM: Fix VNC running on localhost only. Package: univention-virtual-machine-manager-daemon Version: 4.0.20-8.568.201412111020 Branch: ucs_4.0-0 Scope: errata4.0-0 r56695 | Bug #36105 UVMM: Fix VNC running on localhost only YAML 2014-11-26-univention-virtual-machine-manager-daemon.yaml * Fix noVNC for localhost VMs.
Reopen: As discussed, during QA i saw that the data contains listen=127.0.0.1 for a KVM instance running on the same host as uvmmd. In that case, no token would be written.
r57526 | Bug #36105 UVMM: Fix VNC running on localhost only. Handle listen="127.0.0.1" in newer libvirt Package: univention-virtual-machine-manager-daemon Version: 4.0.22-1.575.201501231539 Branch: ucs_4.0-0 Scope: errata4.0-0 r57527 | Bug #36105 UVMM: Fix VNC running on localhost only YAML 2014-11-26-univention-virtual-machine-manager-daemon.yaml
Reopen: There is still an issue with an instance running on a remote KVM server. If 'globally available' is disabled, the VNC icon is still shown in UVMMd, but when clicking on it the connection fails as expected. By my understanding, no VNC icon should be shown in this case. uvmmd works as expected, the token file does not contain an entry for the VM. The domain info for the VM reads DATA: {'qemu://kvmmember.ucs.local/system': [{'cpu_usage': 4.591724381125893, 'description': '', 'mem': 1073741824L, 'name': u'ucs40-64-test', 'node_available': True, 'state': 'RUNNING', 'suspended': 0, 'uuid': u'567ded28-e68e-4f20-9d11-0c5ee3a1db57', 'vnc': False, 'vnc_port': 5900}]} Notice 'vnc: False', which indicates that no external VNC connection is possible. But the umc module code in uvmm.js checks the wrong field to determine if the VNC icon should be shown: uvmm.js:88 var canVNC = function(item) { return isRunning(item) && item.vnc_port; };
r57608 | Bug #36105 UVMM: Fix VNC running on localhost only Use the same test for local VNC connections for "domain_list" as for writing the noVNC token file. Package: univention-virtual-machine-manager-daemon Version: 4.0.22-2.576.201501271444 Branch: ucs_4.0-0 Scope: errata4.0-0 r57610 | Bug #36105 UVMM: Fix VNC running on localhost only YAML 2014-11-26-univention-virtual-machine-manager-daemon.yaml
OK: Code Review OK: If "globally available" is disabled, vnc access is possible from uvmmd on the same host, but not from any other uvmmd hosts in the domain. OK: YAML -> Verified
<http://errata.univention.de/ucs/4.0/52.html>