Set IP for VM before guest OS install (network install)

pmlearner

Member
Jul 9, 2019
25
0
6
54
I have a VM for which I'm doing a network-based install. I need the VM to have an IP address at boot up. Currently it appears the guest OS is using DHCP (supplied to promox I assume?) to get an IP. Is there a way to specify/force a particular IP for DHCP to give out. I have a few public IP's that I want to the DHCP to pick from.
 
For VMs PVE only acts as a L2 bridge, e.g. it cannot influence the guest which address it takes. Either configure a static mapping MAC <-> IP on your DHCP server or tell the guest to use a static IP somehow (cloud-init?).
 
Is it correct that ProxMox does not supply/act as a DHCP server? I mistakenly thought it did. I have not DHCP server on my network so my only option is to tell kvm to set a particular IP when starting this vm up. Is there any option to do this inside of proxmox? I looked into cloud-init but to be honest I'm not quite sure how it would integrate.

I'm very comfortable with the command line (more so than the gui) so if this is as simple as setting it in a .conf file, ie :

/etc/pve/nodes/Proxmox-VE/qemu-server/VEID.conf

let me know what to add.

Thanks!
 
Correct, PVE does not include a DHCP server. You can set one up though, e.g. take a look at 'dnsmasq' (can also run in a container or VM for example).

For cloud init, take a look here: https://pve.proxmox.com/wiki/Cloud-Init_Support
It can all be configured from the command line, as long as your guest OS supports it.
 

About

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!