Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 915
  • Last Modified:

Detect virtual machine

Is there a way to detect if an application (windows only, not unix or any other OP system) is running inside a virtual machine environment?
If so then how?
0
AndyAinscow
Asked:
AndyAinscow
  • 3
  • 2
1 Solution
 
BarthaxCommented:
Absolutely: the clues are left behind to be detected.  Some sample code is available for VMWare and Virtual PC at http://www.codegurus.be/codegurus/Programming/virtualpc&vmware_en.htm
0
 
stsanzCommented:
What do you call a "virtual machine"? In Windows, all applications run in a virtual machine.

Do you mean a virtual PC ?
0
 
AndyAinscowAuthor Commented:
Interesting,  I've had a quick read.
Do you happen to know about detecting VirtualBox as well?

(I only know of VMWare, VirtualPC and VirtualBox - if you know of other vitualisation machines then I would need to test for those also).
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
AndyAinscowAuthor Commented:
@stsanz
For clarification.
I start a PC with eg. XP.  I run a piece of software eg. VirtualBox and create a virtual machine running Vista inside the XP system.  Now I can install a program in the virtual machine running Vista.  The app sees a vista environment, not an XP environment.

In other words a nested operating system.  I don't need to know anything about the OP systems, all I want to be able to do is find out if the app is running inside the nested OP system.
0
 
BarthaxCommented:
Hmmm... hadn't considered any others. ;)  I haven't found any code snippets but there is a generic detection method.  Certain pieces of hardware (hard drives, for example) will usually have generic names.  Note, however, that knowing the virtualised hardware components of virtualised machines becomes quite long-winded when you consider that you have Xen, Parallels, QEmu and older emulations such as Bochs.  Add to this, the emulations may appear to be "real hardware" even when they're not or they could be pass-through to real technology such as the Xen PCI Pass-Through options.

Other, than the simplest of detections I would really consider why it is you need to detect it.

There's a good blog post over at http://weblogs.asp.net/jgalloway/archive/2006/10/27/can-operating-systems-tell-if-they_2700_re-running-in-a-virtual-machine_3f00_.aspx to cover these circumstances (and others).
0
 
AndyAinscowAuthor Commented:
Thanks, and have a good Xmas and new year.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now