Question:
How do I change my Windows password from recovery mode?
Environment:
Windows VMs
All OnApp Versions
Answer:
The following commands are run on the VM:
1. Reboot VM in recovery mode
2. Get access to Windows VM disk with the following command:
kpartx -a -p X /dev/sdb1
3. Check if the disk exists
fdisk -l /dev/mapper/sdb1X1
4. Mount the disk with the following command
mount -t ntfs-3g /dev/mapper/sdb1X1 /mnt/
5. Go to the Windows directory
cd /mnt/Windows/System32
mv Utilman.exe Utilman.exe.bak
cp cmd.exe Utilman.exe
6. Unmount the disk
umount /mnt/
7. Run the following command:
kpartx -d -p X /dev/sdb1
8. Stop 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
9b. Alternatively, if we want to create a new user with the username Vitalii and password onapppass into the Administrator group.
net user NewUser abc123 /add
net localgroup Administrators NewGuy /add
10. Now we need to restore the original utilman.exe from the VM:
C:
cd windows\system32
del utilman.exe
ren Utilman.exe.bak Utilman.exe
Comments
2 comments
Hello,
I had follow this manual, I get stuck at step 3. My OS is Windows_2008_Enterprise_Edition_R2_CH_x64.
Is there anything wrong.
[root@recovery mnt]# kpartx -a -pX1 /dev/sdb1
failed to stat() /dev/sdb1
Andy
Hi Andy,
Can you do a fdisk -l whilst in recovery mode, perhaps the disk has picked up a different device to /dev/sdb1 which was used in the example?
Please sign in to leave a comment.