Proxmox No Subscription Nag

Who hates the Proxmox nagging screen? We all do. Working on corporate systems you do not see it, but at home it's there every time you need to log in to the GUI. This is how you get rid of the Proxmox No Subscription Notice screen. How to use SSH keys.

Proxmox No Subscription Nag
Photo by NEOM / Unsplash

If you use the GUI a lot, you might get frustrated to click the ok on this notification. For me, it hasn't been a problem until recently. I have been working in GUIs for the past week doing a ton of tests, upgrades, and tuning. The way Proxmox do it is vulgar, I prefer the polite way Portainer and others do it, just a remainder somewhere on the page, it can be in bright colors or not, but it does not interfere with your work. If I could afford I would get a basic license but having 9 servers, most with 2 CPUs, it's too expensive for a retired person.

I love free software and consider it as free advice — not free beer 🍺. Supporting any FOSS project is important, and I do contribute when I can or give them a star ⭐ or I make some monetary contribution. In my opinion if we only consume and not contribute it will kill the free and open movement.

The horrible nagging screen we all hate.

Prerequisites and Recommendations

Use the No-subscription repo. I recommend to use SSH, but you can use the console from the GUI.
It's recommended to have your SSH-keys on the server. Using the SSH config and agent will make your life easier.

ssh-copy-id -i ~/.ssh/id_ed25519.pub <Address of Server>

Example of how to copy a key. Please use individual passwords and keys for each server.

Edit the SSH-config file in your .ssh folder add a server like this

Host pve-100
  HostName pve-100.example.com
  User theboss
  IdentityFile ~/.ssh/pve100

Start the SSH agent

eval "$(ssh-agent -s)"

Add your key to the SSH agent by

ssh-add ~/.ssh/id_ed25519

Warnings and Notes

⚠️ When you update Proxmox, you might need to redo this modification

⚠️ This modification will probably break the GUI Updates page notifications

    • A “No updates available.” message all time, even if there is one
    • Do updates over SSH by apt update && apt dist-upgrade -y 👈

⚖️ Using this in a commercial environment may be illegal

ℹ️ This modification is reversible

ℹ️ This should work on any install from 5.1 – 8.1 is tested

Do the Modification

  1. Change to the right directory and make a backup
cd /usr/share/javascript/proxmox-widget-toolkit
cp proxmoxlib.js proxmoxlib.js.orig
  1. Edit the file nano proxmoxlib.js and locate the code (ctrl+w to search for “No valid subscription”)
Ext.Msg.show({
  title: gettext('No valid subscription'),
  1. Replace text to look like this (insert void({ // at the beginning of the line)
void({ //Ext.Msg.show({
  title: gettext('No valid subscription'),
  1. Restart the Proxmox web service
systemctl restart pveproxy.service

Check in a private window if it works, or clear your browser cache, depending on the browser you may need to open a new tab or restart the browser.

Using the sed -command

This is combined into a sed command: sed -Ezi.bak "s/(Ext.Msg.show({\s+title: gettext('No valid sub)/void({ //\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service

Revert the Modification

  1. Edit the file to undo the changes you made
    1. nano /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
  2. Restore the backup file you created
    1. mv /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.orig /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
  3. Reinstall the proxmox-widget-toolkit package from the repository
    1. apt-get install --reinstall proxmox-widget-toolkit

💡
You have been warned about legal ⚖️ and functionality issues 🧰

GitHub - Jamesits/pve-fake-subscription: Disables the “No valid subscription” dialog on all Proxmox products.
Disables the “No valid subscription” dialog on all Proxmox products. - Jamesits/pve-fake-subscription

Another way

First ssh into the node as root.

You need to edit the file one proxmoxlib.js.

nano /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

Search for the function responsible for the subscription status. In nano, you can press Ctrl + W to open the search function and search for NoValidSubscription.

if (res === null || res === undefined || !res || res.data.status.toLowerCase() !== 'active') {
    Ext.Msg.show({
        title: gettext('No valid subscription'),
        icon: Ext.Msg.WARNING,
        message: Proxmox.Utils.getNoSubKeyHtml(res.data.url),
        buttons: Ext.Msg.OK,
        callback: function(btn) {
            if (btn === 'ok') {
                console.debug('User acknowledged no subscription message');
            }
        }
    });
}

The part of the file responsible for the nag screen.

Comment out the code that displays the nag screen, use //.

// if (res === null || res === undefined || !res || res.data.status.toLowerCase() !== 'active') {
//    Ext.Msg.show({
//        title: gettext('No valid subscription'),
//        icon: Ext.Msg.WARNING,
//        message: Proxmox.Utils.getNoSubKeyHtml(res.data.url),
//        buttons: Ext.Msg.OK,
//        callback: function(btn) {
//            if (btn === 'ok') {
//                console.debug('User acknowledged no subscription message');
//            }
//        }
//    });
// }