In our lab, we have a server running Ubuntu Linux 8.04.4 x64, with VMware Server 2.1 hosting 4 VM's.

I have a major concern with regards to shutting down the host server. Mostly, how do I ensure that the guest VM's are being shut down safely?

In the VMware web interface console, I have enabled:

  • "Allow virtual machines to start and stop automatically with the system"
  • I enabled the Default Startup Delay for 15 seconds along with the "Start next VM immediately if the VMware Tools start" option checked
  • I enabled the Default Shutdown Delay with a 60 second shutdown delay and a Shutdown Action of "Shut Down Guest"

All VM's have the VMware Tools installed and properly working. All VM's are moved up into the "Specified Order" section of "Startup Order", thus when powering the server back on, all those VM's should start up again in that specified order.

When I went to shut down the server, I used the shutdown -h now command. Based on the settings I entered above, I was expecting a 4 minute shutdown, as there is an option to delay the shutdown of each VM by 60 seconds. However, that is not what happened. Instead, the server shutdown in under a minute.

When I powered the server back on, only 2 VM's properly loaded. The other 2 showed the following error:

"Power on Virtual Machine" failed to complete

If these problems problems persist, please contact your system administrator.

Details: Cannot open the disk '[location to .vmdk]' or one of the snapshot disks it depends on. Reason: Failed to lock the file.

Obviously, if this error occured, then it is clear to me that the VM's were not properly shutdown, or the server powered off before the VM's were completely shutdown. I have fixed the above error by deleting the .lck files in the respective VM directories.

How would I know if the VM's were properly shut down? I checked the VMware-server logs, but they only seem to display the logs of when the vmware-mgmt service is running in the current session. I'm mostly running Linux VM's, so is there an easy way to know whether or not a server was properly shut down in Linux?

Thank you all for the help!


If you use shutdown -h now, it will shut down immediatly regardless of "default settings" since you override those with the parameter.

That being said, last time we shut down our environment we did each VM seperately, waited until they all showed as powered off, and then shutdown the host (ESXi in this case). This allows you to check for errors during shutdown of the VM's, and in our case shutdown the webservers and THEN the database servers of a specific application to avoid any errors.

We do the same when starting up, and again make sure there's no errors.

I think it's important to figure out a proper shutdown and startup procedure in the case of production environments.

That being said, I think you will need to supply more information on what VM's they are. I think VMware Server won't be able to tell the difference between a shutdown with errors and one without.

P.S. why not use ESXi to begin with?

  • 2
    ESXi is free, and hardly hardcore. Look into it! – HannesFostie Apr 18 '10 at 17:59
  • Agreed - go with ESXi if you can. Not only will performance be significantly higher than VMware Server, but it adds a bunch of very nice functionality as well (like the ability to gracefully handle guest shutdowns). – EEAA Apr 18 '10 at 18:24
  • ESXi isn't hard to implement at all. Download, install, set some stuff up if needed (such as static IP, hostname, password) in the bios-like GUI, log in remotely using VI client and you're all set! – HannesFostie Apr 19 '10 at 7:03

SSH into each VM and issue shutdown -h now. This is the proper way to shut down a linux machine, virtual or not.

  • 1
    I am pretty surprised how many people vote down on this answer. I had like 4 down votes on it! Care to enlighten me why YOU think that shutdown -h now is not a proper way to shutdown a Linux server? Be it a VM or a hardware box. – solefald Apr 20 '10 at 22:55
  • I voted you up. Your answer is correct. – Phanto Jun 20 '10 at 3:04
  • 2
    Its not about to shutdown a linux virtual machine but about shutdown a linux host (debian for instance) running vmware server, this one running any virtual machines you want with vmware tools. when shutting down the host (debian) this one should wait vmware server has finished to properly shutdown any virtual machines that are running. It's obvioulsy not the case. – user135971 Sep 14 '12 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.