Get IP addresses of Hyper-V Linux machines
5,880
I had to install Linux Integration Services to the virtual machine (Linux Integration Services 4.1):
- Download the package from Linux Integration Services Version 4.1 for Hyper-V to the guest server (Linux) and unpack it. There is also an ISO image available that you can mount with Hyper-V Manager if you have no way of transferring the package to the guest host.
- Find your distribution under the unpacked directory (e.g.
CentOS72
). - Run
install.sh
as root. - Reboot the guest OS.
For CentOS 7 it also required to disable NetworkManager. That (and other hints) is told in Supported CentOS and Red Hat Enterprise Linux virtual machines on Hyper-V (Notes 2 for NetworkManager)
Run: systemctl disable NetworkManager
and reboot
Now the Hyper-V Manager should show you the IP address of the VM and Get-VM
should also work.
Related videos on Youtube
Author by
igor
Updated on September 18, 2022Comments
-
igor over 1 year
I have Hyper-V on Windows Server 2012, and in the Hyper-v I have CentOS 6/7 vm. I doing the following command:
Get-vm -name "x" | select -ExpandProperty NetworkAdapters
Output:
Name IsManagementOs VMName SwitchName MacAddress Status IPAddresses ---- -------------- ------ ---------- ---------- ------ ----------- Network Adapter False "x" InternalSwitch Mac {Degraded, protocolversion} {}
Why is
IPAddresses
empty?I tried
(command).ipaddresses
and got the same result. -
DavidPostill almost 8 yearsPlease quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.