The Ultimate Guide to Recovering a Lost Windows 11 Password

We have all been there. You set up a pristine Windows 11 virtual machine for testing, development, or security research. You configure the settings, install your updates, and step away for a few days. When you return, you are greeted by the login screen and a sudden, sinking realization: you have completely forgotten the password.

In a physical machine, this is a headache. In a virtual environment like VirtualBox, it can feel like a dead end. However, because you have physical (or virtual) access to the “hardware,” you are actually in a powerful position to perform a digital break-in on your own system.

This guide will walk you through the “Utilman” method—a classic system administration trick—adapted specifically for the nuances of VirtualBox and Windows 11 (including the latest 24H2 updates). We will cover how to force a boot from ISO, how to swap system files via Command Prompt, and how to deal with pesky password expiration policies on Windows Home.

Prerequisites: What You Need Before We Start

Before we dive into the command line, ensure you have the following:

  1. Oracle VirtualBox installed.
  2. The Locked VM: The Windows 11 machine you cannot access.
  3. The Installation Media: The original Windows 11 .ISO file you used to install the system. This acts as our “rescue disk.”

Note: This guide applies to Local Accounts. If you use a Microsoft Account (email), you must reset your password via the Microsoft website.

Phase 1: Mounting the Rescue Media

The first step is to convince your virtual machine that it needs to boot from the installation CD (the ISO file) rather than the locked hard drive.

  1. Power off your Virtual Machine.
  2. Right-click the VM in the VirtualBox list and select Settings.
  3. Navigate to the Storage tab.
  4. Under “Controller: SATA” (or IDE), look for the optical drive. It might say “Empty.”
  5. Click the small blue disc icon on the far right and select “Choose a disk file…”.
  6. Locate and select your Windows 11 ISO.
  7. Crucial Step: In the attributes section, check the box for “Live CD/DVD”. This prevents VirtualBox from automatically ejecting the ISO during reboots.

Phase 2: Forcing the Boot Sequence (UEFI)

This is where many users get stuck. Modern Windows 11 VMs use EFI (Extensible Firmware Interface) rather than the old BIOS. Because of this, simply changing the boot order in settings often doesn’t work. We need to force the boot manager.

  1. Start the VM.
  2. Immediately click inside the VM window to capture your mouse and keyboard.
  3. Rapidly press the ESC key (or sometimes F12) as soon as the TianoCore or VirtualBox logo appears.
  4. You will be greeted by a text-based Boot Manager menu.
  5. Use your arrow keys to select the option labeled DVD-ROM or CD-ROM and press Enter.
  6. Keep your eyes peeled! You will see a prompt saying “Press any key to boot from CD or DVD…”. Press the Spacebar immediately.

Phase 3: The “Utilman” Swap

Once the Windows Setup screen loads (the purple window asking for language), do not click “Next” or “Install Now.” We are going to use a backdoor.

Step 1: Accessing the Console

Press Shift + F10 on your keyboard. This shortcut opens a hidden Administrator Command Prompt right over the installation window.

Step 2: Locating the System Drive

The drive letters in this recovery mode are often different from what you see in Windows.

  1. Type C: and press Enter.
  2. Type dir and press Enter.
  3. Check the file list. Do you see folders like Windows, Users, and Program Files?
    • Yes: You are in the right place.
    • No: Try typing D: and repeating the process until you find the Windows drive.

Step 3: Swapping the Files

We are going to trick Windows. The login screen has a button for Accessibility tools (Ease of Access), which runs a program called utilman.exe. We will replace that program with the Command Prompt (cmd.exe).

Run these commands exactly (assuming your drive is C:):

DOS

cd \Windows\System32
ren utilman.exe utilman.bak
copy cmd.exe utilman.exe

If successful, the system will reply with “1 file(s) copied.”

Now, close the Command Prompt and close the Windows Installation window. The VM will reboot. Do not press any key this time; let it boot to the hard drive normally.

Phase 4: Resetting the Password

Once Windows boots, you will arrive at the Login Screen/Lock Screen.

  1. Click or press Space to slide up the lock screen and reveal the password field.
  2. Look at the bottom right corner. Click the Accessibility Icon (it looks like a human figure or a wheelchair).
  3. Instead of opening the narrator or magnifier, a Command Prompt window will pop up. You now have System-level access!

To reset your password, type the following:

net user

(This lists all users. Find your specific username).

net user "YOUR_USERNAME" NEW_PASSWORD

(Replace YOUR_USERNAME with your actual login and NEW_PASSWORD with your desired code).

If you see “The command completed successfully,” close the window and log in with your new password. You are back in!

Phase 5: Housekeeping (Important Security Step)

You have successfully broken into your computer. Now, you must lock the door behind you. Leaving cmd.exe accessible from the lock screen is a massive security risk.

  1. Reboot the VM and follow the steps in Phase 2 to boot from the ISO again.
  2. Open the terminal with Shift + F10.
  3. Navigate to your system drive (cd \Windows\System32).
  4. Run these commands to restore the original file:
del utilman.exe
ren utilman.bak utilman.exe

Phase 6: Dealing with Password Expiration

After recovering access, you might encounter a message saying your password has expired, or you simply want to prevent this from happening again.

If you are using Windows 11 Home, you will notice that the standard management tools are missing:

  • lusrmgr.msc will throw a “Snap-in not compatible” error.
  • The wmic command has been deprecated in newer builds (24H2).

The Solution for Windows Home Users

To set your password to never expire, you must use the command line with Administrator privileges inside Windows.

  1. Log in to your desktop.
  2. Search for CMD, right-click it, and select Run as Administrator.
  3. Type the following command:
net user "YOUR_USERNAME" /expires:never

To verify it worked, type net user "YOUR_USERNAME". Look for the line that says “Password expires”. It should now read: Never.

Conclusion

Recovering a password on a Virtual Machine is a rite of passage for IT professionals and enthusiasts. While the “Utilman” hack is an old trick, the nuances of UEFI booting in VirtualBox and the restrictions of Windows 11 Home Edition can make it tricky.

By following these steps, you not only retrieved your data but also learned how to navigate the Windows recovery environment and manage user attributes via the command line. Just remember to use these powers responsibly!