We moved this page to our Documentation Portal. You can find the latest updates here. |
Question
How do I change my Windows password from recovery mode?
Environment
Windows VMs
All OnApp Versions
Answer
The following commands are to be run on the VM:
1. Reboot the VM in recovery mode
2. Get access to the Windows VM disk with the following command:
kpartx -a -p X /dev/sdb
3. Check if the disk exists:
fdisk -l /dev/mapper/sdbX1
4. Mount the disk with the following command:
mount -t ntfs-3g /dev/mapper/sdbX1 /mnt/
5. Run the following commands:
mv /mnt/Windows/System32/Utilman.exe /mnt/Windows/System32/Utilman.exe.bak
cp /mnt/Windows/System32/cmd.exe /mnt/Windows/System32/Utilman.exe
6. Unmount the disk:
umount /mnt/
7. Run the following command:
kpartx -d -p X /dev/sdb
8. Stop and then Start the VM via the OnApp UI
Once the VM starts up, log into the console and press Windows Key + U to get a Command Prompt.
9a. To reset the password of an existing user, type the text below. We are changing Administrator’s password to onapppass.
net user Administrator onapppass /active:yes
9b. Alternatively, if you want to create a new user with the username NewUser and password abc123 into the Administrator group.
net user NewUser abc123 /add
net localgroup Administrators NewGuy /add
10. Now you need to restore the original utilman.exe from the VM:
C:
cd windows\system32
del utilman.exe
ren Utilman.exe.bak Utilman.exe