VMware: How do I change a forgotten root password on my ESX Server Host?


Occasionally, an administrator will ask about recovering the password to an ESX Server host:

  • I do not know the root user’s password on my ESX Server host. How can I reset the password?
  • I have lost the root password to my ESX host, how can I recover it? This article provides a solution to the problem of having a lost password for the root account on an ESX Server host.

Note: In some cases a defective keyboard can cause problems logging into ESX. You might want to test with a different physical keyboard if you are having difficulties with known login credentials.

If you have forgotten or don’t know the password for the root user on an ESX Server host, you can change it without reinstalling ESX Server. 

Warning: This can be used maliciously and should be safeguarded against through proper physical access to the host, authenticated remote console access, monitoring and protection against reboot procedures (e.g. grub password) and limited access to the management network.

See http://www.vmware.com/resources/techresources/726 for more information on security best practices.

Note: The procedure below performs a password reset, it "blindly" replaces the existing root password with a new one. This is not password recovery, it does not allow you to learn the original root password. VMware does not provide tools or methods to recover the original root password of an ESX host.

To change the password for the root user, you must reboot the ESX Server host into service console only in single-user mode. To do this, follow the steps below appropriate for your version of ESX:

ESX Server 3.x:

  1. Reboot the ESX Server hostimage
  2. When the GRUB screen appears, press the space bar to stop the server from automatically booting into VMware ESX Serverimage
  3. Use the arrow keys to select Service Console only (troubleshooting mode)
  4. Press the a key to modify the kernel arguments (boot options)image
  5. On the line presented, type a space followed by the word single
  6. Press Enter.  The server continues to boot into single-user mode
  7. When presented with a bash prompt such as sh-2.05b#, type the command passwd and press Enterimage
  8. Follow the prompts to set a new root user password
  9. When the password is changed successfully, reboot the host using the command reboot and allow VMware ESX Server to boot normally
    Check out the complete knowledge base article after the jump
    Source: 1317898

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *