In this article will be discussed about Reset forgotten VMware ESXi 6.5 root password will be recover as shown below procedure.
Lost or forgot the root password of VMware ESXi host generally happens. Below is the procedure same for all ESXi version (until ESXi 8.0)
If the user forgets or loses the ESXi default password, they cannot change it. Users must set the root password when installing ESXi. Re-installing ESXi is not a good practice.
We can reset the root password in 2 methods as mentioned below.
- You can reset your ESXi root password using VMware Host Profiles.
- By editing the shadow file, you can reset VMware ESXi root password.
Host Profile: Once the first host has been provisioned, you can extract and configure a profile that can be applied to other targets hosts called as host profile.
ESXi root password using VMware Host Profiles is time consuming process.
By editing the shadow file for ESXi root password
A password file located in /etc/shadow is used to store the root password encrypted by ESXi.
In order to create a new password in Direct Console User Interface (DCUI) console, I’ll remove the password hash located in 2 partitions. Basically, ESXi will be installed in the 2 partitions /dev/sda5 and /dev/sda6 sized 249.98MB.
In this article will remove it only from one partition /dev/sda5.
Initially Download gparted ISO to reset the password.
Below procedure Reset forgotten VMware ESXi 6.5 root password
Step1: Mount gparted-live-1.3.1-1-amd ISO image into ESXi machine and boot it from BIOS settings.
Select GParted Live Option.
Step2: just click on to enter, it will enter into the configuration part and click OK.
Step3: Select the language your preferred and provide the number for it. Press Zero to start with partition.
Step4: In fact, hypervisor (or) system image is located on the first 250 MiB partition (/dev/sda5) which contains the state.tgz file in it.
Step5:
Open the Terminal execute the following command.
By default, it’s a normal user switch into root user.
mount the ESXi installed partition /dev/sda5 into /mnt generic mount directory.
switch into /mnt and check status of state.gz file. Local.tgz files are stored in a state.tgz file, which then contains the state files and the state.tgz file is stored in the bootbank.
Copy state.gz to /tmp directory. After unpacking state.tgz, the compressed archive local.tgz will be visible.
Unpack the local.tgz file which contains the /etc directory compressed in it.
In order to reset the root password, first remove existing password which was located in /etc/shadow file.
The files should be re-packed and the modified state.tgz should be copied back to the ESXi system partition.
umount the /mnt point and exit form it.
reboot the ESXi host, login with console and press F2 it required username as root and password give enter.
You can configure new password under system customization select configuration password option and set a NEW PASSWORD
Conclusion:
VMware does not support this method, but it does work on all versions of ESXi. Reset forgotten VMware ESXi 6.5 root password has been explained step by step.
The article presented a method of resetting the VMware ESXi root password without needing to reinstall the ESXi host, which saves a lot of time and effort.
Successfully reset the root password for ESXi host. In my previous article described about Configure SNMPv3 on ESXi host for monitoring purpose.