How to Check VM IP Address with PowerShell or Web Client

A dynamically assigned IP address may change after a few days. Do you know how to check VM IP addresses? This article summarizes 3 ways to do this.

Crystal

By Crystal / Updated on September 28, 2022

Share this: instagram reddit

What is VM IP address

IP address, stands for Internet Protocol address, is a unique numerical label that used to identify a device on the internet or connected to a local network. An IP address serves two main functions: network interface identification and location addressing. It enables devices on the network accessible for communication.

As for virtual machines, whether you are using host-only, network address translation (NAT), or bridged networking, each virtual machine must be assigned a unique IP address, dynamically or statically, as any regular computer.

IP address

Most Windows OS are pre-configured to use Dynamic Host Configuration Protocol (DHCP) at boot time to assign IP addresses dynamically, for it is simpler and more automated than assigning them statically. However, dynamic IP addresses are pulled from a pool of other IP addresses and can change at any time from a few days to months.

So, how do you check your VM IP address? In this article, I will introduce 3 methods.

Way 1. Check VM IP address on VMware vSphere or ESXi web client

If you are running VMware, checking VM IP address on vSphere or Host/ESXi web client is probably the most direct way to do this. In this section, I will introduce how can VMware get VM IP address, with or without vCenter Server.

Note: You must have VMware Tools installed on the guest operating system to get VM IP address show on VMware vSphere/ESXi web client.

How to check VM IP address on VMware vSphere web client with vCenter Server

1. Access VMware vSphere web client, select and power on the target virtual machine from Hosts and Clusters in the left inventory.

2. Check the Summary tab, the VM IP addresses are displayed in the IP addresses section.

3. Click VIEW ALL N IP ADDRESSES you can view all of the IP addresses used by this virtual machine.

IP address on VMware vSphere web client

How to check VM IP address on VMware Host web client without vCenter Server

1. Access VMware Host/ESXi web client, select and power on the target virtual machine from Virtual Machines in the left inventory.

2. Click General Information > Networking, the IP addresses are displayed in the IP addresses section.

3. You can expand the pane to view all of the IP addresses used by this virtual machine.

IP address on VMware ESXi web client

Way 2 . Get VMware or Hyper-V VM IP address via PowerShell

Whether your virutal environment is VMware or Hyper-V, you can check VM IP addresses via PowerShell. But before that, you need to install the corresponding PowerShell module.

How to get VM IP address with VMware PowerCli

To manage VMs on VMware vSphere, you need to install the VMware PowerCLI module, and connect to your vCenter Server first. Open Windows PowerShell as administrator, and run the following command:

To install VMware PowerCLI:

Install-Module -Name VMware.PowerCLI

Untrusted Repository

To connect to your vCenter Server:

Connect-VIServer -Server [server name] -Protocol [http] -User [user name] -Password [password]

To get VM IP address via VMware PowerCLI:

Get-VM | Select Name, @{N="IP Address";E={@($_.guest.IPAddress[0])}}

To get a list of all VMs with corresponding IP addresses:

Get-VM | Select Name, @{N="IP Address";E={@($_.guest.IPaddress)}} | foreach { write-host $_.Name $_.IP}

To find a VM by IP address:

Get-VM * |where-object{$_.Guest.IPAddress -match "your IP address"}

How to check VM IP address via Hyper-V PowerShell

Hyper-V PowerShell module is a bundle of cmdlets for creating, configuring and managing Microsoft Hyper-V hosts and virtual machines. To install it one your computer, you can open Windows PowerShell as administrator and run the following command:

To install Hyper-V PowerShell module:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell

To enable Hyper-V and install PowerShell module:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

Enable Hyper-V PowerShell

To get VM information via PowerShell cmdlet

Get-VM vmname

Get-VM

Get-VM is the most basic cmdlet to retrieve VM information. However, run just the command Get-VM only retrieves the most basic information of this virtual machine, such as Name, PowerState, NumCPUs, and MemoryGB properties by default. IP addresses won’t be displayed.

To get VM IP address via PowerShell cmdlet

Get-VM vmname | Select-Object *

Get-VM Select-Object

Check the last few properties it displayed, NetworkAdapters is the property which you need to get your VM IP addresses. But now you can only see it is showing the value of {Network Adapter, Network Adapter, Posey}. It means NetworkAdapters is a property that can be expanded. Expanding it will allow PowerShell to display the virtual machine’s network configuration, including its IP address.

To get VM IP address and other network configuration:

Get-VM vmname | Select-Object -ExpandProperty NetworkAdapters

Get-VM Expand NetworkAdapters

Now you can see that this particular VM has three virtual network adapters. You can also see the IPv4 and the IPv6 addresses for each.

How to get VM IP address inside the guest OS

If your can actually enter the operating system running on the target guest virtual machine, it can be even easier to get VM IP address from inside the VM. The operations are basically the same as it on a physical machine.

For example, if your host or guest operating system is Windows, you can get the VM IP addresses simply by running the command ipconfig search for the IP addresses shown under VMnet[num].

If you want to check VM IP address in Linux, please check this detailed guide.

Summary

IP addresses enables devices on the network accessible for communication. Virtual machines also have different IP addresses, just like the physical machine. But if the VM IP address is assigned dynamically, it may change after a few days, according to which VMnet VMware you specified.

Therefore, in this article, I summarized 3 ways of how to check VM IP addresses. Hope it could be helpful to you.

Crystal
Crystal · Editor
Crystal is an editor from AOMEI Technology. She mainly writes articles about virtual machine. She is a positive young lady likes to share articles with peolpe. Off work she loves travelling and cooking which is wonderful for life.