No heartbeat from session host and wvd-agent doesn't start on custom image

Copper Contributor

I have attempted to create my own custom image to use with WVD, and I have installed all the pre-reqs as stated in this article in terms of installing the Windows Virtual Desktop agent:

 

https://www.christiaanbrinkhoff.com/2019/05/03/windows-virtual-desktop-technical-walkthrough-includi...

 

I can deploy the custom image just fine, but I am unable to connect to the Remote Desktop as I get an error saying that there are currently no resources available.  Running the Get-RdsSessionHost, shows that there is no heartbeat being received from the RDSH:

 

clipboard_image_0.png

 

After digging around on this forum, I found that there was a backend issue which had been fixed very recently with regards to the heartbeat but I found that the service "Remote Desktop Agent Loader" was stopped on my RDSH.  After trying to start the service, it looked like it had started but stopped about 2 seconds later.  Looking in the Application event log, the service generated a Warning:

 

WVD-Agent service is being stopped: ENDPOINT_NOT_FOUND, This VM needs to be properly registered in order to participate in the deployment

 

Does anyone know what this means, and how the VM should be properly registered?

3 Replies

@robm82 : Looks like this post slipped through the cracks. Did you end up getting this running? My first instinct on this is that for the manual install, you need to first install the RD Agent, as that registers the VM to the service.

@robm82 Hello,

 

Don't know if you resolved this, but I just had exactly the same issue with a custom image and the new VMs would not join the hostpool.

 

I found by manually uninstalling Windows Virtual Desktop Agent, Windows Virtual Desktop Agent Bootloader and the Windows Virtual Desktop side-by-side stack. When you uninstall the Windows Virtual Desktop sbss with the default options it will close down the Remote Desktop services, and you will have to manually restart the machine in the Azure portal.

 

Finally remove the C:\Program Files\Microsoft RDInfra folder.

 

Then download and re-install all the agents as per these excellent instructions https://www.christiaanbrinkhoff.com/2019/05/03/windows-virtual-desktop-technical-walkthrough-includi...

 

Your machine will then be back in the pool.

 

 

@robm82assuming this is based off the wvd gallery image then you can install the rds powershell module on your problem session host then run these commmands.  This assumes only one hostpool in the tenant but if you have multiple you will need to update accordingly.

add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
$tenant = <tenantname>
$problemhost = <sessionhostname>
$tenant = get-rdstenant $tenant
$hostpool = Get-RdsHostPool $tenant.tenantname
remove-RdsSessionHost -TenantName $tenant.TenantName -HostPoolName $hostpool.HostPoolName -Name $problemhost
New-RdsRegistrationInfo -TenantName $tenant.TenantName -HostPoolName $hostpool.HostPoolName -ExpirationHours 72
$token = Export-RdsRegistrationInfo -TenantName $tenant.TenantName -HostPoolName $hostpool.HostPoolName
cd C:\DeployAgent
.\DeployAgent.ps1 -AgentInstallerFolder .\RDInfraAgentInstall -AgentBootServiceInstallerFolder .\RDAgentBootLoaderInstall -RegistrationToken $token.Token