I used a virtual machine a long time ago. I forgot the password because it took so long. I searched online for a good way to solve it and wrote a blog to record it! ! !
- Turn on the virtual machine and let the virtual machine start
- During startup, press Esc frantically, so that the following page appears:
- Press e to enter the page, find the corresponding position and insert it
init=/bin/sh
- After filling in, press Ctrl+x to boot.
- enter
mount -o remount, rw /
- reset Password
- The following picture appears, indicating that the password reset is successful.
- implement
touch /.autorelabel
- quit
exec /sbin/init
- Waiting to start
- Return to the original page and enter directly
- Enter your reset password
- You're done! ! !