Rice PVE Login and Banener

If you want to show Copyright and other warning or display system information in the Login or Banner Page, you definitely can do it.

Share
Rice PVE Login and Banener
Photo by Jennie Razumnaya / Unsplash

You might want some additional information or logos displayed at Login or at the local terminal.

Changing the MOTD login screen

You should NOT modify the /etc/motd file.
You need to use a systemd executable and timer for it to be stable and useful.

Get started

Make a copy of the current file

cp /etc/motd /etc/motd.orig

Restore by: mv /etc/motd.orig /etc/motd

Create a New Message Of The Day MOTD

The base file

Create a file with the things you want to add to the standard Debian motd file

nano /usr/local/bin/motd
#!/usr/bin/env bash

printf "\nSystem Info:\n" >> /etc/motd
printf '%s\n' '---' >> /etc/motd
hostnamectl >> /etc/motd
printf "\nSystem IPs:\n" >> /etc/motd
printf '%s\n' '---' >> /etc/motd
ip r >> /etc/motd
printf "\n" >> /etc/motd

The service file

nano /usr/local/bin/motd
[Unit]
Description=Generate System Info for motd
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/motd

[Install]
WantedBy=default.target

The timer

nano /etc/systemd/system/motd.timer
[Unit]
Description=Generate System Information for motd

[Timer]
Persistent=true
OnBootSec=1m
OnActiveSec=1h

[Install]
WantedBy=timers.target

Proxmox Banner

The local terminal is quite boring with its

Welcome to the Proxmox Virtual Environment. Please use your web browser to
configure this server - connect to:

  https://192.0.2.40:8006/

Edit it

The final banner text is stored in /etc/issue, but you should NOT change this file for stable output.
Instead, edit and change the script which produces the content for it:
the file is /usr/bin/pvebanner.

------------------------------------------------------------------------------

Welcome to the Proxmox Virtual Environment. Please use your web browser to
configure this server - connect to:

  vmbr0 - https://\4{vmbr0}:8006/
  vmbr1  - https://\4{vmbr1}:8006/

------------------------------------------------------------------------------

Backup the file before editing

To modify the /usr/bin/pvebanner file we can use the following command to back it up first then edit it

cp /usr/bin/pvebanner /usr/bin/pvebanner.orig

Edit the file

nano /usr/bin/pvebanner 

Here you can add anything you like before the __EOBANNER, and it will stay until an update change it back.

if ($localip) {
    $banner .= <<__EOBANNER;

$xline

Welcome to the Proxmox Virtual Environment. Please use your web browser to
configure this server - connect to:

  https://${localip}:8006/

$xline

__EOBANNER

}

Other

This will guide you through the steps required to replace the logo, favicon, and boot screen (as seen in the console when booting a virtual machine) on Proxmox VE.

mkdir -p /usr/share/custom/backup
cp /usr/share/pve-manager/images/{favicon.ico,logo-128.png,proxmox_logo.png} /usr/share/custom/backup/
cp /usr/share/qemu-server/bootsplash.jpg /usr/share/custom/backup/

Make sure your new images match the specifications:

  • bootsplash.jpg should be 640x480 pixels
  • favicon.ico should be 64x64 pixels
  • logo-128.png should be 128x128 pixels with a transparent background
  • proxmox_logo.png should be 172x30 pixels with a transparent background

Show as Server by hostnamectl

To change from Chassis: desktop đŸ–Ĩī¸ to Chassis: server đŸ–ŗ:

hostnamectl set-chassis "server"

Add the images

Replace the images on your server by running scp, from within the directory of your new images

scp {bootsplash.jpg,favicon.ico,logo-128.png,proxmox_logo.png} [email protected]:/usr/share/custom/

Add Customization to Change the Images

Run the following command to add the customization to the script apply.sh:

echo "cp -f /usr/share/custom/{favicon.ico,logo-128.png,proxmox_logo.png} /usr/share/pve-manager/images/" >> /usr/share/custom/apply.sh
echo "cp -f /usr/share/custom/bootsplash.jpg /usr/share/qemu-server/" >> /usr/share/custom/apply.sh

Apply Customizations

Finally, apply the new one from above:

sh /usr/share/custom/apply.sh

You should now have your custom logos and boot screen.

Static Badges for Notes-pages

The static badge accepts a single required path parameter which encodes either:

# Pve 48
[![HTTPS](https://img.shields.io/badge/https-192.0.2.48-orange.svg)](https://192.0.2.48:8006)

[ssh](ssh://192.0.2.48)<br>
[![SSH](https://img.shields.io/badge/ssh-192.0.2.48-red.svg)](ssh://user:[email protected])
  • Label, message and color separated by a dash -. For example:
any text: you like
- https://img.shields.io/badge/any_text-you_like-blue
  • Message and color only, separated by a dash -. For example:
just the message
- https://img.shields.io/badge/any_text-you_like-blue
URL inputBadge output
Underscore _ or %20Space  
Double underscore __Underscore _
Double dash --Dash -

Examples of additional options:

Logo:

logo: GitHub
- https://img.shields.io/badge/github-repo-blue?logo=github

Color (named):

color: orange
- https://img.shields.io/badge/coverage-95%25-orange

Style:

style: for-the-badge
- https://img.shields.io/badge/build-passing-brightgreen?style=for-the-badge

Hex, RGB, RGBA, HSL, HSLA and CSS named colors may be used. Note: Some named colors may differ from CSS color values. For a list of named colors, see the badge-maker readme.

Add temperature to the GUI

Read the PVE-MODS-notes and configure as needed by your system. See my post.

Example of a Proxmox node edited Notes section


Pve-41

@ Lab-B


Static Badge

Static Badge


Remove the nagging popup

My preferred way is to use the Melinox PVE-MODS script,
it has Install and Uninstall options.

But, you can use a sed -command:

sed -i.backup -z "s/res === null ||\n\s* res === undefined ||\n\s* \!res ||\n\s* res.data.status.toLowerCase() \!== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service

You need to re-install the Proxmox Widget Toolkit to uninstall the fix.



References

Shields.io Badges [1]


  1. Shields.io homepage, Static Badge, JSON Badges , Dynamic TOML Badge, Dynamic XML Badge, Dynamic YAML Badge, Endpoint Badge â†Šī¸Ž