Как найти vmware в сети

In a VMware vSphere environment, you can run a large number of virtual machines (VMs) on ESXi hosts. Sometimes you may need to find an IP address of a certain VM when you know the VM’s name or identify a VM name when you know an IP address. One common situation is when you have remote access to a guest operating system via SSH or RDP and know the IP address, but you don’t know the VM’s name.

However, you need to know the VM’s name to find the VM on an ESXi host and edit VM settings, migrate the VM to another ESXi host, or run VM backup on the host level. These operations are performed on the vSphere side and cannot be done in a guest operating system. You may also need to identify one of the MAC addresses of a virtual network adapter used by a VM. This blog post explains how to find a VM’s IP or MAC address and how to identify a VM’s name when you have an IP or MAC address.

Checking an IP Address in VMware vSphere Client

The most straightforward way to check a VM’s IP address in VMware vSphere is to use VMware vSphere Client.

  1. In a web browser, enter the IP address of your vCenter Server in the address bar, open vSphere Client, and enter your credentials to log in.
  2. Go to Hosts and Clusters, select the needed VM by name and check the Summary tab. The VMware IP addresses of the virtual machine are displayed in the IP addresses section. One VM can have multiple virtual network adapters and multiple IP addresses.
  3. Click View all N IP addresses to display all of the IP addresses used by the VM.
  4. In the screenshot below, you can see one IPv4 and one IPv6 address used by a VMware VM. VMware Tools must be installed on a guest operating system (OS) to view IP addresses in the web interface of VMware vSphere Client. The VM must be powered on.
    How To Find IP Address Of Virtual Machine

Checking a MAC Address in vSphere Client

A VM’s MAC address can be used for network diagnostics and other purposes.

  1. In order to check the MAC address, right-click the VM’s name in the Navigator pane of VMware vSphere Client, and in the context menu, click Edit Settings.
  2. In the Virtual Hardware tab of the Edit Settings window, click the name of the network adapter to check the MAC address of the virtual network adapter used by the VM.VMware vSphere Client MAC

Checking a VM’s IP address in VMware Host Client

If you’re using a standalone ESXi host without VMware vCenter, you cannot use VMware vSphere Client to manage the virtual environment. This occurs when you use ESXi Free Edition on a server. In this situation, you can use VMware Host Client to manage an ESXi host in a web interface.

  1. Enter the IP address of your ESXi host in the address bar of your web browser and enter an ESXi administrator account username and password.
  2. In the Navigator pane, click Virtual Machines and select the VM with the IP address that needs to be identified. As with identifying the VMware IP address of a VM in vSphere Client, the VM must be started and VMware Tools must be installed on the guest operating system.
  3. On the page with the VM information, locate the section with General information and click Networking to expand the pane and view the IP addresses used by the VM.

Checking a VM MAC Address in VMware Host Client

  1. To check a VM’s MAC address in VMware Host Client, select the VM as you would when checking the IP address.
  2. Scroll down the page to the Hardware Configuration section in the web interface.
  3. Click the VM network adapter needed to expand options and find the MAC address of the corresponding virtual network adapter.The VMware Virtual Machine MAC Address

Note: In this example, we use an ESXi host managed by vCenter Server, but we are logged into VMware Host Client. The VMs were created in vCenter.

VM search in VMware vSphere enables you to find a VM by name but not by IP address or MAC address.

Identifying the VM Name by IP Address

You can identify the VM name if you know the IP address by using vSphere PowerCLI.

  1. Connect to an ESXi host or vCenter and enter the username and password for the administrative account:
    Connect-VIServer ESXi_or_vCenter_IP -User root
  2. In our case, we connect to the ESXi host managed by vCenter Server with the command:
    Connect-VIServer 10.10.10.74 -User root
  3. The simplest command to display a VM that has the defined IP address is:
    Get-VM * |where-object{$_.Guest.IPAddress -match “192.168.17.137”}

    Where 192.168.17.137 is the IP address of the VM to be identified.Detecting A VM name

