Get IP/Interfaces without qemu-guest-agent

eviatars-chkp

New Member
Nov 18, 2024
7
0
1
Hey
I'm using linux machine, based on RHEL 9.x and I want to get from pve node information about the vm, such like IPs.
sadly, my machine can't install external packages (impossible to use "apt get" for example), both online and offline.

Is there a way to receive that information from my pve node without installing qemu-guest-agent?


Thanks
 
linux machine, based on RHEL 9.x
So that is the VM on Proxmox node? Your post is pretty unclear.

Is there a way to receive that information from my pve node without installing qemu-guest-agent?
Short answer: No. That is by design the VM runs completely independent to the host - you wouldn't want it otherwise. The guest-agent is the only communication (controllable) directly between the VM & its' host.

You've already been told by waltar that you could query the DNS, I'll only add that maybe the router / switch could help you by hostname/MAC?

If from within the VM you can identify its' own IP (which I'm pretty sure you can, as if not, even a guest-agent would not help!), then I guess you could send that by some (already presently installed) notification system - email etc.

Sorry for asking, but I must be honest I'm perturbed slightly by why you seek the above info in this way. Are you the system-admin of the PVE node or just a client using the VM?
 
Thats fine; I'm the system-admin of the PVE node and for the VM: by security reasons I can't install external package on my machine, that's all :)
 
what do you mean by "external packages". dont you do updates?

and if you are admin of the vms, where is the problem / usecase?

if you have static ips, you know it because you configured it. if you have dhcp addresses you know the mac of your maschines and therefor the ip. I guess i dont see what's your goal
 
Is there a way to receive that information from my pve node without installing qemu-guest-agent?
Yes. if you must, you can get it like so:

1.use qm config to get your vm's mac address, like so: qm config $vmid | grep -oP 'net\d+:.*?\K([A-Fa-f0-9:]{17})'
2. ip neigh show | grep $mac (from #1)

as a one liner:

Code:
ip neigh show | grep -i "$(qm config $vmid | grep -oP 'net\d+:.*?\K([A-Fa-f0-9:]{17})')"

but seriously, just install qemu-guest-agent.
 
  • Like
Reactions: waltar
If you can ssh into it, you can get pretty much anything that way. Just pipe output to a file and scp it, or put it on a network share
 

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!