exsi ubuntu20.04 virtual machine forgets root password

  1. Log in using the vSphere client or vSphere Web client on the ESXi host and locate the virtual machine instance running the Ubuntu virtual machine.

  2. Shut down the Ubuntu virtual machine.

  3. Right-click the virtual machine instance and select Edit Settings or Virtual Machine Settings.

  4. In the Virtual Machine Settings window, select the Virtual Machine Options tab and select Boot Options.

  5. Check Force BIOS settings in the boot options and then start the virtual machine 

 After turning on the virtual machine, enter the BIOS interface, switch to the Exit tab, press Enter, and press shift to enter the GRUB interface (ps: If I restart directly, pressing shift cannot enter the GRUB interface, so everything is started through the BIOS)

6. Select Advanced Options in the GRUB interface and press Enter.

7. Then find the highest version (recovery mode) and press e to enter the editing interface

8. Move the cursor up and down to the recovery nomodeset position and delete the recovery nomodeset

After deletion, at the end of this line, here is the end of dis_ucode_ldr, add quiet splash rw init=/bin/bash, then press f10 or the shortcut key "CTRL + X" to enter the system and enter "passwd root" to change the password. The password here needs to be filled in twice. If "password updated successfully" is displayed, it means the password has been updated successfully.

ps: Some ubuntu versions may be like this

Then hold down ctrl+x or F10 to save, and then press Enter to enter (recovery mode).

9. After entering the command line interface, execute the passwd root command on this interface to change the root user password.

After modification, restart the virtual machine

Guess you like

Origin blog.csdn.net/qq_42152032/article/details/132225111