How to get ip and network details through CLI Command

neelesh

New Member
Apr 10, 2017
3
0
1
39
Hi,

For Linux 14.04 Server pvesh create nodes/pve/qemu/117/agent -command network-get-interfaces CLI Command is working, But For Windows Server 2008 R2 Standard "pvesh create nodes/pve/qemu/117/agent -command network-get-interfaces" CLI command is not working,
Output of this command is :
200 OK
{
"result" : null
}

But ping command working fine output of this CLI command is :
root@pve:~# pvesh create nodes/pve/qemu/117/agent -command ping
200 OK
{
"result" : {}
}


I have created a VM in porxmox Virtual Environment 4.4-1
and install Windows Server 2008 R2 Standard OS
Configuration of VM is :
Memory: 1.00 GiB
Processors: 1(1 Sockets, 1 cores)
Hard Disk: 10G
Network Device (net0) bridge=vmbr0

To Install QEMU Guest Agent I have followed following Steps:
First I have downloaded the virtio-win driver iso (see Windows VirtIO Drivers).

Then install the virtio-serial driver:
  1. Attach the ISO to your windows VM (virtio-*.iso)
  2. Go to the windows Device Manager
  3. Look for "PCI Simple Communications Controller"
  4. Right Click -> Update Driver and select on the mounted iso in DRIVE:\vioserial\<OSVERSION>\ where <OSVERSION> is your Windows Version (e.g. 2k12R2 for Windows 2012 R2)
After that, you have to install the qemu-guest-agent:
  1. Go to the mounted ISO in explorer
  2. Execute the installer with double click (either qemu-ga-x64.msi (64-bit) or qemu-ga-x86.msi (32-bit)
After that the qemu-guest-agent should be up and running. I have can validate this in the list of Window Services, and also in a PowerShell with:

PS C:\Users\Administrator> Get-Service QEMU-GA

Status Name DisplayName
------ ---- -----------
Running QEMU-GA QEMU Guest Agent

I have attached Screen shots for reference.

Please let me know if any thing is wrong.

Thanks
Neelesh Bizoara
 

Attachments

  • qemu-agent-win2008ServerR2.png
    qemu-agent-win2008ServerR2.png
    91 KB · Views: 40
Hi Neelesh
You're right getting the IP address of a Windows guest with the qemu guest agent does not work (although other commands work)
It seems to be a general problem with the qemu guest agent.
Can you fill a bug report at bugzilla.proxmox.com ?

However it should be possible to use the arp cache of the host to get the IP address of the guest.

For instance I have a Windows 2012 VM with a single NIC
net0: virtio=3A:33:39:66:31:35,bridge=vmbr0

If I look into the arp cache with this mac adress you can find the IP address
ip neigh | grep -i "3A:33:39:66:31:35"
192.168.16.96 dev vmbr0 lladdr 3a:33:39:66:31:35 REACHABLE