Enable Auto-Logon for a Windows 10 VM in Hyper-V using PowerShell
In this article, we will cover the process of enabling auto-logon for a Windows 10 virtual machine (VM) running inside Hyper-V on a newly set up Windows 10 host. This can be a useful time-saving measure for those who frequently use VMs and prefer not to manually log in each time the VM is started.
Prerequisites
Before proceeding, ensure that you have the following:
- A newly installed Windows 10 host with Hyper-V enabled.
- A newly created and installed Windows 10 VM inside Hyper-V.
- PowerShell access on the host machine.
Enabling Auto-Logon
The process of enabling auto-logon for a Windows 10 VM running inside Hyper-V can be done using PowerShell. Follow the steps below to enable auto-logon:
- Open PowerShell as an administrator.
- Run the following command to stop the VM:
Stop-VM -Name "VMName"Replace "VMName" with the name of your VM.
- Run the following command to set the auto-logon credentials:
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultUserName -Value "Username"
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultPassword -Value "Password"
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoAdminLogon -Value 1Replace "Username" and "Password" with the credentials you want to use for auto-logon.
- Run the following command to start the VM:
Start-VM -Name "VMName"Replace "VMName" with the name of your VM.
Additional Considerations
When enabling auto-logon, it's important to keep in mind the following:
- The credentials used for auto-logon will be stored in plain text in the Windows Registry.
- Enabling auto-logon can pose a security risk if the VM is accessible from untrusted networks.
- It may be necessary to disable auto-logon when the VM is no longer in use or when it is being moved to a different network.
In this article, we covered the process of enabling auto-logon for a Windows 10 VM running inside Hyper-V on a newly set up Windows 10 host using PowerShell. By following the steps outlined above, you can save time and avoid the need to manually log in to the VM each time it is started.