Whether you’re a beginner or a seasoned pro, at some point you’re going to need to reset your password in an Ubuntu virtual machine.
Here’s a quick and easy guide on how to do it.

Contents
How to reset password in Ubuntu virtual machine
It can be easy to forget your password, especially if you haven’t used it in a while. If you forget your password for an Ubuntu virtual machine, there are a few ways to reset it.
- One way to reset your password is to use the “Forgot Password” feature on the Ubuntu login screen.
- To do this, click the gear icon next to the password field and select “Forgot Password.” You will be prompted to enter your username and a new password will be generated for you.
- If you don’t see the “Forgot Password” option on the login screen, you can also reset your password from the command line.
- To do this, boot into recovery mode by pressing Shift while the computer is booting up.
- Once in recovery mode, select “root” and enter your password. At the prompt, type “passwd” followed by your username. You will be prompted to enter a new password and then confirm it.
Why you might need to reset password in an Ubuntu virtual machine
There are a number of reasons why you might need to reset your password in an Ubuntu virtual machine.
Maybe you forgot your password, or maybe you inherited an Ubuntu VM from someone else and don’t know the password.
Whatever the reason, resetting your password in an Ubuntu VM is relatively easy.
Before you reset your password, it’s a good idea to create a backup of your VM. This way, if something goes wrong during the process, you can always restore from the backup.
Once you have created a backup, follow the steps below to reset your password in an Ubuntu virtual machine:
- Start the VM and select “Ubuntu” from the boot menu.
- At the “Welcome” screen, select “Try Ubuntu“.
- Once Ubuntu has loaded, open a terminal window by pressing Ctrl+Alt+T.
- In the terminal, type “sudo passwd” and press Enter. You will be prompted to enter your new password twice.
- Once you have successfully changed your password, reboot the VM and select “Ubuntu” from the boot menu again. At the login screen, enter your new password to access the VM.
How to change your password in an Ubuntu virtual machine
If you forget your password or want to change it for security reasons, you can easily do so in an Ubuntu virtual machine. Here’s how:
- Open a terminal window by pressing CTRL+ALT+T.
- Type in the following command and press Enter:
sudo passwd your_username
- You will be prompted to enter and confirm your new password. Once you do so, your password will be changed.
How to set a new password in an Ubuntu virtual machine
If you forgot the password for your Ubuntu virtual machine, don’t worry! You can easily reset it following these steps:
- Enter your Ubuntu VM and select “Try Ubuntu“.
- When the desktop loads, open a terminal window by pressing Ctrl+Alt+T.
- In the terminal, type “sudo passwd“. This will open a prompt where you can enter your new password.
- Type in your new password twice and press Enter to confirm.
- Reboot your VM and log in with your new password.
How to create a new password in an Ubuntu virtual machine
If you forget your password for an Ubuntu virtual machine, you can create a new one by following these steps:
- Start the virtual machine with the “Forgot Password” option.
- Select “Ubuntu” from the Operating System drop-down menu and click “Continue“.
- Select your country and click “Continue“.
- Enter your username and click “Continue“.
- Enter your new password and click “Continue“.
How to recover your password in an Ubuntu virtual machine
If you’ve forgotten your password for an Ubuntu virtual machine, there’s no need to panic. You can easily reset your password by following the steps below.
- Boot into your Ubuntu virtual machine.
- At the login screen, press the Shift key five times. This will bring up a recovery console.
- From the recovery console, select the option to reset your password.
- Enter your new password and press Enter.
- Reboot your machine and log in with your new password.
How to delete Password in Ubuntu virtual machine
If you’ve forgotten your password for an Ubuntu virtual machine, you can reset it by following the steps below.
- Start the virtual machine and select “Recovery Mode” from the boot menu.
- Select “Drop to root shell prompt” from the Recovery menu.
- Type the following command at the prompt:
sudo passwd -dl your_username - Reboot the machine and you should be able to log in without a password.