There is another method to identify a VM name if you know the IP address of a VM in PowerCLI. In this case, you should run two commands.

  1. Define the IP address of the VM to be identified:
    $vmIP=”192.168.17.137″
  2. Get information about the VM:
    Get-VM * |where-object{$_.Guest.IPAddress -eq $vmIP}|select Name, VMHost, PowerState,GuestId,@{N=”IP Address”;E={@($_.guest.IPAddress[0])}}|ftIdentifying The Name Of A VM
  3. If you know part of the IP address, you can display all VMs with IP addresses that match the search pattern.
    $vmIP=”192.168.”

    Get-VM * |where-object{$_.Guest.IPAddress -match $vmIP}|select Name, VMHost, PowerState,@{N=”IP Address”;E={@($_.guest.IPAddress[0])}} ,@{N=”OS”;E={$_.Guest.OSFullName}},@{N=”Hostname”;E={$_.Guest.HostName}}|ft
    The Command To Display VM Names
  4. Here is a command to get a list of all VMs on a host or cluster and show IP addresses where it is possible:
    Get-VM | Select Name, @{N=”IP Address”;E={@($_.guest.IPAddress[0])}}

The disadvantage of this method is that sometimes the IP address is only displayed partially.

  • There is also a command to view all VMs in a cluster (the cluster name contains the “cluster” string) and display IP addresses where possible:
    Get-Cluster “*cluster*” | Get-VM | Select Name, Host, @{N=”IP Address”;E={@($_.guest.IPAddress[0])}} 

    Change [0] to [1] if you want to display the second IP address. You can delete these characters from the command to see the difference in the displayed results.

Identifying the VM Name by MAC Address

You can also use VMware PowerCLI to identify a VM name if you know a VM’s MAC address.

  1. Connect to an ESXi host or vCenter in VMware PowerCLI. In my example, I connect to the ESXi host mentioned in the previous example:
    Connect-VIServer 10.10.10.74 -User root
  2. Define the virtual machine MAC address and find the name of this VM:
    $vmMAC=”00:50:56:84:C4:5F”

    Get-VM | Get-NetworkAdapter | Where-Object {$_.MacAddress -eq $vmMAC } | Select-Object Parent,Name,MacAddress
    How To Identify The VM Name
  3. You can connect to the ESXi host via SSH and use the ESXi command line interface) to identify a VM name by its virtual machine MAC address.
    find /vmfs/volumes | grep .vmx$ | while read i; do grep -i “00:50:56:84:C4:5F” “$i” && echo “$i”; doneHow To Identify The VM Name ESXi

Virtual Machine MAC Addresses in VMware Environments

MAC addresses are not assigned randomly. The first half of a MAC address is usually associated with the appropriate hardware or software manufacturer.

MAC addresses starting with 00:50:56 are VMware MAC addresses that belong to VMware virtual machines, as can be seen in my previous examples when we identified MAC addresses of VMware VMs.

There are four assignments for VMware MAC addresses: 00:50:56, 00:0C:29, 00:05:69, 00:1C:14. Let’s look at some common categories of VMware MAC address ranges:

  • 00:50:56 – VMware Workstation, VMware vSphere, VMware ESXi server
  • 00:50:56:80:00:00 – 00:50:56:BF:FF:FF – vCenter, VMware vSphere VMs managed by vCenter
  • 00:0C:29 – Standalone ESXi hosts, VMware Horizon, VMware Workstation
  • 00:05:69 – VMware ESXi, VMware GSX
  • 00:1C:14 – VMware

Organization Unique Identifiers (OUI) are used as prefixes for VMware MAC addresses according to the VMware OUI allocation scheme. VMware vCenter and ESXi hosts use different prefixes for MAC addresses to avoid conflicts of MAC addresses in situations where a host is not connected to vCenter Server but can be connected to vCenter later. If an ESXi host is managed by vCenter, then vCenter generates VMware vSphere MAC addresses for VMware VMs.

When a MAC address to a VM is set manually (in VM settings), the prefix (first three octets) is preserved automatically. The second half of the MAC address can be customized.

If you want to set a MAC address for a VMware VM manually, use this template:

00:50:56:XX:YY:ZZ

  • The recommended hexadecimal value instead of XX is a number between 00 and 3F.
  • The valid numbers for the YY and ZZ fields are in the range between 00 and FF (the full range).

Using these recommendations helps you avoid conflicts between MAC addresses you have set manually with those VMware MAC addresses generated automatically by VMware vCenter and MAC addresses assigned to VMkernel adapters. Note that the maximum value for a VMware MAC address that can be set manually is 00:50:56:3F:FF:FF if the 00:50:56 prefix (OUI) is used. This approach can also help identify manually and automatically assigned VMware MAC addresses. Don’t forget that all MAC addresses in the network must be unique.

