VMmanager Knowledge Base
en En
es Es

How to reset password on a Windows VM?

To change the administrator password on a virtual machine (VM) with a Windows OS, in the VMmanager interface go to Virtual Machines → select VM → menu → Change Password → enter the new password → click Save.

In some cases, such as OS failures, the password may not change. In this case, you can reset the password in recovery mode.

Important

The procedures in this article require direct modification of the guest OS system files. Before proceeding, create a backup of the virtual machine (VM). For more information, see the article Creating backups manually.

Use recovery mode only if the password cannot be reset through the platform interface.

Example of resetting the password in Windows Server 2019

  1. Set the VM to recovery mode: Virtual machines → select the VM → menu → Recovery modeStart mode and reboot.
  2. Wait until the recovery mode is started and connect to the VM via VNC or SPICE: Virtual machines → select the VM → menu → VNC (SPICE).
  3. After booting SystemRescueCD, mount the Windows partition:
    1. Enter the command to display all partitions:

      fdisk -l
      Example output
      Device     Boot   Start      End  Sectors  Size Id Type
      /dev/vda1  *       2048   1230847  1228800  600M  7 HPFS/NTFS/exFAT
      /dev/vda2       1230848  41943039 40712192 19.4G  7 HPFS/NTFS/exFAT

      The Windows partition is typically the largest HPFS/NTFS/exFAT partition. In the example above, it is /dev/vda2.

    2. Mount the required partition:

      mount /dev/vda2 /mnt
      Comments to the command
  4. Go to the directory with the system configuration files:

    cd /mnt/Windows/System32/config/
  5. isplay the list of Windows users:

    chntpw -l SAM
    Example output
    RID     Username          Admin?  Lock?
    01f4    Administrator     ADMIN   dis/lock
    01f5    Guest             -       dis/lock
    Comments
  6. Run the chntpw utility to reset the password:

    chntpw -u 0x01f4 SAM
    Comments to the command
  7. If the account is locked, select option 2 — Unlock and enable user account.
  8. Enter "1" to reset the account password.
  9. Enter "q" to exit the utility and "y" to save the changes made.
  10. Check the result of the utility actions:

    chntpw -l SAM
    Example output
    RID     Username                Admin?  Lock?
    01f4    Administrator           ADMIN   *BLANK*
    01f5    Guest                   -       dis/lock
    03e8    User                    -       dis/lock

    The BLANK status for the Administrator user means that the password has been successfully reset.

  11. Disable the VM's recovery mode: Virtual machines → select the VM → menu → Recovery modeDisable mode and reboot.

  12. Connect to the VM via VNC or SPICE and set a new password using the OS tools.
    Important
    After resetting the password using the procedure above, a new password can only be set from within the guest OS. The Change password option in the Virtual Machines section only works with an active account and will not apply if the password has been reset (cleared).