Get Proxmox VM name into a VM


Sep 30, 2021

I would like to set the host name of a VM automatically to the name the VM have in Proxmox. ("Options" -> "Name"). Please correct me if I'm wrong, but Cloud-Init would only help on the first boot and don't have a option for host name.

My question/idea is to run a script inside the VM on every startup to set the host name, but is it possible over the Qemu guest agent or a different thing to request the own name of the VM from Proxmox? Or any other idea for doing this?



The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!