Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VNC Fullscreen and Send Keys not working #174

Closed
lord-kyron opened this issue Aug 15, 2018 · 30 comments
Closed

VNC Fullscreen and Send Keys not working #174

lord-kyron opened this issue Aug 15, 2018 · 30 comments

Comments

@lord-kyron
Copy link
Contributor

@catborise - after you changes didn't worked for me I was able to get the noVNC project from github and make it work in my setup. I have a separate "Send CtrlAltDel" button now, which is working, but the dropdown menu with the send alt+FN keys and fullscreen keys from the console-base.html are not working.
I guess it is something it they way those are being called from the html as I am getting:
referenceError: sendCtrlAltFN is not defined when I try to send alt+f2 for exmaple

Can you please tell me how those should look as I cannot find a solution for that?
Thank you!

@catborise
Copy link
Collaborator

i was working... okey i will check again

@lord-kyron
Copy link
Contributor Author

I made the fullscreen work but I had to move the fulscreen function from vnc lite file to yhe vnc base file script. However the same approach is not working with the function for the send ctrl alt fn krys as ot gives me that rfb is not defined when I move it in the vnc base. If I left them in vnc lite file they are not working at all.

@catborise
Copy link
Collaborator

okey i missed function keys to add for vnc.
it is working with spice but not vnc. i will correct it... thanks

@lord-kyron
Copy link
Contributor Author

lord-kyron commented Aug 16, 2018

Your latest chage uploaded some necessary files, but still when I clone your repo and try to use vnc I am getting:
Uncaught SyntaxError: The requested module '/static/js/novnc/core/rfb.js' does not provide an export named 'default'
in the browser console and the VNC screen is stuck on loading.
Fulscreen button is not doing anything again, but it is also not throwing any errors in the browser console.
Send ctrlAlt FN is again not working, but giving this error:
VM231:146 Uncaught ReferenceError: sendCtrlAltFN is not defined at HTMLLIElement.onclick (VM231:146)

Please, check!

@catborise
Copy link
Collaborator

there is a problem with typescript 6 build operation. lite version of console access does not work. novnc suggest that compile files with npm for speed.. i did it but some other issues appeared. i am workin on it.

@lord-kyron
Copy link
Contributor Author

Great, thank you! I will be waiting for the working version. I've downloaded and install with npm the latest version of noVNC from their repo already and it is working for me but after may tries I managed to make only the fulscreen button to work. The FN keys are still not working and I gave up on them, so I will be very grateful if you make it work out-of-the-box!
Thank you for the time you spend on this one!
Please, when you have some more time check on my request about the visual modifications that I suggested!

@lord-kyron
Copy link
Contributor Author

@catborise - any success fixing the noVNC issues?

@catborise
Copy link
Collaborator

it is fixed. it takes time to fix because of vacation. sorry.
for now it should work.

@lord-kyron
Copy link
Contributor Author

Still not working for me for some reason. I will explain the case to you - I am using nginx as reverse proxy to get access to vns websocket over port 443. It is working with the initial old verision fo the retspen repo. It was even working when your first commit was borken and I used the novnc git version. But now after your commit from today it is not working. I did not changed anything it the way I am reverse proxying the websockets, it just wont work this time. I left with ome feeling that the novc app itself is not working as expected as the message this time is 1006 - connection closed. all times.
I am running over https strictly as I cannot test over port 80 http but I think it will be the same.
I order to reverse proxy the websockets I am injecting a location into the vnc url to active the proxy. This was working util today. However, I cannot see where the problem can be with nginx or even with the URL. Can you please double check if have not forget to commit something or add some files like last time? Are you able to test the VNC is working on your side also?

@catborise
Copy link
Collaborator

there is nothing much changed. novnc version is same like git version. i only add sending ctrl alt fn function...

you should check error with chrome tools(open vnc console page and right click to inspect) If there is an error it shows.
Did you reload all javascripts with ctrl-f5 ?

@lord-kyron
Copy link
Contributor Author

Yes already checked with console of chrome. It gives several warnings but the only error is 1006 connection closed. I am able to telenet to port 6080 of the localhost which means that novnc is maybe running there but it wont open. Before I made my two rows of modifications to inject a location into the url for the proxying it was giving me error that cannot connect to this url and stuff, but after I did those same modifications I was using before it seems like connecting and being closed immediately.

@catborise
Copy link
Collaborator

can you please run the "novncd" with --debug --verbose..
firstly, stop novncd which is run with webvirtcloud . (kill it)
then start it with specified parameters.
example;
/srv/webvirtcloud/venv/bin/python /srv/webvirtcloud/console/novncd -d -v

then try to open console with web browser. check output of novncd, if there is anything unusual

@lord-kyron
Copy link
Contributor Author

