Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Virtual Server

Vista - How do I query the virtual server from an app

Reply
 
Old 10-10-2008   #1 (permalink)
David Thielen


 
 

How do I query the virtual server from an app

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@xxxxxx-at-at@xxxxxx
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm

My System SpecsSystem Spec
Old 10-10-2008   #2 (permalink)
Robert Comer


 
 

Re: How do I query the virtual server from an app

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-M.../dp/0470109173

--
Bob Comer


On Fri, 10 Oct 2008 15:40:24 -0600, David Thielen
<thielen@xxxxxx> wrote:
Quote:

>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@xxxxxx-at-at@xxxxxx
>Windward Reports -- http://www.WindwardReports.com
>me -- http://dave.thielen.com
>
>Cubicle Wars - http://www.windwardreports.com/film.htm
My System SpecsSystem Spec
Old 10-11-2008   #3 (permalink)
Bo Berglund


 
 

Re: How do I query the virtual server from an app

On Fri, 10 Oct 2008 15:40:24 -0600, David Thielen
<thielen@xxxxxx> wrote:
Quote:

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

Bo Berglund (Sweden)
My System SpecsSystem Spec
Old 10-11-2008   #4 (permalink)
Tim Walsh


 
 

Re: How do I query the virtual server from an app

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/scr....mspx?mfr=true



"David Thielen" <thielen@xxxxxx> wrote in message
news:7pive4drdcsmt1enff2hpr1clf7asoe3e9@xxxxxx
Quote:

> 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@xxxxxx-at-at@xxxxxx
> Windward Reports -- http://www.WindwardReports.com
> me -- http://dave.thielen.com
>
> Cubicle Wars - http://www.windwardreports.com/film.htm

My System SpecsSystem Spec
Old 10-11-2008   #5 (permalink)
David Thielen


 
 

Re: How do I query the virtual server from an app

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


On Sat, 11 Oct 2008 06:27:50 +0200, Bo Berglund <boberglund@xxxxxx>
wrote:
Quote:

>On Fri, 10 Oct 2008 15:40:24 -0600, David Thielen
><thielen@xxxxxx> wrote:
>
Quote:

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

david@xxxxxx-at-at@xxxxxx
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
My System SpecsSystem Spec
Old 10-19-2008   #6 (permalink)
David Thielen


 
 

Re: How do I query the virtual server from an app

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?


On Fri, 10 Oct 2008 21:26:39 -0400, Robert Comer
<bobcomer-removeme-@xxxxxx> wrote:
Quote:

>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-M.../dp/0470109173

david@xxxxxx-at-at@xxxxxx
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
My System SpecsSystem Spec
Old 10-19-2008   #7 (permalink)
David Thielen


 
 

Re: How do I query the virtual server from an app

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


On Sat, 11 Oct 2008 09:11:38 -0400, "Tim Walsh" <tmwalsh@xxxxxx>
wrote:
Quote:

>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/scr....mspx?mfr=true
>
>
>
>"David Thielen" <thielen@xxxxxx> wrote in message
>news:7pive4drdcsmt1enff2hpr1clf7asoe3e9@xxxxxx
Quote:

>> 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@xxxxxx-at-at@xxxxxx
>> Windward Reports -- http://www.WindwardReports.com
>> me -- http://dave.thielen.com
>>
>> Cubicle Wars - http://www.windwardreports.com/film.htm
>

david@xxxxxx-at-at@xxxxxx
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
My System SpecsSystem Spec
Old 10-19-2008   #8 (permalink)
Bo Berglund


 
 

Re: How do I query the virtual server from an app

On Fri, 10 Oct 2008 15:40:24 -0600, David Thielen
<thielen@xxxxxx> wrote:
Quote:

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

>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/Community.../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/Thw...on_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"

--

Bo Berglund (Sweden)
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Virtual Server 2005 or Virtual PC 2007 - to run server labs ? Virtual PC
Vista Home Premium .. Can't install Virtual Server.. so how do Iautomatically start a Virtual PC without a login? Virtual PC
Virtual Server 2005 R2 SP1 - How to drag files into Virtual Server? Virtual Server
Virtual Server 2005 r2 - moving VPC server to server - blue screen Virtual Server
Can't join Virtual Vista to a Virtual 2008 Domain Server Virtual PC


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46