How can I create a browser bookmark that will open the NoVNC console to a VM with one click ?

shodan

Member
Sep 1, 2022
51
20
13
Example, if I pop out the console out of the proxmox interface,
I get a standalone window with URL

https://proxmox.lan:8006/?console=k...mname=Win2k19SRV&node=proxmox&resize=off&cmd=

However, strangely bookmarking this URL, won't just open the NoVNC console to VM8 on node proxmox

There's seem to be an anti-automatic mechanism to prevent this possibility.

Is there a proper way to make a "one click console browser bookmark" ?

I'm ok with disable any and all safety features in this installation, it's not connected to the internet and contains no sensitive data.
But it has to be convenient to use and so I need to open the console with one click, in the browser, preferably without installing more software ?

A link to a script on my desktop, I could live with that, if that's the only way to defeat the anti-automation mechanism.

Thank you !

Here is the what the window looks like

1686521834735.png
 
the bookmark should work, but only if you're logged in the pve webgui beforehand. if the saved ticket is expired, it won't work
there is no way to change this behaviour
 
  • Like
Reactions: Gilberto Ferreira
Hi,

I'm giving another try at proxmox and I am wondering if there is further documentation available regarding using novnc in browser.

For starters I would like to create browser bookmarks to one-click access any of my VMs.

So far I made a bookmark like


https://proxmox.lan:8006/?console=kvm&novnc=1&vmid=101&vmname=test&node=proxmox&resize=off&cmd=

console=kvm&novnc=1&vmid=101&vmname=test&node=proxmox&resize=off&cmd=

and I would like to know what are the valid options to setup in this URL ?

What I really want is to have "autoresize window" always off

And I think I want scaling mode set to local scaling (not off) (not sure if I want auto or not !?)

Also, this next part isn't really proxmox, but I'm using firefox, and I would like these bookmarks to open in a window that is
without the bookmark toolbar
without the addressbar visible

In fact, if it were possible I would like an entirely borderless window (I use alt snap so I can handle window without no decorations easily)
 
Hi,


I've made some progress

I've found almost all I wanted can be achieved with something called a bookmarklet, which is a bookmark that contains some javascript code

Here is one of the bookmarklet I am using

Code:
javascript:(function(){window.open('https://proxmox.lan:8006/?console=kvm&novnc=1&vmid=102&vmname=win10test&node=proxmox&resize=scale','postwindow','width=800,height=600,menubar=no,toolbar=no,location=no,personalbar=no,status=no,scrollbars=yes,resizable=yes');})();

This creates a new window that contains the novnc client of that VM and it works great except
It will even be resizable and have local scaling turned on by default !

However, I could not find a way to hide the useless address bar

I searched around

Code:
https://support.mozilla.org/en-US/questions/1049872
https://support.mozilla.org/en-US/questions/1292666
https://stackoverflow.com/questions/2909645/open-new-popup-window-without-address-bars-in-firefox-ie
https://mybyways.com/blog/remove-address-bar-in-firefox-windows
https://old.reddit.com/r/FirefoxCSS/comments/w62tik/how_do_i_start_firefox_in_a_single_window_with/
https://old.reddit.com/r/firefox/comments/li2lqg/now_that_mozilla_killed_the_ssb_feature_what/
https://old.reddit.com/r/firefox/comments/tpzdw9/is_there_a_way_to_tell_firefox_not_to_have_a/

Apparently this was called the SSB feature, and it was killed at some point.
Some suggested setting to true the value dom.disable_window_open_feature.location in about:config, but this does nothing.
There may be a CSS way of doing this, but I don't know how at this time.


Another issue

The bookmarklet MUST be clicked from a window that has an opened proxmox tab AND this proxmox tab must have seen the novnc console of one of the VM beforehand (possibly within a delay). So that makes the whole shortcuts to VM thing really clunky, is there any way to disable all security and let these work without any of this ticketing system stuff ?


Here are some various errors I encountered when clicking the bookmark from another window or a proxmox tab that hasn't opened a console recently etc..

1725882139798.png

1725882146701.png

1725882153891.png
 
So you're basically asking about allowing to let just anyone who can come onto your network to log into your system as root and mess everything up, just so you don't have to log in? [/sarcasm]

The ticketing/token system is there for security and credential-management, it's purposefully hard to circumvent, or it would be/probably cause a large security-breach.

That said, if you are scripting now already anyway, why not have it open up your browser to one of your VM's vnc-pages in-browser AND then after like 1-2 second open up the popup? Not familiar with how powerfull the bookmarklet is, but the actions itself should be possible I would think.
With that it gives the browser enough time to generate the token if you are logged in, and if not you already have a page ready to log in behind your popup.

Also a sidenote, it COULD in part also be caused by you accessing the server via an IP instead of a name with valid DNS. If you don't want to pay for a proper dns/certificate, you could always try and generate a self-signed certificate with a name you put into your system's host-file, and import that in your trusted certificate list. Sites with invalid certificate often get extra restrictions laid upon them by modern, secure web browsers.
 
In all my trials I used the dns (proxmox.lan:8006)

It might be something like this

Code:
javascript:(function(){    window.open('https://proxmox.lan:8006', '_self');    setTimeout(function(){        window.open('https://proxmox.lan:8006/?console=kvm&novnc=1&vmid=102&vmname=win10test&node=proxmox&resize=scale','postwindow','width=800,height=600,menubar=no,toolbar=no,location=no,personalbar=no,status=no,scrollbars=yes,resizable=yes');    }, 3000); })();

However, that doesn't work, no longer opens a new window, but a new tab, with proxmox.lan (and now it asks the login+pass weirdly enough, since my regular proxmox.lan doesn't need it)

Bookmarklets are very limited and I just don't think they can still do anything after a page refresh/ page load

So yes, I don't need this security feature at all, how can I just disable it entirely ?
 
Sorry, somehow missed the part that you already are using a dns-name, but given the exclamation-mark next to the lock-icon it looks like the certificate used is not trusted still.

As for the how-to-disable part, let me re-quote what the staff already said:
if the saved ticket is expired(/not there), it won't work
there is no way to change this behaviour
And even if it was, I wouldn't know how to (nor would I personally want to even try to figure it out)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!