`/srv/webvirtcloud/venv/bin/python /srv/webvirtcloud/console/novncd -d -v
2018-08-28 07:16:28,244 - websocket.type - INFO : WebSocket server settings:
2018-08-28 07:16:28,244 - websocket.type - INFO : - Listen on 0.0.0.0:6080
2018-08-28 07:16:28,244 - websocket.type - INFO : - Flash security policy server
2018-08-28 07:16:28,245 - websocket.type - INFO : - SSL/TLS support
2018-08-28 07:16:28,245 - websocket.type - INFO : - proxying from 0.0.0.0:6080 to ignore:ignore
2018-08-28 07:16:55,892 - websocket.type - DEBUG : 192.168.1.125: new handler Process
2018-08-28 07:16:55,899 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:55] "GET /novncd/:443/websockify?token=1-75cb7be4-0dd4-4e7a-a56f-918b25ef9eee HTTP/1.1" 101 -
2018-08-28 07:16:55,901 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:55] 192.168.1.125: Plain non-SSL (ws://) WebSocket connection
2018-08-28 07:16:55,902 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:55] 192.168.1.125: Version hybi-13, base64: 'False'
2018-08-28 07:16:55,903 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:55] 192.168.1.125: Path: '/novncd/:443/websockify?token=1-75cb7be4-0dd4-4e7a-a56f-918b25ef9eee'
2018-08-28 07:16:55,922 - root - DEBUG : Connection infos :

  • connhost : 'localhost'
  • connport : '22'
  • connuser : 'qemu'
  • conntype : '1'
  • console_host : '127.0.0.1'
  • console_port : '5901'
  • console_socket : 'None'

2018-08-28 07:16:55,923 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:55] Need a tunnel to access console but can't mount one because it's not a SSH host
2018-08-28 07:16:55,924 - websocket.type - INFO : handler exception: <bound method NovaProxyRequestHandler.msg of <main.NovaProxyRequestHandler object at 0x7f76e808ff90>>
2018-08-28 07:16:55,924 - websocket.type - DEBUG : exception
Traceback (most recent call last):
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 930, in top_new_client
client = self.do_handshake(startsock, address)
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 860, in do_handshake
self.RequestHandlerClass(retsock, address, self)
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 114, in init
SimpleHTTPRequestHandler.init(self, req, addr, server)
File "/usr/lib/python2.7/SocketServer.py", line 652, in init
self.handle()
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 581, in handle
SimpleHTTPRequestHandler.handle(self)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 543, in do_GET
if not self.handle_websocket():
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 531, in handle_websocket
self.new_websocket_client()
File "/srv/webvirtcloud/console/novncd", line 222, in new_websocket_client
self._new_client(daemon, socket_factory)
File "/srv/webvirtcloud/console/novncd", line 162, in _new_client
raise Exception(self.msg)
Exception: <bound method NovaProxyRequestHandler.msg of <main.NovaProxyRequestHandler object at 0x7f76e808ff90>>
2018-08-28 07:16:55,928 - websocket.type - DEBUG : Ignoring interrupted syscall
2018-08-28 07:16:56,524 - websocket.type - DEBUG : 192.168.1.125: new handler Process
2018-08-28 07:16:56,530 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:56] "GET /novncd/:443/websockify?token=1-75cb7be4-0dd4-4e7a-a56f-918b25ef9eee HTTP/1.1" 101 -
2018-08-28 07:16:56,532 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:56] 192.168.1.125: Plain non-SSL (ws://) WebSocket connection
2018-08-28 07:16:56,533 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:56] 192.168.1.125: Version hybi-13, base64: 'False'
2018-08-28 07:16:56,535 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:56] 192.168.1.125: Path: '/novncd/:443/websockify?token=1-75cb7be4-0dd4-4e7a-a56f-918b25ef9eee'
2018-08-28 07:16:56,553 - root - DEBUG : Connection infos :

  • connhost : 'localhost'
  • connport : '22'
  • connuser : 'qemu'
  • conntype : '1'
  • console_host : '127.0.0.1'
  • console_port : '5901'
  • console_socket : 'None'

2018-08-28 07:16:56,555 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:56] Need a tunnel to access console but can't mount one because it's not a SSH host
2018-08-28 07:16:56,555 - websocket.type - INFO : handler exception: <bound method NovaProxyRequestHandler.msg of <main.NovaProxyRequestHandler object at 0x7f76e808ff90>>
2018-08-28 07:16:56,555 - websocket.type - DEBUG : exception
Traceback (most recent call last):
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 930, in top_new_client
client = self.do_handshake(startsock, address)
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 860, in do_handshake
self.RequestHandlerClass(retsock, address, self)
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 114, in init
SimpleHTTPRequestHandler.init(self, req, addr, server)
File "/usr/lib/python2.7/SocketServer.py", line 652, in init
self.handle()
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 581, in handle
SimpleHTTPRequestHandler.handle(self)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 543, in do_GET
if not self.handle_websocket():
File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/websockify/websocket.py", line 531, in handle_websocket
self.new_websocket_client()
File "/srv/webvirtcloud/console/novncd", line 222, in new_websocket_client
self._new_client(daemon, socket_factory)
File "/srv/webvirtcloud/console/novncd", line 162, in _new_client
raise Exception(self.msg)
Exception: <bound method NovaProxyRequestHandler.msg of <main.NovaProxyRequestHandler object at 0x7f76e808ff90>>
2018-08-28 07:16:56,558 - websocket.type - DEBUG : Ignoring interrupted syscall`

