This Proxmox script makes updating my VMs and LXCs so much easier

1 week ago 2

From its compatibility with Ceph storage and a dedicated backup utility to native support for LXCs and ZFS pools, Proxmox has several advantages over its rivals. However, Proxmox’s massive community is its most underrated perk, as you’ll find plenty of third-party resources to unleash the full potential of this virtualization platform.

But aside from the standard documentation pages, guides, and tutorials, the Proxmox community has created several noteworthy scripts that can simplify your home lab projects. There’s developer luchina-grabriel’s OSX-Proxmox script, which lets you build a Hackintosh on Proxmox. Likewise, you’ve got Proxmox VE Helper-Scripts designed by tteck (and managed by the community after his passing), a repository that includes all the commands to build a formidable self-hosting Proxmox server.

Then there’s the Ultimate Updater script by BassT23 that provides a painless method for updating all the virtual guests on your PVE node.

Accessing the Proxmox web UI from a laptop

Related

These 6 scripts are a godsend for my Proxmox home lab

The Proxmox VE Helper-Scripts repository adds a lot of quality-of-life facilities to my PVE server

Installing it is a walk in the park

Just run a couple of commands, and voilà

Running the script to install the Ultimate Updater on Proxmox

Like most other Proxmox scripts, Ultimate Updater has a fairly simple installation process. Once you head to the Shell tab of your PVE node, all you have to do is execute the bash https://raw.githubusercontent.com/BassT23/Proxmox/master/install.sh) command and wait for the script to work its magic.

Agreeing to install the Ultimate Updater package

If you want extra stylish points, you could follow my example and press y two times to install a slick welcome screen that includes the Neofetch CLI utility that Linux enthusiasts (including yours truly) drool over.

Running the Ultimate Updater script on Proxmox

Once you’re ready to run the Ultimate Updater, you can simply type update into the terminal. This will result in the script creating a snapshot (in case the new packages break the LXC or VM) before updating the packages of your virtual guests. Without any extra parameters, the script will continue to run until it has finished updating all your virtual machines and containers.

Me? I’d rather not update all my containers, as I don’t want to deal with the other denizens of my house getting mad when Jellyfin, Pi-hole, or other essential containers break due to broken container packages. A simple way to avoid this conundrum involves adding the IDs of the virtual guests I plan to update after the update command, but there’s a more efficient method to accomplish this (and I’ll get to it in a minute).

The Ultimate Updater lives up to its name

It’s compatible with every LXC template out there

Running the Ultimate Updater script on Proxmox

By default, Proxmox includes TurnKey templates for a variety of services, ranging from full-fledged OS images to neat utilities like Nextcloud, ZoneMinder, Game Server, and Ansible. Then there's the LXC and VM templates you can deploy via Proxmox VE Helper-Scripts repository, If you’re anything like me, your self-hosted PVE stack includes services deployed using this amazing repo.

Turns out, the Ultimate Updater script works with Proxmox LXCs regardless of the method used to deploy them. Just make sure your TurnKey containers have a static or dynamic IP address assigned to them via the Proxmox GUI, or you might encounter an error when the script tries to update the packages.

With a little tinkering, it can even update virtual machines

So far, I’ve talked about LXCs and their templates, but this neat script works with VMs… though you’ll have to configure a couple of settings. I chose the QEMU Guest Agent route, which is pretty easy to set up but results in a rather lackluster UI (at least, compared to the SSH + key authentication method).

If you want to follow my example, you’ll have to enable the Use QEMU Guest Agent and Run guest-trim after a disk move or guest migration toggles inside the Options tab of your favorite VMs. After that, you’ll have to log into their respective Console tabs and execute the following commands to install and run the qemu-guest-agent package.

  • sudo apt install qemu-guest-agent -y
  • sudo systemctl start qemu-guest-agent

To save further hassle, I recommend running systemctl enable command to start the qemu-guest-agent service every time the VMs boot up.

sudo systemctl enable qemu-guest-agent

With the VMs properly configured, running the update command inside the PVE node’s Shell UI will allow the Ultimate Updater script to download and install the latest packages for your virtual machine collection.

It’s pretty customizable, too

You can tweak the config file to your heart's content

Accessing the Ultimate Updater config files on Proxmox

Remember that method for restricting certain virtual guests from the Ultimate Updater I mentioned earlier? Turns out the script also includes a neatly indented configuration file where you can add custom arguments and parameters.

Since Proxmox has the nano text editor built into it, you can execute the nano /etc/ultimate-updater/update.conf command within the Shell tab of your PVE node. If you wish to selectively update, you can add their IDs after the ONLY parameter. Alternatively, you can add the IDs of specific VMs and LXCs after the EXCLUDE variable. The Update Checker has similar arguments, and you can modify them to force Ultimate Updater to scan new packages for specific virtual guests.

Accessing the Ultimate Updater config files on Proxmox

I don’t usually worry about the number of snapshots created by the script, but if you’re running out of disk space, you can reduce the KEEP_SNAPSHOTS variable to 1. There’s also the Extra Scripts section, which works on special virtual guests like Pi-Hole, Pterodactyl, and a couple of other services running on your Proxmox host.

It’s a time saver if you’ve got multiple VMs and containers on a PVE server

Running the Ultimate Updater script on Proxmox

I’ve been using this neat updater for the last couple of days, and it has made updating the packages on my virtual guests a cakewalk. If you’re looking for even wackier stuff you can pull off with it, I recommend checking out the /etc/ultimate-updater/scripts.d folder using the cd command. Inside, you can create custom .sh scripts that Ultimate Updater will execute after performing its magic on your virtual guests. It’s not something I’ve tinkered with a lot, but it does sound like a neat way to automate my LXCs and virtual machines even further.

Deploying a Proxmox VM using Terraform

Related

I use Terraform to automatically provision VMs on Proxmox - here's how

While it may seem rather daunting, Terraform is an amazing automation tool for provisioning virtual machines on your home lab

Read Entire Article