How to Enable Automatic Login on Windows if Keyboard doesn't work after Vmware P2V

Freddy Medina MajetićIT System Administrator
Computer professional with more than 5 years of IT project management, system administration and information security experience
Published:
Updated:
A simple method to resolve a "keyboard not working" problem by modifying the Windows registry. This issue can often be encountered after using the VMware vCenter Converter Standalone Agent to perform a Physical-to-Virtual (P2V) conversion process.

The issue


It seems that after using VMware vCenter Converter Standalone Agent to perform a P2V (Physical-to-Virtual) process, the keyboard on the resulting virtual machine may not work.


I tried to track the source of this problem but was unable to find many answers. In fact, I assumed that the source physical machines (notebooks) had external keyboards plugged-in at the time of virtualization. So, in a way, the “internal” keyboards were offline.


Now, after a first boot on the VM and using VMware vSphere Client, I was only able to use the pointer (mouse) in the “Press Ctrl+Alt+Supr” (Ctrl+Alt+Del on an English keyboard) screen of Windows 7.   My first thought was “well, I can use the on-screen keyboard”.



Unfortunately, I found that under certain circumstances, you won't be able to use the on-screen keyboard to send the Ctrl+Alt+Del command sequence, at least not from this screen. The key sequence simply won't have any effect.


One easy way to get around this problem is to change the Windows registry on the affected VM to enable an automatic login (assuming that you know at least one set of credentials – local or domain credentials - previously validated and used in the machine before the P2V conversion).


Changing the registry


Did you know about Windows 7 System Recovery Options?  Basically, it’s a set of tools embedded on a Win7 DVD that you can use for troubleshooting and recovery purposes. One of the tools is the Command Prompt and that it is very useful when you need to make changes to the system (files, directories, etc) without having logged into Windows.

 

Back on track, our goal here is to change the registry to permit the automatic login feature of Windows 7 by using a specific set of credentials. Sounds easy and it truly is.

Your first step is to boot from a Windows 7 install disk, select Language, choose Recovery, and then select Command Prompt.


Note: You can use any version of Win7 DVD. If you get an error message related to the version, don’t worry, just try to perform a system image recovery and cancel it, the System Recovery Options panel will load immediately.


The second step is to target the main drive where the system file is contained. You may think, easy, “it’s C:\ drive”.  Well, think a little bit more about that, because in some cases the main file system drive is mounted with a different drive letter (when the disk is divided into several partitions for example).


Once in the Command Prompt, the first command to enter is simply “notepad”


Once in Notepad, click File | Open to search for files on the computer's drive. This will show you all the drives of the machine, including Boot (X:\), a very small temporal partition where System Recovery Options are actually running.



You may notice that the Windows File System is mounted on E:\ (or another letter, not C:\). It’s very important to take a note of and remember this for the next steps.


Third: simply type regedit into the command prompt window again, look for the key and parameters, change it and reboot. NOT.  Well yes, but no.


If you just typed “regedit”, then yes, the Registry Editor would open but this is the temp Registry. So, after a reboot, any changes would be lost. The goal is to load the machine’s Windows Registry hives, and those hives are located on (in this example) the E:\ drive.


The key that we need to modify is:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon


So, the hive is “software” (the hives are located in “Windows\System32\config\” folder) and the command you need to enter into the command prompt window to load it is:


REG LOAD HKLM\TempSoft E:\Windows\System32\config\software


Note: “TempSoft” is a temporary name.


Now you can type regedit and see our “TempSoft” – aka the real HKEY_LOCAL_MACHINE\SOFTWARE\ hive – loaded in the registry editor.



Next step is to locate the key, recently translated as:


HKEY_LOCAL_MACHINE\TempSoft\Microsoft\Windows NT\CurrentVersion\Winlogon


And change the following values:

  • AutoAdminLogon = 1
  • DefaultUserName = Domain\Username, or .\Username for local user
  • DefaultPassword = Password


Note: If the DefaultUserName or DefaultPassword values do not exist, they must be added. To add those values, follow these steps:


On the Edit menu, click New, and then point to String Value. Type DefaultUserName, and then press Enter. Double-click DefaultUserName and set the value. Follow the same steps for DefaultPassword.


After committing the changes, go back to the Command Prompt and type REG UNLOAD HKLM\TempSoft and press Enter to unload the Registry hive. Then exit the recovery console and restart. The registry should have been changed.


Enabling the keyboard


After the reboot, Windows will authenticate with the credentials set on the registry and the login process will be successful. We are now able to work on Windows using the on-screen keyboard.

 

Next step is to modify an attribute ("class") associated with the keyboard. Again, we need to use regedit:


- Execute "regedit" from a command prompt (with admin rights)


- Look for HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318}


Note: There's a lot of keys with those last strings (IDs). Just look for the one that contains "Keyboard" in the Class attribute as shown below.



Double-click the UpperFilters: REG_MULTI_SZ and then remove all items except kbdclass

 
Exit and restart


After you reboot, the keyboard will be enabled and ready for use.


Note: Windows automatical logon will still be enabled. You can disable by setting AutoAdminLogon = 0 on HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon


A good way to prevent having to resolve the issues described in this article may be to enable AutoAdminLogon "before" performing a P2V conversion, and then disabling it again in the resulting VM once Windows has loaded.


To learn more about me, please check my Experts Exchange profile.


0
2,294 Views
Freddy Medina MajetićIT System Administrator
Computer professional with more than 5 years of IT project management, system administration and information security experience

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.