Ubuntu 16.04 installed in a virtual machine
method One:
If the user has sudo permissions, you can run the following command directly:
sudo su root# Enter password for current user passwd# Enter password # Enter password again
Method Two:
If the user does not have sudo permissions, then method one is not available and needs to go into grub to modify the kernel mirroring boot parameters.
1, restart, hold down the SHIFT key, the following screen appears, select the following options
2. Press ENTER to enter the following interface, then select the option with Recovery mode
3, press E to enter the following interface, find the picture of the red box recovery nomodeset and delete it, and then enter in the back of this line
Quiet Splash RW Init=/bin/bash
4, then press F10 or ctrl+x after the appearance of the following interface, in the command line input passwd after the change password can be
Restart the system when you are finished modifying it.
Ubuntu 16.04 forgot root password