You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Set up Start VM on Connect for Azure Virtual Desktop
3
-
description: How to set up the Start VM on Connect feature for Azure Virtual Desktop to turn on session host virtual machines only when they're needed.
4
-
author: Heidilohr
2
+
title: Configure Start VM on Connect for Azure Virtual Desktop
3
+
description: Learn how to enable or disable Start VM on Connect for Azure Virtual Desktop to power on session host virtual machines only when they're needed.
5
4
ms.topic: how-to
6
-
ms.date: 04/11/2024
7
-
ms.author: helohr
8
-
ms.custom: subject-rbac-steps
5
+
author: dknappettmsft
6
+
ms.author: daknappe
7
+
ms.date: 06/04/2024
9
8
---
10
-
# Set up Start VM on Connect
9
+
10
+
# Configure Start VM on Connect
11
11
12
12
> [!IMPORTANT]
13
13
> Start VM on Connect for Azure Stack HCI with Azure Virtual Desktop is currently in PREVIEW. See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
14
14
15
+
Start VM on Connect lets you reduce costs by enabling end users to power on the virtual machines (VMs) used as session hosts only when they're needed. You can then power off VMs when they're not needed.
15
16
16
-
Start VM On Connect lets you reduce costs by enabling end users to turn on their session host virtual machines (VMs) only when they need them. You can then turn off VMs when they're not needed.
17
-
18
-
You can configure Start VM on Connect for session hosts on Azure and Azure Stack HCI in personal or pooled host pools using the Azure portal or PowerShell. Start VM on Connect is a host pool setting.
17
+
For personal host pools, Start VM on Connect only powers on an existing session host VM that is already assigned or can be assigned to a user. For pooled host pools, Start VM on Connect only powers on a session host VM when none are turned on and more VMs are only be turned on when the first VM reaches the session limit.
19
18
20
-
For personal host pools, Start VM On Connect will only turn on an existing session host VM that has already been assigned or will be assigned to a user. For pooled host pools, Start VM On Connect will only turn on a session host VM when none are turned on and additional VMs will only be turned on when the first VM reaches the session limit.
19
+
The time it takes for a user to connect to a remote session on a session host that is powered off (deallocated) increases because the VM needs time to power on again, much like turning on a physical computer. When a user uses Windows App and the Remote Desktop app to connect to Azure Virtual Desktop, they're told a VM is being powered on while they're connecting.
21
20
22
-
The time it takes for a user to connect to a session host VM that is powered off (deallocated) increases because the VM needs time to turn on again, much like turning on a physical computer. The Remote Desktop client has an indicator that lets the user know the VM is being powered on while they're connecting.
23
-
24
-
> [!NOTE]
25
-
> Azure Virtual Desktop (classic) doesn't support Start VM On Connect.
21
+
You can enable Start VM on Connect for session hosts on Azure and Azure Stack HCI in personal or pooled host pools using the Azure portal, Azure PowerShell, or Azure CLI. Start VM on Connect is configured per host pool.
26
22
27
23
## Prerequisites
28
24
29
-
To use Start VM on Connect, make sure you follow these guidelines:
25
+
Before you can use Start VM on Connect, you need:
30
26
31
-
- You can only configure Start VM on Connect on existing host pools. You can't enable it at the same time you create a new host pool.
27
+
-An existing host pool that's associated with an application group and workspace. You can only configure Start VM on Connect on existing host pools. You can't enable it at the same time you create a new host pool.
32
28
33
-
- The following Remote Desktop clients support Start VM on Connect:
34
-
- The [Windows client](./users/connect-windows.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json) (version 1.2.2061 or later)
35
-
- The [Web client](./users/connect-web.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json)
36
-
- The [macOS client](./users/connect-macos.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json) (version 10.6.4 or later)
37
-
- The [iOS and iPadOS client](./users/connect-ios-ipados.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json) (version 10.2.5 or later)
38
-
- The [Android and Chrome OS client](./users/connect-android-chrome-os.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json) (version 10.0.10 or later)
39
-
- The [Microsoft Store client](./users/connect-microsoft-store.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json) (version 10.2.2005.0 or later)
40
-
- Thin clients listed in [Thin client support](./users/connect-thin-clients.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json)
41
-
42
-
- If you want to configure Start VM on Connect using PowerShell, you'll need to have [the Az.DesktopVirtualization PowerShell module](https://www.powershellgallery.com/packages/Az.DesktopVirtualization) (version 2.1.0 or later) installed on the device you use to run the commands.
29
+
- The Azure account you use to configure Start VM on Connect must have the [Desktop Virtualization Host Pool Contributor](rbac.md#desktop-virtualization-host-pool-contributor) role-based access control (RBAC) role assigned.
43
30
44
-
-You must grant Azure Virtual Desktop access to power on session host VMs, check their status, and report diagnostic information. You must have the `Microsoft.Authorization/roleAssignments/write` permission on your subscriptions in order to assign the role-based access control (RBAC) role for the Azure Virtual Desktop service principal on those subscriptions. This is part of **User Access Administrator** and **Owner** built in roles.
31
+
-Windows App or the Remote Desktop app installed on a local device with a user account assigned to a desktop or application in the application group you can test with.
45
32
46
-
-The Azure account you use to configure Start VM on Connect must have the [Desktop Virtualization Host Pool Contributor](rbac.md#desktop-virtualization-host-pool-contributor) role assigned.
33
+
-Make sure that the name of the host pool, session hosts in that host pool, and the resource group only have ANSI characters.
47
34
48
-
- If you enable Start VM on Connect on a host pool, you must make sure that the host pool name, the names of the session hosts in that host pool, and the resource group name don't have non-ANSI characters. If their names contain non-ANSI characters, then Start VM on Connect won't work as expected.
35
+
- If you want to use Azure PowerShell or Azure CLI locally, see [Use Azure PowerShell and Azure CLI with Azure Virtual Desktop](cli-powershell.md) to make sure you have the [Az.DesktopVirtualization](/powershell/module/az.desktopvirtualization) PowerShell module or the [desktopvirtualization](/cli/azure/desktopvirtualization) Azure CLI extension installed. Alternatively, use the [Azure Cloud Shell](../cloud-shell/overview.md).
49
36
50
37
## Assign the Desktop Virtualization Power On Contributor role with the Azure portal
51
38
52
-
Before you can configure Start VM on Connect, you'll need to assign the *Desktop Virtualization Power On Contributor* role-based access control (RBAC) role to the Azure Virtual Desktop service principal with your Azure subscription as the assignable scope. Assigning this role at any level lower than your subscription, such as the resource group, host pool, or VM, will prevent Start VM on Connect from working properly.
39
+
To configure Start VM on Connect, you need to assign the *Desktop Virtualization Power On Contributor* role-based access control (RBAC) role to the Azure Virtual Desktop service principal with your Azure subscription as the assignable scope. If you assign this role at any level lower than a subscription, such as the resource group, host pool, or VM, prevents Start VM on Connect from working properly.
53
40
54
-
You'll need to add each Azure subscription as an assignable scope that contains host pools and session host VMs you want to use with Start VM on Connect. This role and assignment will allow Azure Virtual Desktop to power on VMs, check their status, and report diagnostic information in those subscriptions.
41
+
You need to add each Azure subscription that contains host pools and session host VMs you want to use with Start VM on Connect as an assignable scope. This role assignment allows Azure Virtual Desktop to power on VMs, check their status, and report diagnostic information for those subscriptions.
55
42
56
43
To learn how to assign the *Desktop Virtualization Power On Contributor* role to the Azure Virtual Desktop service principal, see [Assign RBAC roles to the Azure Virtual Desktop service principal](service-principal-assign-roles.md).
57
44
58
45
## Enable or disable Start VM on Connect
59
46
60
-
Now that you've assigned the *Desktop Virtualization Power On Contributor* role to the service principal on your subscriptions, you can configure Start VM on Connect using the Azure portal or PowerShell.
47
+
Once you assign the *Desktop Virtualization Power On Contributor* role to the service principal on relevant subscriptions, you can configure Start VM on Connect using the Azure portal, Azure PowerShell, or Azure CLI.
61
48
62
49
# [Azure portal](#tab/azure-portal)
63
50
@@ -71,7 +58,7 @@ To configure Start VM on Connect using the Azure portal:
71
58
72
59
1. Select **Properties**.
73
60
74
-
1. In the configuration section, you'll see **Start VM on connect**. Select**Yes** to enable it, or **No** to disable it.
61
+
1. In the configuration section, set **Start VM on connect** to**Yes** to enable it, or **No** to disable it.
75
62
76
63
2. Select **Save** to apply the settings.
77
64
@@ -83,15 +70,15 @@ You need to make sure you have the names of the resource group and host pool you
83
70
84
71
2. To enable or disable Start VM on Connect, do one of the following steps:
85
72
86
-
1. To enable Start VM on Connect, run the following command, replacing the value for `-ResourceGroupName` and `-Name` with your values:
73
+
- To enable Start VM on Connect, run the following command, replacing the value for `-ResourceGroupName` and `-Name` with your values:
2. To enable or disable Start VM on Connect, do one of the following steps:
105
-
1. To enable Start VM on Connect, run the following command, replacing the value for `--resource-group` and `--name` with your values:
106
-
107
-
```azurecli
108
-
az desktopvirtualization hostpool update \
109
-
--resource-group $resourceGroupName \
110
-
--name $hostPoolName \
111
-
--start-vm-on-connect true
112
-
```
113
-
114
-
1. To disable Start VM on Connect, run the following command, replacing the value for `--resource-group` and `--name` with your values:
115
-
116
-
```azurecli
117
-
az desktopvirtualization hostpool update \
118
-
--resource-group $resourceGroupName \
119
-
--name $hostPoolName \
120
-
--start-vm-on-connect false
121
-
```
122
-
123
92
124
-
---
93
+
- To enable Start VM on Connect, run the following command, replacing the value for `--resource-group` and `--name` with your values:
94
+
95
+
```azurecli
96
+
az desktopvirtualization hostpool update \
97
+
--resource-group $resourceGroupName \
98
+
--name $hostPoolName \
99
+
--start-vm-on-connect true
100
+
```
125
101
102
+
- To disable Start VM on Connect, run the following command, replacing the value for `--resource-group` and `--name` with your values:
126
103
104
+
```azurecli
105
+
az desktopvirtualization hostpool update \
106
+
--resource-group $resourceGroupName \
107
+
--name $hostPoolName \
108
+
--start-vm-on-connect false
109
+
```
127
110
128
-
>[!NOTE]
129
-
>In pooled host pools, Start VM on Connect will start a VM every five minutes at most. If other users try to sign in during this five-minute period while there aren't any available resources, Start VM on Connect won't start a new VM. Instead, the users trying to sign in will receive an error message that says, "No resources available."
111
+
---
130
112
131
-
## Troubleshooting
113
+
> [!NOTE]
114
+
> For pooled host pools, Start VM on Connect will start a VM every five minutes at most. If other users try to sign in during this five-minute period and there still aren't any available resources, Start VM on Connect won't start a new VM. Instead, the users trying to sign in will receive an error message that says, **No resources available**. They should wait a few minutes and try to connect again.
132
115
133
-
If you run into any issues with Start VM On Connect, we recommend you use the Azure Virtual Desktop [diagnostics feature](diagnostics-log-analytics.md) to check for problems. If you receive an error message, make sure to pay close attention to the message content and make a note of the error name for reference. You can also use [Azure Virtual Desktop Insights](insights.md) to get suggestions for how to resolve issues.
116
+
## Troubleshooting
134
117
135
-
If the session host VM doesn't turn on, you'll need to check the health of the VM you tried to turn on as a first step.
118
+
If the session host VM doesn't power on, you need to check the health of the VM you tried to power on as a first step. You can also view [Azure Virtual Desktop logs in Log Analytics](diagnostics-log-analytics.md) to check for problems. If you receive an error message, make sure to pay close attention to the message content and make a note of the error name for reference. You can also use [Azure Virtual Desktop Insights](insights.md) to get suggestions for how to resolve issues.
136
119
137
120
> [!NOTE]
138
-
> Connecting to a session host outside of Azure Virtual Desktop that is powered off, such as by using the MSTSC client, won't start the VM.
139
-
140
-
For other questions, check out the [Start VM on Connect FAQ](start-virtual-machine-connect-faq.md).
121
+
> Connecting to a session host outside of the Azure Virtual Desktop service that is powered off, such as by directly connecting to a VM by IP address or name, the VM isn't started.
141
122
142
-
## Next steps
123
+
## Related content
143
124
144
125
For more information about Start VM on Connect, see our [Start VM on Connect FAQ](start-virtual-machine-connect-faq.md).
0 commit comments