[Guide] How vCenter Find VM by MAC Address/IP Address
In large virtual environments, keeping track of virtual machines (VMs) can be challenging, particularly when trying to locate a specific VM. Fortunately, vSphere provides IP/MAC address to help administrators quickly locate VMs. Read this article to learn the details.
Case: vCenter find VM by MAC address?
WE have a virtual machine, only know the MAC and host name is gone. How to find the VM by MAC only? Please help.
- Question from communities.vmware.com
Virtual machines are fundamental component of modern IT infrastructures, allowing for flexibility, scalability, and cost-efficiency in managing workloads. However, with so many VMs being created and deployed in vSphere environments, it can be difficult to keep track of them all, especially when looking for a specific VM.
Thus, vSphere assign a unique IP/MAC address for each virtual machine, just like the physical computer. It can help you quickly and easily find the VM you are looking for.
Next, this article will show you how to locate a VM by IP/MAC (Media Access Control) address using both the vSphere Web Client and vSphere PowerCLI.
How vCenter find VM by MAC address
1. Run the PowerCLI console and connect to your vCenter server using the Connect-VIserver cmdlet:
Connect-VIServer -Server -User <username>
2. Run the following command to find VM by MAC address:
Get-VM | Get-NetworkAdapter | Where-Object {$_.MacAddress –eq "MAC Address" } | Select-Object Parent,Name,MacAddress
3. If you know only part of the MAC address, you can run the following command to find the VM:
Get-VM | Get-NetworkAdapter | Where-Object {$_.MacAddress –match "MAC Address" } | Select-Object Parent,Name,MacAddress
How to locate a VM via IP address
An IP address is a unique identifier of a virtual machine. For vCenter find VM by IP address, you can use vSphere Web Client or VMware PowerCLI. Both of them are quick and easy. You can choose the way you are familiar with.
Locate a VM via IP address on vSphere web client
1. Log in to the vSphere Web Client or vSphere Client and navigate to the vCenter Server where the target VM is located.
2. Click Virtual Machines to see a list of all the VMs in that vCenter.
3. Right-click on the column header and select Show/Hide Columns > IP Address to add the IP Address column to the VM list view.
4. Click Filter and enter the IP Address to apply the filter. The VM with the matching IP address should be displayed in the list of VMs.
Use VMware PowerCLI to locate a VM via IP address
1. Run the PowerCLI console and connect to your vCenter server using the Connect-VIserver cmdlet:
Connect-VIServer -Server -User <username> -Password <password>
2. Run the following command to find VM by IP address:
Get-VM * |where-object{$_.Guest.IPAddress -eq "IP Address"}|select Name, VMHost, PowerState,GuestId,@{N="IP Address";E={@($_.guest.IPAddress[0])}}|ft
3. If you know only part of the IP address, you can run the following command to find the VM:
Get-VM * |where-object{$_.Guest.IPAddress -match "IP Address"}|select Name, VMHost, PowerState,@{N="IP Address";E={@($_.guest.IPAddress[0])}} ,@{N="OS";E={$_.Guest.OSFullName}},@{N="Hostname";E={$_.Guest.HostName}}|ft
How to get MAC address of virtual machine
Unlike vCenter find VM by MAC address, except getting a VM’s MAC address via VMware PowerCLI, you can also check it on vSphere Web Client. Next this article will show you both 2 ways to check a VM’s MAC address. You can choose one you are familiar with.
Find VM’s MAC address via vSphere Web Client
1. Access vSphere web client, right-click on the target virtual machine and select Edit Settings.
2. From Virtual Hardware tab, click on the name of the Network adapter to check the MAC address of this virtual machine.
Get VM’s MAC address via VMware PowerCLI
1. Connect to your vCenter Server:
Connect-VIServer -Server -User <username>
2. Run the following command to get VM’s MAC address via VMware PowerCLI:
Get-NetworkAdapter -VM <vmname> | Select-Object MacAddress
How to find VM’s IP address
Just like finding a VM’s MAC address, you can also find a VM’s IP address on vSphere Web Client or use VMware PowerCLI. The most direct way to get a VM’s IP address is checking it on vSphere Web Client. It is displayed in the VM information.
Find VM’s IP address via vSphere Web Client
1. Access vSphere web client, select 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 IP ADDRESSES you can view all of the IP addresses used by this virtual machine.
Get VM’s IP address via VMware PowerCLI
1. Connect to your vCenter Server:
Connect-VIServer -Server -User <username>
2. Run the following command to get VM’s IP address via VMware PowerCLI:
Get-VM -Name <vmname> | Select Name, @{N="IP";E={@($_.Guest.IPAddress)}}
A Reliable Agentless Virtual Machine Backup Software
Neither ESXi host nor vCenter Server provides the feature of virtual machine backup. You can try the agentless VMware backup software - AOMEI Cyber Backup, it enables you to backup multiple VMs either managed by vCenter Server or by standalone ESXi host, and supports both paid and free versions of ESXi 6.5 to 8.0.
Summary
vCenter find VM by MAC address or IP address is an important skill for any vSphere administrator. By following the steps outlined in this article, you should be able to quickly and easily locate a specific VM using either the vSphere Web Client or vSphere PowerCLI, depending on your needs and preferences.
In addition, this article also shows how to quickly check a VM’s MAC/IP address. Hope it could be helpful. If you need more information, you may refer to How to check VM IP address.