this is all. It seems there is some problem, but I don't get what.

@catborise
Copy link
Collaborator

does webvirtcloud run on a kvm host?

@catborise
Copy link
Collaborator

expected output example(webvirtcloud run on a vm);

/srv/webvirtcloud/venv/bin/python /srv/webvirtcloud/console/novncd -d -v
2018-08-28 10:33:43,621 - websocket.type - INFO : WebSocket server settings:
2018-08-28 10:33:43,621 - websocket.type - INFO : - Listen on 0.0.0.0:6080
2018-08-28 10:33:43,621 - websocket.type - INFO : - Flash security policy server
2018-08-28 10:33:43,621 - websocket.type - INFO : - No SSL/TLS support (no cert file)
2018-08-28 10:33:43,622 - websocket.type - INFO : - proxying from 0.0.0.0:6080 to ignore:ignore
2018-08-28 10:33:58,216 - websocket.type - DEBUG : 192.168.192.6: new handler Process
2018-08-28 10:33:58,309 - websocket.type - INFO : 192.168.192.6 - - [28/Aug/2018 10:33:58] "GET /websockify?token=4-2b1f7b9e-f95a-4e52-b997-e69fc6611131 HTTP/1.1" 101 -
2018-08-28 10:33:58,310 - websocket.type - INFO : 192.168.192.6 - - [28/Aug/2018 10:33:58] 192.168.192.6: Plain non-SSL (ws://) WebSocket connection
2018-08-28 10:33:58,310 - websocket.type - INFO : 192.168.192.6 - - [28/Aug/2018 10:33:58] 192.168.192.6: Version hybi-13, base64: 'False'
2018-08-28 10:33:58,311 - websocket.type - INFO : 192.168.192.6 - - [28/Aug/2018 10:33:58] 192.168.192.6: Path: '/websockify?token=4-2b1f7b9e-f95a-4e52-b997-e69fc6611131'
2018-08-28 10:33:58,339 - root - DEBUG : Connection infos :

  • connhost : '10.20.30.108'
  • connport : '22'
  • connuser : 'webvirtmgr'
  • conntype : '1'
  • console_host : '0.0.0.0'
  • console_port : '5911'
  • console_socket : 'None'

2018-08-28 10:33:58,340 - websocket.type - INFO : 192.168.192.6 - - [28/Aug/2018 10:33:58] connecting to: 10.20.30.108:5911

Traffic Legend:
} - Client receive
}. - Client receive partial
{ - Target receive

>  - Target send
>. - Target send partial
<  - Client send
<. - Client send partial

@lord-kyron
Copy link
Contributor Author

Yes it is running on the KVM host and I even have some VMs with VNC ports there.
Strange is when I deploy the original retspen version of vnc the same config with the same proxing over 443 is working fine and the console is opening fine.

@catborise
Copy link
Collaborator

yes, strange it is.
i made tests with two different webvirtcloud installation, there is not any problem. it is working smootly.

problem key statement is: websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 07:16:56] Need a tunnel to access console but can't mount one because it's not a SSH host

@catborise
Copy link
Collaborator

could you check it with spice?

open virt-manager. select any vm, enter configuration.
image

change vnc to spice server.
make video vga
(it is required shutdown vm and start it again after changes)

@lord-kyron
Copy link
Contributor Author

lord-kyron commented Aug 28, 2018

I will try but I need some more time to set it up.
However - I think for some reason despite starting the novnc with /srv/webvirtcloud/console/novncd it is not taking the settings there.
I've made a test and changed some setting in this file - like connhost and cert and other and despite I've changed it it is still starting with the same settings as before and obviously not working as expected.
Example is that I've changed connhost which is set to be the same as WS_HOST directly to "0.0.0.0" but it is still telling me that connhost is "localhost" not 0.0.0.0

`2018-08-28 08:02:19,641 - root - DEBUG : Connection infos :

  • connhost : 'localhost'
  • connport : '22'
  • connuser : 'qemu'
  • conntype : '1'
  • console_host : '127.0.0.1'
  • console_port : '5901'
  • console_socket : 'None'`

