VMware Communities
FrancisB33
Contributor
Contributor

Detecting when guest OS installation is over

Hi all,

I got the task to setup a developer machine completely with Powershell (Installing VMware Workstation, Creating VM, installing Windows Guest OS, installing the necessary applications in the VM).

So far, it was quite easy to do the installation of VMWare Workstation, creating the virtual machine and installing the guest OS and I figure it out that it will be easy to install applications in the guest OS with the command runScriptInGuest. My problem lies between the tasks "Installing Guest OS" and "Installing Applications in Guest OS".

Since these two tasks are run one after the other, I need to detect when the installation of the Guest OS is finished before starting the other task. So far, I didn't find a perfect solution. I read somwhere a proposed solution where the guy suggested to monitor the CPU and/or the memory of vmware_vmx.exe. I find the solution not very reliable since the CPU and memory vary during the installation (CPU drops to 0% several times during the installation) and after the installation there's still some activity in the VM. So I would need to find the perfect threshold for CPU and memory where I can consider that the installation is over.

Anyone has a better solution to resolve this problem?

Thanks in advance.

0 Kudos
2 Replies
WoodyZ
Immortal
Immortal

Since these two tasks are run one after the other, I need to detect when the installation of the Guest OS is finished before starting the other task. So far, I didn't find a perfect solution. I read somwhere a proposed solution where the guy suggested to monitor the CPU and/or the memory of vmware_vmx.exe. I find the solution not very reliable since the CPU and memory vary during the installation (CPU drops to 0% several times during the installation) and after the installation there's still some activity in the VM. So I would need to find the perfect threshold for CPU and memory where I can consider that the installation is over.

Using CPU and or Memory as a gauge in this use case scenario is ridiculous and I really do not consider this a VMware issue per se and is really no different then installing OSes and Application on Physical Hardware and you'll need to code your scripts accordingly.  Also I'd not install any applications in the OS, physical or virtual, until all OS Updates are done first.

FrancisB33
Contributor
Contributor

Thanks WoodyZ.

I saw one of your message in one discussion similar to what I'm trying to do: http://communities.vmware.com/thread/291830?start=15&tstart=0

In one of your messages, you were talking about changing 'telinit 5' to 'telinit 0' to shutdown the VM once the installation is complete. I like your solution because I just have to detect when the vmware-vmx is gone to know the installation is complete but I'm wondering if it is possible to achieve this same behavior with a Windows Installation i.e. shutting down the VM?

0 Kudos