This tutorial will show you how to manage running Hyper-V virtual machines at startup for your account in Windows 10 and Windows 11.
Hyper-V enables running virtualized computer systems on top of a physical host. These virtualized systems can be used and managed just as if they were physical computer systems, however they exist in virtualized and isolated environment. Special software called a hypervisor manages access between the virtual systems and the physical hardware resources. Virtualization enables quick deployment of computer systems, a way to quickly restore systems to a previously known good state, and the ability to migrate systems between physical hosts.
Hyper-V is only available on 64-bit versions of Windows 10/11 Pro, Enterprise, and Education. Hyper-V is not available on the Home edition.
You can configure Hyper-V virtual machines to automatically run at startup when you boot or restart the computer (host OS).
The default automatic stop action is to save the state of virtual machines at the shut down or restart of the Hyper-V host. It means that if a VM was running before a shut down or restart, Hyper-V will start it automatically at the next startup. The automatic start action is configured for each VM individually.
There are three options available to manage the automatic start action of a Hyper-V virtual machine (VM):
- Nothing = When a computer (host) boots, the virtual machine will not automatically run at startup (regardless of its state before the host shutdown or restart).
- Automatically start if it was running when the service stopped = The virtual machine will automatically run at startup only if it has been running when the computer (host) shutdown or restart.
- Always start this virtual machine automatically= The virtual machine will always run at startup when the computer (host) boots.
- Automatic start delay = Specify a startup delay for the virtual machine in seconds. You can use the delay to manage the boot order of virtual machines, and reduce the load contention between virtual machines.
You must be signed in as an administrator to manage running Hyper-V virtual machines at startup.
- Option One: Configure Automatic Start Action of Hyper-V Virtual Machines in Hyper-V Manager
- Option Two: Configure Automatic Start Action of Hyper-V Virtual Machines in PowerShell
EXAMPLE: Hyper-V virtual machine automatically run at startup
When a Hyper-V virtual machine is set to automatically run at startup, it will turn on the virtual machine and run in the background at startup when you sign in. You will still need to "Connect" the virtual machine to open it in Hyper-V.
1 Open Hyper-V Manager (virtmgmt.msc).
2 Perform the following actions: (see screenshot below)
- Select the Hyper-V host (ex: "BRINKW11") you want in the left pane.
- Select the virtual machine (ex: "W10 UEFI") you want in the middle pane.
- Click/tap on Settings in the right "Actions" pane.
3 Do step 4 (Nothing), step 5 (Automatically start if it was running when the service stopped), or step 6 (Always start this virtual machine automatically) below for what you want.
This is the default setting.
The default is 0 seconds startup delay. You can use the startup delay to manage the boot order of virtual machines, and reduce the load contention between virtual machines.
7 When finished, you can close Hyper-V Manager if you like.
1 Open Windows Terminal (Admin), and select Windows PowerShell.
2 Copy and paste the command below into Windows Terminal (Admin), and press Enter to see the VMName, AutomaticStartAction, AutomaticStartDelay, and AutomaticStopAction for all available Hyper-V virtual machines. (see screenshot below step 3)
Get-VM –VMname * | Select-Object VMname,AutomaticStartAction,AutomaticStartDelay,AutomaticStopAction
3 Make note of the VMName (ex: "W10 UEFI") you want to configure the automatic start action for. (see screenshot below)
4 Do step 5 (Nothing), step 6 (Automatically start if it was running when the service stopped), or step 7 (Always start this virtual machine automatically) below for what you want.
Set-VM -Name "VMName" -AutomaticStartAction Nothing
Substitute VMName in the command above with the virtual machine name (ex: "W10 UEFI") you want from step 3.
For example: Set-VM -Name "W10 UEFI" -AutomaticStartAction Nothing
This is the default setting.
Set-VM -Name "VMName" -AutomaticStartAction StartIfRunning
Substitute VMName in the command above with the virtual machine name (ex: "W10 UEFI") you want from step 3.
For example: Set-VM -Name "W10 UEFI" -AutomaticStartAction StartIfRunning
Set-VM -Name "VMName" -AutomaticStartAction Start -AutomaticStartDelay seconds
Substitute VMName in the command above with the virtual machine name (ex: "W10 UEFI") you want from step 3.
Substitute seconds in the command above with how many seconds startup delay (ex: "0") you want for this virtual machine.
For example: Set-VM -Name "W10 UEFI" -AutomaticStartAction Start -AutomaticStartDelay 0
8 When finished, you can close Windows Terminal (Admin) if you like.
That's it,
Shawn Brink