VMware Cloud Community
jenish_shah
Contributor
Contributor

Way to find if Guest OS installed on Virtual Machine?

Can anybody please let me know if there is a CLI or any other way to find out if Guest OS is installed on Virtual Machine?

Reply
0 Kudos
10 Replies
alhamad
Enthusiast
Enthusiast

You can boot the VM and check what OS starts

Reply
0 Kudos
jenish_shah
Contributor
Contributor

That I can always do...

But what I want is without doing that is there any CLI by which I can come to know that if VM has Guest OS installed or not...

Reply
0 Kudos
Pheatus
Enthusiast
Enthusiast

You could check the .vmtx file in your vmfs-folder: cat \vmfs\volumes\xxxxxxxxxxx\vm\vm.vmtx | grep guestOS

There should be a line with guestOS (for example: guestOS = "winNetStandard-64" for a Windows 2003 Server 64-bit machine)

Reply
0 Kudos
jenish_shah
Contributor
Contributor

You are right but this line have entry for the Guest OS which we select while creating VM.

But consider the case that I have selected one OS while creating VM but still I havent installed any Guest OS on VM actually.

I want to know if actually any Guest OS is installed on VM or not.

Reply
0 Kudos
Pheatus
Enthusiast
Enthusiast

Ah OK. Well I guess we could use vmware-cmd \vmfs\volumes\xxxxxx\vm\vm.vmx getguestinfo ip to see it's ip-address.

If I'm correct, the host won't have an ip-address assigned before it's guest is installed, right?

Although I'm not sure if the VM should be running or not...

Reply
0 Kudos
Rajeev_S
Expert
Expert

Jenish: You can view that in the VI Client. In the right pane > Virtual machines > right click Task bar > Select GUEST OS.

You can also select to display the IPadd and other parameters of the VM.

Reply
0 Kudos
Chris_S_UK
Expert
Expert

OK, from the CLI, as you requested and as other posters seem to have ignored, you could try something like this:

cat vmware.log | grep tools

That should tell you if the VM has reported VMware tools running in it any point. It also doesn't require that the VM be running at the time.

Caveats:

1. It won't tell you which OS it is but you might get that from a different grep command

2. The Os might have been removed since the tools were identified.

Chris

Reply
0 Kudos
jenish_shah
Contributor
Contributor

Yeah.. we can find ip address if Guest OS is installed on VM.. But I think there is some bug with VMWare tools.. I have one Virtual Machine which has Windows installed and I can log into that by Remot Desktop. But still VIC or the command given by you is not giving ip address of the same machine...

Can anybody throw some light on it?

Reply
0 Kudos
Rajeev_S
Expert
Expert

Hi,

You can find the guest OS using this command

less | grep guestOS Hope this helps.

Reply
0 Kudos
jenish_shah
Contributor
Contributor

Nope.. Actually this command will give the OS which we select while creating Virtual Machine..

What I want is what is the actual Guest OS installed on Virtual machine

Reply
0 Kudos