Windows Vista Forums

How do I query the virtual server from an app

  1. #1


    David Thielen Guest

    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

  2. #2


    Robert Comer Guest

    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:

    >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

  3. #3


    Bo Berglund Guest

    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:

    >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

  4. #4


    Tim Walsh Guest

    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

    > 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

  5. #5


    David Thielen Guest

    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:

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

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

  6. #6


    David Thielen Guest

    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:

    >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

  7. #7


    David Thielen Guest

    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:

    >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

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

  8. #8


    Bo Berglund Guest

    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:

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

How do I query the virtual server from an app

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Server 2005 or Virtual PC 2007 - to run server labs ? Bob Virtual PC 2 18 Aug 2009
Vista Home Premium .. Can't install Virtual Server.. so how do Iautomatically start a Virtual PC without a login? jc Virtual PC 3 17 Oct 2008
Virtual Server 2005 R2 SP1 - How to drag files into Virtual Server? ViNC3 via WinServerKB.com Virtual Server 1 14 Oct 2008
Virtual Server 2005 r2 - moving VPC server to server - blue screen Jeff M. Virtual Server 1 25 Sep 2008
Can't join Virtual Vista to a Virtual 2008 Domain Server Golden Z Virtual PC 5 17 Jul 2008