cockpit-project / cockpit-machines

Cockpit UI for virtual machines
GNU Lesser General Public License v2.1
281 stars 73 forks source link

Virtual Machines -> Console -> Desktop Viewer enhanced to support vnc:// urls #1775

Open paul-hammant opened 3 weeks ago

paul-hammant commented 3 weeks ago

Pertinent RFC - https://www.rfc-editor.org/rfc/rfc7869.html

From the UI for a VM when looking at the console, and about to launch "desktop viewer"

image

For some reasons for me on my Ubuntu 24.04 machine with virt-viewer installed and orginarily working on it's own, when I click the blue launch button, a download is initiate of a file called download with no .vv suffix for some reason. Chrome doesn't know what do to with it so it is just placed in ~/Downloads. It could bebetter as <vmname>.vv instead of download.

Point of the feature request: IMO it would be best if it were: vnc://<hostname>:590x/more-args-for-that-vm

garrett commented 1 week ago

I thought for sure it was using a .vv extension for this file. This is probably either a regression or some change in browser behavior.

As far as vnc://, that still isn't supported in browsers.

Status of This Memo

This document is not an Internet Standards Track specification; it is published for informational purposes.

I tried it again in both Firefox and Chrome just now and it does nothing but redirect to a search engine. We can't add support for that in Cockpit until browsers actually support it first. (This is why the .vv file format exists, as a launcher workaround to not having a vnc:// URL.)

paul-hammant commented 1 week ago

Good point.

jelly commented 1 week ago

Fixing the filename would be nice, the download code is located in fileDownload, currently it uses an iframe to download with a data url (The notes in the code says this is due to CSP issues with a normal anchor link). This likely? does not support naming the downloaded filename.

Maybe we can switch the button to be a real anchor with a download attribute which is $vmname.vv