Jump to content

check if in a virtual environment


MCT

Recommended Posts

hey guys, how can i check if im in a virtual environment? ie vmware

i cant check to see if vmware tools is installed cuz the latest version doesnt allow for seamless unattended installs, it messes up , it prevents windows from loading first time :S

anyways, so im wanting to test if maybe the make of a cdrom or something?

Link to comment
Share on other sites


Hi MCT,

In prompt you can write "set" and it will show you all the variables.

I just tried it in VMware and the only thing that i can notice is this:

When i do it in the host Windows XP i get this:

PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 4, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0404

However when i do it in VMware (on the same pc) it changes a bit:

PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 8, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0408

I dont know if this is helpful to you at all...?

EDIT:

Hmm no I dont think this is helpful :(

I just tried doing set on another server running VMware and the values are totaly different (obviously because its a different architecture).

Edited by druiddk
Link to comment
Share on other sites

AHA!

You can check if this registry entry exists:

[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0\]
"Identifier"="VMware Virtual IDE Harddrive"

This holds some information on VMware.VirtualDisk.

I dont know how to do the check, but I'm sure someone can help you out make a script that will check for the existance of this key.

Edited by druiddk
Link to comment
Share on other sites

thanks, the vmware tools id unno whats wrong, ive had it on there ever since vmware 4x ive updated the tools with each new release/beta so i dunno why its not working , it works if im inside a guest thats booted up, just not during T12 stage

Link to comment
Share on other sites

I do not know if this will help but this adds a DVD drive to a virtual machine.

I can not test this because I do not use Virtual Machines for installs

Save as Add_DVD_VMachine.VBS

Blue text is the name for the type of OS change to suit your needs.

On Error Resume Next

Set objVS = CreateObject("VirtualServer.Application")

Set objVM = objVS.FindVirtualMachine("Windows 2000 Server")

errReturn = objVM.AddDVDROMDrive(0,1,0)

This script searches for a Virtual Network

Save As Search_ForNetwork_VM.VBS

On Error Resume Next

Set objVS = CreateObject("VirtualServer.Application")

Set objNetwork = objVS.FindVirtualNetwork("Scripted Network")

I have added a SFX file with a bunch of VBS scripts for Virtual Machine there might

be some thing in there that can help. It will extract to here %systemdrive%\VirtualMachineScripts

Then it will open the folder where the script are.

Edited by gunsmokingman
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...