Technologytech

How To Reset Password In Virtual Machine On Virtualbox Ubuntu

how-to-reset-password-in-virtual-machine-on-virtualbox-ubuntu

To reset password VirtualBox Ubuntu when you've forgotten your login credentials, you have two reliable methods: using recovery mode (recommended) or editing GRUB boot parameters. Both methods require virtual "physical access" to the VM, as it involves interacting with the boot process, which means you need to be at the console of the virtual machine in VirtualBox. If you're locked out of a physical machine instead, you can reset password on dell laptop with similar recovery tools. If your console is unresponsive, you might be dealing with a my virtual machine black screen issue instead.

Access the GRUB boot menu

Power on or reboot your Ubuntu VirtualBox VM. During the boot process, specifically when the Oracle logo appears for VirtualBox, press and hold the Shift key or repeatedly press the Esc key to bring up the GRUB menu. This forces the bootloader to display its options instead of booting straight into Ubuntu.

Method 1: Reset password via recovery mode (recommended)

This is the simpler and more straightforward approach. In the GRUB menu, use the arrow keys to navigate to the "Advanced options for Ubuntu" entry and press Enter. From the advanced options, select the entry that ends with "(recovery mode)" and press Enter. The system will boot into a recovery menu. From there, select the option to drop to a root shell prompt. You are now at a root shell prompt (e.g., root@ubuntu:~#) without requiring a password. The filesystem is initially mounted as read-only; you must remount it with write permissions by typing mount -o remount,rw / and pressing Enter. To reset the password for a specific user, type passwd username (replace username with the actual user's login name) and press Enter. You will be prompted to enter a new UNIX password twice; characters will not be displayed for security reasons. If you don't know the username, you can list user accounts by typing ls /home at the root prompt. If you're locked out of a Windows dual-boot setup instead, you can get into Windows 10 without password using its own built-in recovery tools.

Method 2: Reset password by editing GRUB parameters

If "Advanced options for Ubuntu" is not present, or if you prefer a more direct method, use this alternative. In the GRUB menu, select the main Ubuntu entry and press the e key to edit the GRUB parameters. Locate the line that begins with linux (or kernel in older versions). In this linux line, find the section that reads ro quiet splash $vt_handoff and replace it with rw init=/bin/bash. If the ro quiet splash $vt_handoff string is not found, append rw init=/bin/bash to the very end of the linux line. After editing, press Ctrl + X or F10 to boot the system with the modified parameters.

Remount the filesystem and change the password

The system will boot into a root shell prompt (e.g., root@ubuntu:~#) without requiring a password.

Reboot and log in

After successfully updating the password, type reboot and press Enter to restart the virtual machine. Wait for the VM to restart completely. You should now be able to log in to your Ubuntu VM with the newly set password.

Sources

The steps on this page were checked against the following documentation. Last verified 17 September 2026.

  1. Askubuntu — https://askubuntu.com
  2. Cyberpanel — https://cyberpanel.net/blog/ubuntu-forgot-password
  3. Exxactcorp Support — https://support.exxactcorp.com/hc/en-us/articles/32845356618903-How-to-Reset-your-Ubuntu-User-P…
  4. Tecmint — https://www.tecmint.com/reset-forgotten-root-password-in-ubuntu/
  5. Itsfoss — https://itsfoss.com/how-to-hack-ubuntu-password/
  6. Snel — https://www.snel.com/support/how-to-reset-the-root-password-in-ubuntu-22-04/

About the author

La Verne stands at the forefront of the digital revolution, her gaze firmly fixed on the horizon of virtuality. Writing for Robots.net, she navigates the ethereal realms of Virtual and Augmented Reality with the grace of a digital native.

View all 86 articles by La Verne Haun  ·  Our editorial policy

Leave a Reply

Your email address will not be published. Required fields are marked *