I have a virtual Ubuntu 10.04 machine running under Hyper-V which I have lost the password to. With a physical Ubuntu box it's rather easy to press ESC at the grub prompt and proceed to reset your password. Unfortunately I can't see a grub menu and pressing ESC does nothing. Can anyone offer some advice for how to reset the password on this virtual machine?


Solution 1:

Use a boot cd! - mount your root partition to /mnt/root/ - change /etc/shadow to root::[and so on] - OR type: "chroot /mnt/root passwd" - reboot, login with empty password or the new one you specified

Solution 2:

While Craig's answer will definitely work, I discovered the following also works:

  1. Hit the reset button and immediately click into the Virtual Machine Connection window so that it grabs the keystrokes.
  2. Frantically hammer both shift keys and the ESC key while until you get a GRUB menu.

Apparently holding down the shift key or pressing it in a less manic fashion is not enough, as the window of opportunity is very small...