This article will provide the step by step screenshot to recover the VCSA 6.0’s root password and breaking the GRUB password. VMware vCenter Appliance(VCSA) is a pre-configured Linux VM based on SUSE Linux. If you forget the root password of the appliance, you need to recover the root password like other Linux Operating systems. Recovering root password is very simple if there is no grub password has been setup or if you know the GRUB boot loader password. If you don’t know the grub password, then you need to reset the grub password first by using Redhat or SUSE Linux DVD.
Environment & Software:
- VMware vCenter Appliance 6.0 (VM)
- Redhat Enterprise Linux 7.2 or CENT OS 7.2 ISO
Break the GRUB password of VCSA 6.0:
- Halt the VCSA 6.0 VM and attach the RHEL 7.0 ISO image in virtual CDROM.
2. Boot the VM in RHEL 7.2 DVD (which we have attached). You can alter the boot device priority in BIOS to make VM to boot from DVD. Navigate to “Troubleshooting” and press enter to continue.
3. Select the rescue mode and press enter to continue.
4. Select “Continue” to mount the VCSA 6.0’s root filesystem in Read/write mode under /mnt/sysimage. RHEL 7.2 is capable to detect the VCSA’s root volume and mounts it.
5. VCSA 6.0’s root filesystem is mounted under /mnt/sysimage and you got the shell to play with this.
6. Navigate to /mnt/sysimage/boot directory and list the contents.
7. Navigate to grub directory and list the contents. “menu.lst” is the file which holds the GRUB boot loader password.
8. Use “vi” editor to edit the menu.lst file. ( vi menu.lst).
*Navigate to password line using arrow keys & press “dd” to remove the complete line. After that just save the file by pressing key sequence “:wq” .
After the modification,
9. Exit the shell (Which will reboot the system automatically.). You need to detach the ISO image from VM hardware settings.
Once the system is booted from hard disk , Just stop the VCSA in GRUB menu to break the OS root password. You could see that GRUB is not protected with password.
Reset the VCSA 6.0 ‘s root password:
1.Start the VCSA 6.0 VM and interrupt the GRUB menu by pressing “ESC” key . Press “e” edit the commands.
If you know the GRUB password , you can pass it by press “p” and enter the GRUB password. If you don’t know the GRUB password , you need to follow the above procedure to break the grub password first.
2. Press “e” to edit the commands again for the kernel.
3. Append “init=/bin/bash” in this step and press enter.
4. Press “b” to boot the system.
5. You will get the bash like below.
6. Set the new root password for VCSA 6.0.
7. Exit the shell using “exit” command.
Once the system is booted , you should be able to login with new root password.
Hope this article is informative to you. Share it ! Comment it !! Be Sociable !!!
shanedawg says
Still helping people in 2023. Thanks!
Hasan Hasanusta says
Thank you so much.
I did it using centos 7.
Shaun says
Hi,
Very easy to follow and I have now got root access to vCenter via console. However the web page is now failing to load and I cannot login in with vSphere client. SSH from a remote machine is also failing to connect.
The prompt is still red in colour. red isnt usually a good colour. Do we need to set a new GRUB password?
Hao Nguyen says
How to break GRUB / Recover Root password on VCSA 6.0:
You will need a Centos 8.2 to access the /dev/sda3 or root mount then you can comment out the password line in the menu.lst
YannEZ says
This worked perfectly awsome tutorial you saved me from a lot of troubles !!!!
Nayram says
Thanks and thanks
Amar Tadjine says
Worked perfectly for me!
Thank you
Malec says
Works perfectly! Saved my life!
Boules says
awesome, working like a magic
Ralph-Uwe Peter says
This just saved my day. thanks a bunch!!!
MA says
The boot folder didn’t have anything in it.
Sysadminview says
Excellent, Great work bro! this method worked perfectly for me! Thank you!
Peter says
Thanks for the guide – working until I exit the bash after entering the new password. After typing exit I get an “kernel panic not synching…” error and the new password is not saved as I had to discover after rebooting.
TheFluffyadmin says
Also works for PSC
However, I also ran into the kernel panic as Robert described above.
It seems shutdown command doesn’t work, so I did reboot -f instead. that shut down the VM cleanly.
It looks like VMware may have made this process easier in 6.5 : https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2147144
mhmd says
thank you so much it was really helpful
Salvatore says
Does it work for PSC as well?
Salvatore says
Does this work for PSC?
Robert says
Thanks so much for this article, you are a life saver 🙂 However I did have a minor issue when following the process….
My customer was having trouble trying to login using the root password… This process worked up until the last step. After I typed exit, the appliance would panic and the password never saved.
I tried the process several times and it would Panic at the same point every time. The only way I was able to complete the process, was after I halted the appliance using the halt command and then manually reset it.
Cheers for the help!
Robert says
Thanks so much for this article, you are a life saver 🙂 However I did have a minor issue when following the process….
My customer was having trouble trying to login using the root password… This process worked up until the last step. After I typed exit, the appliance would panic and the password never saved.
I tried the process several times and it would Panic at the same point every time. The only way I was able to complete the process, was after I halted the appliance using the halt command and then manually reset it.
Cheers for the help!
Scott says
Had the exact same situation as Robert and would have been stumped without this reply. Thanks, friend!
TheFluffyadmin says
Excellent, this worked perfectly for me! Thank you!