Keepalived in a VM

I am curious if there would be any reason I could not set up keepalived in a Ubuntu 24.04 VM on scale?

I am currently attempting to set up a backup pihole server with a vip using keepalived and am getting an error when attempting to start the service after configuring it stating

Aug 16 21:42:28 pihole01 systemd[1]: Starting keepalived.service - Keepalive Daemon (LVS and VRRP)...
Aug 16 21:42:28 pihole01 Keepalived[37731]: Starting Keepalived v2.2.8 (04/04,2023), git commit v2.2.7-154-g292b299e+
Aug 16 21:42:28 pihole01 Keepalived[37731]: Running on Linux 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul  5 10:34:03 UTC 2024 (built for>
Aug 16 21:42:28 pihole01 Keepalived[37731]: Command line: '/usr/sbin/keepalived' '--dont-fork'
Aug 16 21:42:28 pihole01 Keepalived[37731]: Configuration file /etc/keepalived/keepalived.conf
Aug 16 21:42:28 pihole01 Keepalived[37731]: daemon is already running
Aug 16 21:42:28 pihole01 systemd[1]: keepalived.service: Failed with result 'protocol'.
Aug 16 21:42:28 pihole01 systemd[1]: Failed to start keepalived.service - Keepalive Daemon (LVS and VRRP).

I have set this up using 2 VMs in proxmox and everything worked but if I try this in Scale I get the above. The only differences I can think of are that the VM in proxmox are using a cloud-init image and the one on scale is using the normal ubuntu image and the networking in scale is also handled differently. The networking in Scale I have setup with a bridge and attached the VM to the bridge.

Same problem here with the exact same error messages. Trying to run keepalived directly on the TrueNAS Scale 25.04.2.3.

Here is the journalctl -xe log

Sep 11 10:53:25 truenas systemd[1]: keepalived.service: Failed with result ‘protocol’.
Subject: Unit failed
Defined-By: systemd
Support:
The unit keepalived.service has entered the ‘failed’ state with result ‘protocol’.
Sep 11 10:53:25 truenas systemd[1]: Failed to start keepalived.service - Keepalive Daemon (LVS and VRRP).
Subject: A start job for unit keepalived.service has failed
Defined-By: systemd
Support:

A start job for unit keepalived.service has finished with a failure.
The job identifier is 12110 and the job result is failed.

Any help would be appreciated.

Allowing Mac addresses to be changed? (“trust” something in the VM network settings).

The protocol assigns a specific Mac address to the “active” system.

Thanks for the response. For context, I tried to setup a loadbalacer for my piholes which are running on docker like described here: gist dot github dot com/Drallas/e61e4ebc1eaa2e52f21597fc8f2f43b8

I restarted the truenas and the error disappeared resulting with an empty keepalived.conf. Then I wrote the config again with the same content and it seemed to work. To prevent the service failure after a reboot I created a backup of the conf file and created a cron job which copies the keepalived.conf backup to the original conf and restart the service afterwards. Seems to work flawlessly so far.