In this blog, I will reset VMware ESX/ESXi 6.7 root password using Linux ISO Gparted. If you forgot the ESXi host root password, then there is no way to recover it.VMware does not provide any utility or methods to recover the ESX/ESXi host root password. Though I have reset the VMware ESXi root password using Linux ISO Gparted. Before reinstalling ESXi, you can just try this method as a last option since you are nothing to lose.
Please Note: VMware does not officially support this method. VMware says that the only supported method to reset an “ESXi host password” is by reinstalling the host. I have tested on ESXi 6.7.
In these steps, I will be using a “Linux ISO Gparted live CD/USB/DVD/HD”, to change the root password on my ESXi 6.7 host. We will be removing the password hash is located in 2 partitions in order to create a new password in the DCUI console.
Download a Live Linux ISO. Download Gparted Live ISO.
Burn your Gparted Live ISO to a USB or CD/DVD.
How to create a Bootable USB/DVD Drive with Rufus. Download Rufus
Reset VMware ESX/ESXi Root Password
1- Put the Gparted Live Media (CD/DVD) to your ESXi host; make sure the ESXi server is able to boot from CD/DVD or USB. Power on the ESXi server and then select Gparted Live (default settings) and press enter.
2- Configuring console-data, press enter.
3- Press enter to continue.
4- Press enter.
Here you can see 2 partitions sized 249.98MB. The “/dev/sda5 and /dev/sda6” are what we are after assuming you installed ESXi host on the first available hard drive/SSD.
5- GParted listing your ESXi partitions found on the primary disk.
6- Right click on desktop, Select Terminals and then select lxterminal with root privileges.
7- 1- sudo su
2- mkdir /boot /temp
3- mount /dev/sda5 /boot or mount /dev/sda6 /boot
4- cd /boot
5- cp state.tgz /temp
6- cd /temp
7- tar –xf state.tgz
8- tar –xf local.tgz
9- rm *.tgz
10- cd etc
11- vi shadow
8- Move to the line starting with the root and Use the Delete key to delete the hash string between the first 2 colons.
9- After deleting the root password, type :wq and press enter.
10- Continue by running the following batch of commands.
1- cd ..
2- tar –cf local.tgz etc/
3- tar –cf state.tgz local.tgz
4- mv state.tgz /boot
5- umount /boot
6- reboot
11- Remove the Gparted live media and boot your ESXI host.
12- After booting ESXi host log on as root from the DCUI console without typing in a password.
13- Now you can configure a new password.
This method is not officially supported by VMware; the VMware doesn’t want you to modify ESXi installation files. it works on various versions of ESXI hosts.