Issue with Containers not restarting after a reboot

I noticed after rebooting my Virtualmin server that containers installed through Virtualmin Container Manager did not automatically restart.

I did some troubleshooting and found the following:

  • Podman version: 3.4.4

  • Containers are running rootless under the Virtual Server owner.

  • The containers have RestartPolicy=always.

  • The Virtual Server owner has Linger=yes.

  • The system podman-restart.service is enabled and runs successfully at boot.

  • The system service executes:

/usr/bin/podman start --all --filter restart-policy=always

However, that service runs as root and therefore only sees root’s Podman storage.

For example, a Virtualmin-managed container owned by maxclean is stored under:

/home/maxclean/.local/share/containers/storage

Running podman ps -a as root and as maxclean produces different container lists, as expected for rootless Podman.

I also checked the user’s systemd configuration and there does not appear to be a user-level podman-restart.service or generated systemd unit for the Virtualmin-managed pod/containers.

Is Virtualmin Container Manager supposed to create/enable a user-level systemd service for rootless containers so that containers with RestartPolicy=always are started following a host reboot?

If not, what is the recommended Virtualmin method for ensuring catalog/recipe containers automatically restart after a server reboot?

I’ve been running rustdesk on a domain I made for it, rustdesk.mydomain.com and I’ve done a few reboots since and it comes back up fine.
Maybe raise a ticket (pro option) if you get no response as that’s not normal behavior.

is this a rootless installation? I think it affects rootless. possibly.

Not sure what you mean, your doing it as a virtual server admin user?

I think that he meant if you are using a rootless enviroment for yourself or not, inclining that he does that.
Thats my guess.

Hi Rudy!

This is expected and is caused by the old Podman 3.4.4 package, not by the container configuration.

Ubuntu 22.04 ships the system-level podman-restart.service, but not the corresponding user-level service needed for rootless containers. The system service runs as root and cannot see containers owned by virtual server users.

Virtualmin uses Podman’s native restart service, and it does not generate separate systemd units for every container. The recommended solution is to upgrade to Ubuntu 24.04 or another supported OS with a newer Podman package.

Ubuntu 24.04’s Podman 4.9.3 package includes the rootless restart service, so containers with RestartPolicy=always should start after reboot when linger is enabled.

Yet, for complete native unless-stopped behavior, Podman 5.8.2 or newer is preferred.

Thanks, that clears it up and also explains some behavior I’ve seen with rootless containers after a reboot.

Since this is a fresh server and I’m planning to use Virtualmin’s Container Manager fairly extensively, would you recommend staying with Ubuntu 24.04’s stock Podman 4.9.3, or is there a Virtualmin-supported/recommended way to install Podman 5.8.2+ on Ubuntu 24.04?

I’d rather build the server around the preferred Podman version now than migrate everything to 4.9.3 and discover later that I need to change the Podman installation to get reliable native unless-stopped behavior.

Also, am I correct that Virtualmin expects loginctl enable-linger <virtual-server-user> to be enabled for each virtual server user that owns rootless containers, or does Container Manager handle enabling linger automatically?

I’d go with Ubuntu 26.04 if I had to choose Ubuntu and build a new server today.

We handle it internally, you don’t need to do anything else manually.

Can I just upgrade to the latest Ubuntu? Is there any documentation for post upgrades?

This question is best addressed by your Linux distribution’s support team or official Ubuntu upgrade documentation.

Loosely translated, it’s a PITA. lol all good. thanks.