To reset a password in an Ubuntu virtual machine perform the following steps:
- Go to virtual machine's Configuration > Hardware > Boot Order.
- Tick Select boot device on startup
- Run Ubuntu
- Once the virtual machine start to boot, make sure that the virtual machine is active (click inside virtual machine window) and press Shift key repeatedly (it your virtual machine uses UEFI press the Esc key instead) until you see the grub menu.
- From the boot menu, select recovery mode, which is usually the second boot option
After you select recovery mode and wait for all the boot-up processes to finish, you'll be presented with a few options. Navigate to the Drop to root shell prompt using the arrow keys and press Enter.
<p><img alt="alttext" src="http://kb.parallels.com/Attachments/kcs-34521/fixsudoprecise03.jpg" title="title" /></p> <p>The root account is the ultimate administrator and can do anything to the Ubuntu installation (including erase it), so please be careful with what commands you enter in the root terminal.</p> <p>In recent versions of Ubuntu, the filesystem is mounted as read-only, so you need to enter the follow command to get it to remount as read-write, which will allow you to make changes:</p> <pre>
mount -o rw,remount /
If you have forgotten your username as well, type:
To reset the password, type:
<p>Where username is the username you want to reset.</p> </li> <li> <p>You'll then be prompted for a new password. When you type the password you will get no visual response acknowledging your typing. Your password is still being accepted. Just type the password and hit Enter when you're done. You'll be prompted to retype the password. Do so and hit <strong>Enter</strong> again.</p> </li> <li> <p>Now the password should be reset. Type</p> <pre>
<p>to return to the recovery menu.</p> </li> <li>After you get back to the recovery menu, select <strong>resume normal boot</strong>, and use Ubuntu as you normally would.