vCenter Unique ID calculation

Let’s explore other aspects of identifying a MAC address of VMware vCenter.

As explained above, a MAC address for vCenter is assigned from the range (00:50:56:80:00:00 – 00:50:56:BF:FF:FF) in the 00:50:56:XX:YY:ZZ format.

In this case, the XX value is calculated based on the vCenter unique ID.

XX=80+vCenterID

If you know the MAC address of vCenter, you can calculate the vCenter Server Unique ID (can be 0 to 63).

Let’s look at an example when we have vCenter Server deployed as a VM which network interface has a VMware MAC address:

00:50:56:9B:48:55

Subtract 80 from 9B (hexadecimal). You can use the HEX calculator.

0x9B – 0x80 = 0x1B

Convert the HEX value to a decimal value:

0x1B = 27

vCenter Unique ID is 27 in this case.

VMware MAC addresses for VMs on standalone hosts

Now let’s look at an example of MAC address generation for VMs on a standalone ESXi host to see how VM MAC addresses are generated on a standalone ESXi host and understand the generation principle. The last six characters of the VM universally unique identifier (UUID) are used to fill the three last octets of the VMware MAC address of the VM. First three octets of a VMware MAC address for a VM created on a standalone ESXi host are 00:0C:29.

On the screenshot below, you can see a VM with the parameters:

MAC address: 00:0C:29:B0:3E:1D

VM name: Windows-VM

The MAC address format for a VM created on a standalone ESXi host

Let’s check the VM UUID and compare the last characters of the UUID and VM MAC address.

You can check the UUID of a VM with this command in PowerCLI:

Get-VM Windows-VM | %{(Get-View $_.Id).config.uuid}

In our case the UUID is 564df9a2-261e-869e-5a1d-d118abb03e1d

and the MAC address is 00:0C:29:B0:3E:1D

As you can see, the rule works.

Checking the principle of VMware MAC address generation on a standalone ESXi host

Conclusion

You can check a MAC address and IP address of a VM in the graphical user interface of VMware vSphere Client and VMware Host Client. As an alternative, use the ESXi command line or PowerCLI to detect a MAC address of a VM if you know the VM’s name. You can also use VMware PowerCLI to identify a VM name if you know a VM’s IP or MAC address. Knowing the principles of assigning VMware MAC addresses to virtual machines and other machines in a VMware virtual infrastructure can help you identify VMware-related machines from other devices in the network when checking MAC addresses of connected devices.

Don’t forget to back up your VMs running in VMware vSphere. Use reliable VMware ESXi backup software like NAKIVO Backup & Replication for robust data protection. The solution supports VM backups, physical server backup, database backup, and Microsoft 365 backup.

В интерфейсе VMWare vSphere Client вы можете выполнять поиск виртуальных машин только по их именам. Но в некоторых случаях администратору VMWare необходимо найти определенную виртуальную машину по ее IP или MAC адресу.

Проще всего выполнять по различным параметрам виртуальных машин с помощью VMWare PowerCLI.

Запустите консоль PowerCLI и подключитесь к вашему серверу vCenter или ESXi хосту с помощью команды:

Connect-VIServer vsphere.winitpro.ru -User administrator

Для поиска виртуальной машины по MAC адресу используйте следующие команды:

$vmMAC="00:50:16:AB:71:12”
Get-VM | Get-NetworkAdapter | Where-Object {$_.MacAddress –eq $vmMAC } | Select-Object Parent,Name,MacAddress

vmware powercli поиск виртуальных машин по mac адресу

Как вы видите, команда вернула имя виртуальной машины с указанным MAC адресом.

Также вы можете выполнить поиск определенного MAC адреса непосредственно по конфигурационным VMX файлам виртуальных машин на VMFS хранилище.

find /vmfs/volumes | grep .vmx$ | while read i; do grep -i "00:50:16:ba:11:21" "$i" && echo "$i"; done

Если на виртуальных машинах установлены VMware Tools, вы можете выполнять поиск по IP адресу гостевой операционной системы. Например, вам нужно найти ВМ с определенным IP адресом. Воспользуйтесь следующими командами:

