PDA

View Full Version : Detecting installation on a 'virtual' OS ?


pww
08-22-2005, 05:37 AM
Hi,

is it somehow possible to detect if my installer is started on a 'virtual' OS - like one running inside VMWare, Microsoft's Virtual PC and other emulators?
So far I have no clue what may be used to make a difference, maybe someone here has an idea?

Thanks.

bnkrazy
08-22-2005, 10:44 AM
I don't know of any 'magical' place to look for any and all emulators. I did a quick test on a new VMWare XP install (without the VMWare tools installed) and there is a ton of registry entries containing the string 'vmware'. I assume you could weed through and find one that would be fairly consistant. The following is probably a good bet:

HKLM\System\CurrentControlSet\Services\Disk\Enum
Key=0
Value=IDE\DiskVMWare_Virtual_IDE_Hard_Drive ...

I would assume that the MS VPC would leave as long of a trail as well.

Lorne
08-22-2005, 11:04 AM
I doubt those registry entries would be made inside the emulated system's registry...although you never know, VMWare may set a specific registry key within the emulated system's registry to indicate that it's an emulated system.

A quick search through the registry for "virtual" on a Virtual PC emulation didn't turn up any non-standard keys.

With a device driver you could try something really out there like walk the int3 hook table to see if the debug interrupts are trapped, but even that might not work if the emulator completely emulates the hardware in software, in which case you'd only see what the emulator simulates.

If you find out, let us know...this is an interesting question. :)

HMMurdock
08-22-2005, 06:12 PM
I've got to agree with bnkrazy. I think looking in the registry for hardware identifiers is your best bet.

I'm not entirely sure about VMWare, but I know with Virtual PC when you install a "child" OS it is completely unaware that it's being installed in a virtual machine. If that's the case, the only thing that would be different (or consistant... depending on how you look at it) would be the hardware Identifiers.

It looks like VMWare emulates a hard drive that has a hard drive named "DiskVMWare_Virtual_IDE_Hard_Drive" And in Virtual PC it emulates a CD ROM drive called "MS" Both values can be searched for in the registry. (the HD under HKLM\ENUM\ESDI and the CD under HKLM\ENUM\SCSI if memory serves me correct, but it will also depend what "child" OS you are looking in also)

Eagle
08-23-2005, 07:01 AM
Below link may provide an answer to 'how' to detect for the 'real coders'
out there..may be something in here for the Dev team ?

Source is free for commercial and non commercial use..

try the link and have a play with this one...

http://www.naughter.com/dtwinver.html


There is a win32 prebuilt and the code for C++ etc..

if I am reading it correctly ..will detect the 'emulated OS and the
'underlying real Os' is running from..

HTH some of you gurus come up with a detection..or maybe Lorne
--add to the Os detection table