Configuring Hyper-V VMs for Automatic Login (2024)

  • Updated on 27 Mar 2024
  • 4 Minutes to read
  • Print

  • Share

Article summary

Did you find this summary helpful?

Thank you for your feedback

If you use Windows-based Virtual Machine Profile (VMs) on Hyper-V, you may want to skip the login process every time you launch a lab. Learn how to configure Windows-based virtual machine (VM) to automatically log in to Windows.

If you are looking to configure an ESX virtual machine, read our Automatically Authenticate VMs in ESX documentation.

Best Practices for Disk Capture

Reduce Capture Time and Disk Size

  • Begin working with a VM that has no differencing disks captured already.
  • Don't leave the VM running for hours, and then capturing. This will increase the size of the disk and could affect VM performance.

Virtual Machine Optimization

  • Configure automatic log in on all virtual machines that need automatic log in, before capturing the first differencing disk. Capturing multiple disks could result in lower performance in the VM.

Configure Automatic Log In

The steps to configure automatic login on Hyper-V differ depending if the virtual machine(s) in the lab use Enhanced Session Mode (ESM). After the VM is configured to automatically login, a differencing disk will need to be captured to save the VM in it's current state, to allow subsequent lab launches to automatically log in to the configured VM.

Enhanced Session Mode

Enables a connection similar to an RDP connection. Enhanced session mode leverages guest services to enable additional features such as: automatic VM logon, redirection of clipboard, audio, drives, devices, printers, and smart cards. Enhanced Session mode is not required for VM auto log in.

Configure a VM without Enhanced Session Mode Enabled

For labs that do not use ESM, Netplwiz must be configured to enable automatic login. The following configurations needs to be completed:

  1. Configure Netplwiz
  2. Save a Differencing Disk

Configure Netplwiz

  1. Navigate to the lab profile that contains the VMs that you wish to enable automatic login on.

  2. Launch the lab.

  3. If the lab has multiple VMs, select the VM that should be automatically logged in.

  4. Enter the login password and login to the VM.

  5. In the Windows Start menu, search for Netplwiz, and then select Netplwiz.

  6. Uncheck the box next to Users must enter a user name and password to use this computer.

Configuring Hyper-V VMs for Automatic Login (1)

  1. In the dialog that appears, enter the VM user name and password and click OK.

  2. Repeat steps 3-7 for any other VMs that should be automatically logged in.

  3. Go to the Save a Differencing Disk section to save the VM state, so that subsequent lab launches will launch in this state.

Configure a VM with Enhanced Session Mode Enabled

For labs that use ESM, Windows Registry and Group Policy must be configured to enable automatic login. The following configurations needs to be completed:

  1. Disable Limit Local Accounts use of Blank Passwords
  2. Disable Password Complexity Requirements
  3. Set blank password via PowerShell
  4. Edit Windows Registry
  5. Save a Differencing Disk

Disable Limit Local Accounts use of Blank Passwords

  1. Navigate to the lab profile that contains the VMs that you wish to enable automatic login on.

  2. Launch the lab.

  3. If the lab has multiple VMs, select the VM that should be automatically logged in.

  4. Enter the login password and login to the VM.

  5. In the Windows Start menu, search for Group Policy, then select Edit Group Policy.

  6. Select Computer Configuration.

  7. Select Windows Settings.

  8. Select Security Settings.

  9. Select Local Policies.

  10. Select Security Options.

  11. Double-click Accounts: Limit local account use of blank passwords to console logon only.

  12. Select Disabled, and select OK.

Disable Password Complexity Requirements

  1. In the Windows Start menu, search for Group Policy, then select Edit Group Policy.

  2. Select Computer Configuration.

  3. Select Windows Settings.

  4. Select Security Settings.

  5. Select Account Policies.

  6. Select Password Policy.

  7. Double-click Password must meet complexity requirements.

  8. Select Disabled, and click OK.

Set a Blank Password via PowerShell

Now that the Group Policy is configured to allow a blank password, we need to set the password to be blank.

  1. In the VM, open PowerShell as an administrator.

  2. Enter the following command and press enter:

    Set-LocalUser -name "Administrator" -Password ([securestring]::new())

If the username in your VM is not Administrator, replace Administrator with the name of your username in the PowerShell command.

Edit Windows Registry

  1. In the Windows start menu, search for regedit and select Registry Editor.

  2. Navigate to the following path:

    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  3. Edit the registry and ensure the values match the table below:

    NameTypeData
    AutoAdminLogonReg_SZ1
    DefaultPasswordReg_SZcell
    DefaultUserNameReg_SZcell
    ForceAutoLogonReg_DWORD1
    ForceUnlockLogonReg_DWORD1

    Configuring Hyper-V VMs for Automatic Login (2)

Save a Differencing Disk

Saving a differencing disk will capture the VM in it's current state, so that subsequent lab launches will launch in this state. The lab needs to be launched to capture a differencing disk.

  1. From your running lab, select the hamburger menu in the upper-right corner of the lab window.

  2. Select the Save option.

  3. In the dialog, select the Commit my changes and update this lab profile option.

  4. On the next screen, enter a note, then select the disk under the VM that was configured for automatic login, then select OK.

The differencing disk will be saved and a confirmation message will be shown when it has completed.

  • Configure an ESX Virtual Machine to Automatically Log In: configure an ESX based virtual machine to automatically log in.

A Virtual Machine profile represents the hardware configuration of a virtual machine. Base settings would include, memory, processor, network adapters and storage configuration. The actual settings available are dependent on the fabric the Virtual Machine would be running on.

Microsoft hardware virtualization platform that enables the use of virtual machines.

ESX hardware virtualization platform that enables the use of virtual machines.

Was this article helpful?

Configuring Hyper-V VMs for Automatic Login (2024)
Top Articles
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 6249

Rating: 4.1 / 5 (72 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.