How to find the IP Address of a vm running on VMware (or other methods of using VM)

33

12

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.

sixtyfootersdude

Posted 2012-06-07T19:06:17.457

Reputation: 6 399

VMware Tools only gives you enhanced mouse integration (among other things); for example, the mouse no longer gets trapped in the VM window, forcing you to manually release it. Without the Tools, the VM should still be able to capture the keyboard and mouse, by clicking on/in the window and typing. There are icons in the bottom right of the host window that show the capture state. – Ken – 2012-06-08T01:04:47.963

@Ken That was my understanding as well. Unfortunately this does not appear to be the case with this vm. – sixtyfootersdude – 2012-06-08T11:38:03.983

Answers

34

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

Found the MAC address and the IP will be on the side.

In this case the IP is: 192.168.20.128

F Boucheros

Posted 2012-06-07T19:06:17.457

Reputation: 615

1For me, the VM (using a DHCP address from my router) was not in my local machine's arp table. To make it knows on the network I had to get the VM to attempt a connection to my host ip - which was tricky, since i couldn't access the VM, but i did it. – andrew lorien – 2016-01-31T23:52:48.993

On Windows10 you can use Settings -> Network & Internet -> Ethernet and click on VMWare Network Adapter VMNet8 which is the switch used for NAT: Useing the host's IP address. If you're useing Bridged, then it will be VMNet1. Once you click it you will see IP address assigned to that switch and it's MAC address. You can confirm it's the same MAC address in the same settings menu in @F Boucheros anwser – loostro – 2016-08-05T17:58:29.670

VMNet1 is always assigned to Bridged mode, VMNet8 is always assigned to NAT mode – loostro – 2016-08-05T17:59:14.063

7

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
    ...

Martin Zeitler

Posted 2012-06-07T19:06:17.457

Reputation: 232

1This requires access to the VM console, which @sixtyfootersdude is saying he hasn't got. – RivieraKid – 2015-06-24T10:33:34.583

@RivieraKid those commands can be executed on a local console of any machine running within VMware - if basic keyboard and/or mouse are not available at the shell prompt - that rather sounds like a general container mis-configuration... because only the enhanced keyboard depends on VMware tools. if no keyboard - simply mounting the disk into a fully functional OS is always possible (and rather hassle free). – Martin Zeitler – 2015-06-25T07:41:35.580

1I agree, but OP states: "When I power on a centOS (Linux) virtual machine I cannot get mouse or keyboard control of the machine.". While I agree that there's something not right about his configuration, this does not answer the question. – RivieraKid – 2015-06-25T10:01:42.660

On Linux, ifconfig is now deprecated. It has been removed entirely from RHEL/CentOS 7, for example. Use ip addr instead. – kbolino – 2015-08-07T18:58:16.457

still have that command... while most likely the VM just has those input devices connected as USB devices - which causes them to be inaccessible to the driver - which is actually running on the host OS. – Martin Zeitler – 2015-08-08T20:30:53.133

@kbolino updated that. – Martin Zeitler – 2015-08-08T20:40:52.597

1

The simplest easy way no use of virtual machine settings just follow 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 Prefenreces -> Network -> Ethernet and see your ip address

enter image description here

Mahavirsinh Padhiyar

Posted 2012-06-07T19:06:17.457

Reputation: 205

1

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

JoshP

Posted 2012-06-07T19:06:17.457

Reputation: 2 236

0

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.

CiviDeja

Posted 2012-06-07T19:06:17.457

Reputation: 1

0

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.

Charles Burge

Posted 2012-06-07T19:06:17.457

Reputation: 1 792

0

On Windows 7,

  1. Copied the MAC address to the clipboard
  2. Open C:\ProgramData\VMware\vmnetdhcp.leases in Notepad
  3. Search for the MAC address string.

Michael Scott

Posted 2012-06-07T19:06:17.457

Reputation: 1

0

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.

poomcyber

Posted 2012-06-07T19:06:17.457

Reputation: 1

0

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?

Ubeogesh

Posted 2012-06-07T19:06:17.457

Reputation: 530