I have Ubuntu guest OS installed on Virtual Box on windows. But I have forgotten all passwords for user and root accounts. But when I try to get into grub by pressing escape at startup, nothing happens. How do I get into grub loader to change the password? Acually no grub menu is shown when it starts. Is there any other way to reset all the passwords?
You could mount the Ubuntu install ISO image as a CD, boot from CD and go into rescue mode to change all of the passwords, if you wanted.
To attach the ISO image to VirtualBox, go to Settings --> Storage and look for either the CD icon, or click on the CD icon with a plus on it. If the ISO image you want isn't there, add it using the Virtual Media Manager.
Press F12 at boot to look at all of the VirtualBox boot options, and go from there.
Piece of cake. Just boot with the cd you installed from. Fire up a text editor and modify the line of /etc/shadow on your root partition for the user root (or your own user) to read:
jaroslav is your username, mynotsosecretpassword is your new password. Leave everything else as it is.