Hi;
If this is the wrong NG, please let me know which one to ask in.
Is there a way for my program to determine if I am running in a
virtual machine, and if so, to the ask the VM manager for a GUID that
identifies that physical server.
We presently use the MAC address to get a GUID for each machine but
each VM can have a different MAC address so that doesn't work for this
situation.
I need the code for both C# and Java.
Also, if anyone knows how to do this for VMWare and/or the main open
source approach, a url to that also would be appreciated.
thanks - dave
david@at-at-at@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Robert Comer - 11 Oct 2008 02:26 GMT
You might want to take a look at Ben Armstrong's book, it has
everything I ever needed for Virtual Server. No Java, but there's the
COM API.
http://www.amazon.com/Professional-Microsoft-Virtual-Server-Programmer/dp/0470109173

Signature
Bob Comer
>Hi;
>
[quoted text clipped - 20 lines]
>
>Cubicle Wars - http://www.windwardreports.com/film.htm
David Thielen - 19 Oct 2008 20:55 GMT
Hi;
Good book but it doesn't show how to do this specific item. It shows
how to get the BIOS ID, etc but all those values can be set to be
different on each system.
Any idea how to get a GUID of some type that is identical in all VMs?
>You might want to take a look at Ben Armstrong's book, it has
>everything I ever needed for Virtual Server. No Java, but there's the
>COM API.
>
>http://www.amazon.com/Professional-Microsoft-Virtual-Server-Programmer/dp/0470109173
david@at-at-at@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Bo Berglund - 11 Oct 2008 05:27 GMT
>We presently use the MAC address to get a GUID for each machine but
>each VM can have a different MAC address so that doesn't work for this
>situation.
This is not specific for a Virtual Machine...
All PC:s can have multiple MAC addresses, since these are connected to
the network cards and you can have several such in each PC.
It is a misconception that a PC has a MAC address, in fact the network
card is the one with the unique MAC address. So the PC is associated
with one or several MAC addresses depending on the number of inserted
NIC:s.
If a NIC breaks and is replaced with another then the MAC address also
changes.
So it is a bad idea to lock up software against a MAC address in the
first place.

Signature
Bo Berglund (Sweden)
David Thielen - 11 Oct 2008 23:30 GMT
Sorry - yes you are right. We query all MAC address and use the lowest
numbered one to ID the machine. We do this for licensing like MS does
with their products.
It would be nice if we didn't have to do this, unfortunately without
this we would probably lose over half our business - based onc alls we
get from people.
thanks - dave
>>We presently use the MAC address to get a GUID for each machine but
>>each VM can have a different MAC address so that doesn't work for this
[quoted text clipped - 12 lines]
>So it is a bad idea to lock up software against a MAC address in the
>first place.
david@at-at-at@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Tim Walsh - 11 Oct 2008 14:11 GMT
The Technet scripting center provides some go scripts for working with
Virtual Servers and Host machines. Not that hard to modify them for other
languages.
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true
> Hi;
>
[quoted text clipped - 20 lines]
>
> Cubicle Wars - http://www.windwardreports.com/film.htm
David Thielen - 19 Oct 2008 20:56 GMT
Hi;
I checked out the scripts but it doesn't show how to do this specific
item. It shows how to get the BIOS ID, etc but all those values can be
set to be different on each system.
Any idea how to get a GUID of some type that is identical in all VMs?
thanks - dave
>The Technet scripting center provides some go scripts for working with
>Virtual Servers and Host machines. Not that hard to modify them for other
[quoted text clipped - 26 lines]
>>
>> Cubicle Wars - http://www.windwardreports.com/film.htm
david@at-at-at@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Bo Berglund - 19 Oct 2008 22:42 GMT
>Is there a way for my program to determine if I am running in a
>virtual machine, and if so, to the ask the VM manager for a GUID that
>identifies that physical server.
...
>Also, if anyone knows how to do this for VMWare and/or the main open
>source approach, a url to that also would be appreciated.
One approach would be to forbid usage of your app within virtual
machines by detecting them and the stopping program execution...
Here are a few links that may help. I have created a small app myself
using information obtained by reading started on these places. The
application detects (mostly) if it runs in a virtual machine.
http://www.invisiblethings.org/papers/redpill.html
This is the original paper I discovered some time ago and it includes
a test application that you can use to see if the technique applies to
your virtualization environment.
http://malwareanalysis.com/CommunityServer/blogs/geffner/archive/2006/08/21/15.aspx
Discussion on how/why the red pill may fail...
http://www.offensivecomputing.net/files/active/0/vm.pdf
This paper may also be interesting reading on the subject of vm
detection.
http://handlers.sans.org/tliston/ThwartingVMDetection_Liston_Skoudis.pdf
More on the same theme..
http://www.offensivecomputing.net/files/active/0/vm.pdf
And this is another such article...
You may find more by googling "red pill virtual machine"

Signature
Bo Berglund (Sweden)