$vmIP="10.1.1.102”
Get-VM * |where-object{$_.Guest.IPAddress -eq $vmIP}|select Name, VMHost, PowerState,GuestId,@{N="IP Address";E={@($_.guest.IPAddress[0])}}|ft

Если вам известна только часть IP адреса, воспользуйтесь командой:


$vmIP="192.168.”
Get-VM * |where-object{$_.Guest.IPAddress -match $vmIP}|select Name, VMHost, PowerState,@{N="IP Address";E={@($_.guest.IPAddress[0])}} ,@{N="OS";E={$_.Guest.OSFullName}},@{N="Hostname";E={$_.Guest.HostName}}|ft

найти виртуальную машину vmware по ip адресу, вывести список ip ВМ

Команда выведет имена и типы установленных ОС всех виртуальных машин, чьи IP адреса совпадают с данным шаблоном.

I am running VMware Workstation on a Linux box.

When I power on a centOS (Linux) virtual machine I cannot get mouse or keyboard control of the machine. I suspect that it has something to do with the error message:

You do not have VMware Tools installed in this guest. Chose “Install VMware Tools” from the VM menu.

If I click on that menu option, it inserts a virtual cd with drivers etc. This does not help me since I don’t have keyboard or mouse control over the machine.

I was thinking that if I could figure out the IP address or hostname I could use any number of protocols to get into the machine (SSH comes to mind).

How can I get the IP address or hostname of this machine?

Note: I did not create this machine. A coworker created it who is no longer with the company. Would save me a lot of time if I could get into the machine. I have login credentials so that won’t be a problem.

Dave M's user avatar

Dave M

13.1k24 gold badges36 silver badges47 bronze badges

asked Jun 7, 2012 at 19:06

sixtyfootersdude's user avatar

sixtyfootersdudesixtyfootersdude

7,97916 gold badges52 silver badges71 bronze badges

2

First Go in the Virtual Machine Settings.

Found the MAC address

Then in the Network Section, click the Advanced button and read the MAC address

Then in the console execute: arp -a

C:>arp -a
Interface: 10.98.79.23 --- 0xb
  Internet Address      Physical Address      Type
  10.98.79.10           b8-ac-6f-cb-a1-80     dynamic
  10.98.79.12           78-2b-cb-aa-51-bf     dynamic

Interface: 192.168.20.1 --- 0x1c
  Internet Address      Physical Address      Type
  192.168.20.128        00-0c-29-56-bd-36     dynamic
  192.168.20.255        ff-ff-ff-ff-ff-ff     static

Find the MAC address in the displayed list (That you found in advance setting of network adapter above) and the IP will be on the side of this particular MAC Address.

In this case the IP is: 192.168.20.128

MoonLight's user avatar

answered Jan 9, 2013 at 19:34

F Boucheros's user avatar

5

Please check, if not those input devices are connected to the guest OS as USB devices? Once disconnecting them, they should become accessible to the host OS – and therefore operational.

on Linux the command is:

ip addr

or the rather obsolete:

ifconfig

the equivalent command on Windows is:

ipconfig /all

while the output looks about like that:

eno16777984: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.2.101 netmask 255.255.255.0  broadcast 192.168.2.255
    ...

answered Jun 16, 2015 at 4:48

Martin Zeitler's user avatar

6

On Windows 7,

  1. Copied the MAC address to the clipboard
  2. Open C:ProgramDataVMwarevmnetdhcp.leases in Notepad
  3. Search for the MAC address string.

answered Sep 10, 2019 at 21:18

Michael Scott's user avatar

There is a built-in VNC service in Workstation. I’ve not used it, but the config (below) would seem to suggest that you could enable it, and use your host’s IP with a particular port with any of a number of VNC clients to gain control of your virtual machine.

VMWare Workstation VNC Config Setup

answered Jun 8, 2012 at 0:48

JoshP's user avatar

JoshPJoshP

2,2723 gold badges22 silver badges28 bronze badges

I have the same problem, I type command on linux

ip addr

but it shows something like 127.0.0.1 which not what I was looking for.

I notice that when I install Linux (CentOS) in VMware I did not set network configuration.

So,I solve this problem by installing a new Linux VM again. During the installation there is a section to configure network like in the picture.

picture

When the installation is done I type “ip adddr” and I can see the IP.

answered Nov 20, 2019 at 16:58

poomcyber's user avatar

