
How to Reset VMware ESXi Password
Forgetting the root password for a VMware ESXi host can be a significant obstacle, effectively locking you out of your virtualization environment and halting critical management tasks. Fortunately, if you have physical or remote console access to the server, a reliable method exists to regain control. By utilizing a bootable Linux environment, you can directly access the ESXi system partition and reset the password. This comprehensive guide provides a detailed, step-by-step process to help you securely recover access to your ESXi host and restore full operational control.
This powerful recovery technique involves booting your server from a temporary operating system to modify the essential file that stores user password information. Before proceeding with this procedure to reset your VMware ESXi Password, it is crucial to ensure you have all the necessary prerequisites prepared and ready.
To successfully navigate the ESXi root password reset process, you will need to gather a few key items and ensure you have the appropriate access to the hardware. Proper preparation is essential for a smooth and effective recovery operation. Please ensure you have the following:
The core of this recovery method is to mount the specific ESXi state partition where vital configuration files, including the encrypted password data, are stored. Once mounted, you can modify the password file and then repackage it to apply the changes.
The first active step is to bypass the ESXi operating system entirely by booting into your prepared Linux environment. Insert your Linux Live media and restart the ESXi host. During the initial startup, press the appropriate key (often F11, F12, or DEL) to enter the boot menu. From there, select the CD/DVD or USB device containing your Linux distribution.
Once the Linux desktop or command-line interface has fully loaded, open a terminal window. To perform the necessary file system operations, you will need to elevate your privileges to root. You can typically do this by running the command sudo -i. Next, you must identify the correct ESXi system partition. Use a command like fdisk -l or lsblk to list all connected block devices. Look for a small partition, usually around 250MB, which might be labeled as “FAT16” or “VMware Diagnostic.”
After identifying the partition (for example, /dev/sda5), create a temporary mount point with mkdir /mnt/esxi. Then, mount the partition using the command: mount /dev/sda5 /mnt/esxi. Be aware that the device name, such as /dev/sda5, is an example and may differ based on your server’s disk configuration.

With the ESXi system partition successfully mounted, you can now access the files containing the host’s configuration. The encrypted root password is held within a compressed archive named state.tgz. This file contains the host configuration and is loaded at boot. You can learn more about its function from the official VMware Knowledge Base. To edit it safely, first copy it to a temporary directory: cp /mnt/esxi/state.tgz /tmp/.
Navigate to the temporary directory with cd /tmp and extract the main archive by running tar xzf state.tgz. This extraction will reveal another compressed file, local.tgz, which you must also extract: tar xzf local.tgz.
This second extraction creates an etc/ directory in your current location. Inside this directory is the critical shadow file. Open this file with a text editor like nano or vi: nano etc/shadow.
Locate the line that begins with root:. It will look something like this:
root:$6$.....:19635:0:99999:7:::
Your task is to carefully delete the entire encrypted password hash, which is the long string of characters located between the first two colons. The modified line must look exactly like this, with nothing between the colons:
root::19635:0:99999:7:::
After making this precise change, save the file and exit the text editor.
After successfully removing the password hash, you must meticulously repackage the files and restore them to the ESXi system partition. First, repackage the etc/ directory into the local.tgz archive with the command: tar czf local.tgz etc/.
Next, repackage the newly modified local.tgz file back into the main state archive: tar czf state.tgz local.tgz. Now, copy this updated state.tgz file back to the mounted ESXi partition, making sure to overwrite the original file: cp state.tgz /mnt/esxi/.
To ensure data integrity, unmount the ESXi partition with umount /mnt/esxi before restarting the server. Finally, execute the reboot command. It is absolutely crucial that you remember to remove the Linux Live media before the system starts booting again. This ensures the host loads VMware ESXi instead of the Linux environment.
Upon completing its boot sequence, your ESXi host will be accessible. You can now log in to the Direct Console User Interface (DCUI) or the web interface as the root user with a blank password. For immediate security, your very first action should be to configure a new, strong password to re-secure your host effectively.