But when the console is started on the other side, I get:
2018-08-28 08:17:24,115 - websocket.type - INFO : WebSocket server settings: 2018-08-28 08:17:24,115 - websocket.type - INFO : - Listen on 0.0.0.0:6080 2018-08-28 08:17:24,115 - websocket.type - INFO : - Flash security policy server 2018-08-28 08:17:24,116 - websocket.type - INFO : - SSL/TLS support 2018-08-28 08:17:24,116 - websocket.type - INFO : - proxying from 0.0.0.0:6080 to ignore:ignore
It seems the problem is when it tries to connect.

Also another strange thing - it is telling me:
2018-08-28 08:02:19,097 - websocket.type - INFO : 192.168.1.125 - - [28/Aug/2018 08:02:19] 192.168.1.125: Plain no n-SSL (ws://) WebSocket connection
which is not true. I have configured a local certificate which I am using both for nginx httpsd and for the VNC connection encryption and it is configured in all config files where it needs to be. Even in /srv/webvirtcloud/console/novncd on the top.

@lord-kyron
Copy link
Contributor Author

I think this guy is describing something similar but there is no fix described:
retspen/webvirtmgr#595

@lord-kyron
Copy link
Contributor Author

lord-kyron commented Aug 28, 2018

I've made it work, but I have a strange behaviour now.
The VM xml was configure to listen for VNC to 127.0.0.1
I've changed that to 0.0.0.0 and it worked and now it is opening the console.
It is just strange as it is opening like 2 console windows in the same html page one under the another.
I am attaching a picture to get what I am saying. I've zoomed out the browser so that the two windows can be visible.
screenshot from 2018-08-28 11-40-35
DO you have any idea why this is hapnening and how can it be fixed? Something in the HTML or?
Everything else, like FN keys and fullscreen is working fine now!

@catborise
Copy link
Collaborator

catborise commented Aug 28, 2018

i think i find your error is related with console_host.
your "console_host" = 127.0.0.1 and it causes that error.
you can change it from vm xml (127.0.0.1 -> 0.0.0.0)
or enable vnc listen from:
/etc/libvirt/qemu.conf
vnc_listen = "0.0.0.0"
spice_listen = "0.0.0.0"
sed -i 's/#vnc_listen/vnc_listen/g' /etc/libvirt/qemu.conf
sed -i 's/#spice_listen/spice_listen/g' /etc/libvirt/qemu.conf
then restart libvirt(it is safe to restart)

// retspen/webvirtmgr#595
i think it is resolved with console/view.py modification of specified issue
ws_port = console_websocket_port if console_websocket_port else WS_PORT ws_host = WS_PUBLIC_HOST if WS_PUBLIC_HOST else request.get_host()

in the view.py it tries to get websocket port from vm config. if it is not specified with vm config it sets default one which is 6080(settings.py)

(you write before me :) )

@lord-kyron
Copy link
Contributor Author

Yes, great! It solves the issue. I just need to set my VMs to listen to 0.0.0.0 in xml!
And what about the two console screens in the html that are opening?
I've attached a screenshot above.

@catborise
Copy link
Collaborator

whats that :))))))))))))))))) mine is like that. i havent noticed before 👍
i am checking now :) it is hillarious

@catborise
Copy link
Collaborator

by the way, can you please check vnc console from instance details i add full vnc console option to vm.
enter instance detail -> access -> console-dropdown -> console-full

@lord-kyron
Copy link
Contributor Author

I cannot see such option in my setup. But my setup is kind of a big mix. However, I am using your HTMLs for console, but I am not sure I use them for instance details.
Can you give me refenrece where the change is

@lord-kyron
Copy link
Contributor Author

@catborise I was able to find the html where you expose this functionality and added it to my setup but full console is opening and not working.
It gives me failed to connect to server.

@lord-kyron
Copy link
Contributor Author

lord-kyron commented Aug 28, 2018

@catborise man. it is working. My mistake - I've fogot to add the value for the proxy path to the URL of the full vnc html file. I've done this and it is working like a charm now.
So - the only problem here is to fix the two screens in the vnc lite html
Found anything related to it?

P.S. - and wanted to ask you is there a way (or if it is already possible - how?) to get the URL for the console so that I can open it with some desktop application, not only from web?

@catborise
Copy link
Collaborator

because of specified script it calls a function twice. so it produces two same console app.
loader.src = "{% static "js/novnc/vendor/browser-es-module-loader/dist/browser-es-module-loader.js" %}";

in vnc-lite.html, specified script statement should be true...

<script type="module"> window._noVNC_has_module_support = false;</script>

i am committing now.

@lord-kyron
Copy link
Contributor Author

@catborise - you are great man!
Thanks, everything is working as expected now!
I guess you can open a merge request to the master repo now!
I am closing the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants