views:

808

answers:

4

Let's suppose I have VMWARE workstation (guesting Windows and hosted by Windows). Is there any possible way to receive host name of hosting machine? And without changing things on host machine like in this link.

A: 

In principle - no.

However, it is possible that there may exist (or will exist) certain vulnerabilities that allow a malicious guest OS to bypass the VM sandbox. For instance, read up on the Blue Pill. You can also read more details on the researcher's own blog, Invisible Things by Joanna Rutkowska.
Of course, these are just proof of concept, but any security implemented in software is subject to software bugs...

AviD
A: 

You have effectively two computers on a network. If you use one of the private network/NAT style set-ups for the virtual NICs, then the host has a fairly predictable IP address, so you could then use any of the many remote admin approaches to ask it just like you would any other.

If there is only the one guest OS, then just trying every IP address with the same leading 24 bits as the guest's IP address would save baking in a guess at an address.

Steve Gilham
A: 

I do this by passing a string from host to guest via machine.id. It does require making a change on the host (in every VM's .vmx file, too), and it doesn't automatically discover the host's hostname, but it works. On the host, with the VM in question powered down, edit the .vmx file for the VM. Find or add a line that looks like:

machine.id = "<string>"

Set <string> equal to some identifying string that will tell you the name of the server. This could be the hostname, or it could be a shortened version of it, or even some unintelligible code if you prefer, as long as you know what it means. If, however, the .vmx file has a line that sets

isolation.tools.machine.id.get.disable = TRUE

passing a string won't work, so if this line is present you might want to either remove/comment it or set the value to FALSE.

On the guest OS, if you have VMware Tools installed, you can then do this (for Linux guests):

vmware-guestd --cmd 'machine.id.get'

or (for Windows guests, which I haven't tried):

VMwareService --cmd machine.id.get
Thomas Lee
A: 

I think there are probably a number of ways to do this, and can think of two off the bat: One would be to install ViX in the guest, connect to the host without specifying the hostname, (Google "ViX reference" then see "common tasks") then use Vix_CopyFileFromHostToGuest() to copy the file /etc/vmware/esx.conf. Another would be to create some sort of network connection from the guest to the host (I used ssh but if you don't know the hostname or IP you could still do the ViX connection thing as above and dispatch a job that takes a while) and then say "netstat -a" in the guest. The netstat output will contain the hostname, if it is resolvable.

dkl