How to reset your password in Ubuntu when running the distribution in Virtualbox.

How to reset your Ubuntu password when you are running in Virtualbox.

The Ubuntu distribution works quite well in Virtualbox, but sometimes you can forget the password for the user you created and you need to reset the password. This is very easy.

  1. Firstly; boot your Virtualbox instance.
  2. Then hold the shift key to get the GRUB menu.
  3. Select the recovery mode option.
  4. Choose to drop to a root shell prompt.

Just type these commands after loading the rescue mode and you can re-set the password.

Remount the / partition in read-write mode. Use the mount command to achieve this.

~# mount -rw -o remount /

Then use the passwd command to reset your Ubuntu password.

~# passwd <USERNAME>

Where <USERNAME> is the username you have created on installation.

This will reset your Ubuntu password. I had an error with setting the Ubuntu password in single user mode, this mounts / in read-only mode. so you need to use the remount command to enable you to write to the /etc/passwd file.