This is possible, and exact directions will vary on distribution of the vm client. I personally do this but with split horizon dns and dnsmasq on a vm.
impossible to leak is where it gets tricky, and that will require an understanding of networking in your distribution. there will also be tutorials on this, but it’s very easy to mess up.
make sure it’s configured for clean shut downs before your battery runs out, auto power up on restoration, and hope it doesn’t happen. you will eventually have an outage that outlasts your batteries.
I have a large string of batteries from an old telco office, that runs my rack for 14hrs (calculated, I shut everything down around this time) and that did not last for the 2-3 day outage we had after a storm. Without a generator, you will inevitably have an outage, but if you are prepared, then you can mitigate any damage. use NUT if you need to shutdown or power multiple devices from one monitored UPS