Don’t know about Linux, but in Windows you could …

  1. Add another network interface to the VM, which will be using VMware DHCP to assign a known IP to your VM. You should set up VMware DHCP to a very short address range and it will be easy to pick the IP (also would be problematic to check, because default Windows firewall settings don’t allow incoming echo requests… But you’re not Windows)

  2. Try to pick the subnet where your VM is, put another PC to the subnet (another VM or your physical PC) – and use Computer Browser service (“Network” or “My Network places”) to find the VM.

You should also look for network scanning software.

By the way, what’s the VM network mode? Host-only private network (with or without NAT) or bridged?

slhck's user avatar

slhck

221k70 gold badges599 silver badges590 bronze badges

answered Jun 7, 2012 at 21:56

Ubeogesh's user avatar

UbeogeshUbeogesh

6306 silver badges13 bronze badges

Maybe it is too late for answer, but I had same problem. Simply install VMware vSphere Client and after logon you can right click on VM and open in console where mouse and keyboard works. CTRL + ALT to exit your mouse from console.

answered Jul 7, 2017 at 7:08

CiviDeja's user avatar

To find any unknown host on your network (whether it’s a VM or not) you can use Angry IP scanner. Another option for Linux is arp-scan (it’s not usually installed by default, but has very few dependencies). The command arp-scan -l will give you a table of IP addresses and associated MAC addresses. All of your VM’s will have similar MAC addresses, so you can narrow it down that way if you have a large network.

answered Feb 1, 2018 at 17:45

Charles Burge's user avatar

Charles BurgeCharles Burge

2,0801 gold badge8 silver badges14 bronze badges

From a Linux box, do an arp-scan on your VMware interface and look for the MAC:

arp-scan --interface=vmnet8 -l
192.168.169.146 00:0c:29:40:5e:db   VMware, Inc.
192.168.169.254 00:50:56:f1:76:14   VMware, Inc.

Run5k's user avatar

Run5k

15.7k24 gold badges49 silver badges63 bronze badges

answered Jun 3, 2020 at 18:53

ousbenz's user avatar

The simplest way no use of virtual machine settings just follows the steps provided in the link.

https://kb.wisc.edu/helpdesk/page.php?id=6526

Open installed Mac OS go to Menu click on Apple icon -> System Preferences -> Network -> Ethernet and see your IP address

enter image description here

answered Feb 22, 2018 at 9:55

Mahavirsinh Padhiyar's user avatar

🍺 vmrun list
    Total running VMs: 1
    .docker/machine/machines/myvm.vmx

🍺  vmrun getGuestIPAddress ~/.docker/machine/machines/myvm.vmx
    172.16.213.128

credit to: https://superuser.com/a/948260 (^ this is copied from an answer to a different question)

Community's user avatar

answered Oct 20, 2022 at 21:32

Goodword's user avatar

0

Vmware Power CLI

Как найти виртуальную машину VMware по mac-адресу.

VMware PowerCLI logo

Итак, как найти виртуальную машину VMware по мак-адресу сетевого интерфейса.

Иногда есть необходимость определить какой виртуальной машине принадлежит mac-адрес. В среде VMware это можно сделать с помощью PowerCLI.

Для этого в PowerCLI подключаемся к vcenter командой Connect-VIServer

и вводим

Get-VM | Get-NetworkAdapter | Where-Object {$_.MacAddress -eq “mac-address”} | Format-List -Property *

где mac-address — мак виртуалки, которую нужно найти в формате 00:00:00:00:00:00

Еще статьи по виртуализации и VMware.

На нескольких серверах построен кластер VMware. Их координаты потеряли. Как найти среди серверов расположение каждого? Как из vSphere включит led для идентификации серверов?


  • Вопрос задан

    более трёх лет назад

  • 204 просмотра

Пригласить эксперта

Какие координаты вам нужны? Географические? Как вы себе это представляете?
А у серверов точно есть led? Какие сервера (марка/модель)?

IP-адреса известны, MAC-адреса известны — ищите маки интерфейсов управления на коммутаторах, и идите по проводу от порта коммутатора до порта сервера.


  • Показать ещё
    Загружается…

23 мая 2023, в 11:12

15000 руб./за проект

23 мая 2023, в 11:05

5000 руб./за проект

23 мая 2023, в 10:47

300000 руб./за проект

Минуточку внимания

Добавить комментарий