How to setup RDP over VMBus (Hyper-V)

1. Find virtual machine's ID on Hyper-V host

Run PowerShell with administrator rights. Enter command get-vm | ft name,id

PS C:\Windows\system32> get-vm | ft name,id

Name            Id
----            --
DockerDesktopVM 8a69c6db-adfa-427b-8e55-f005f08a8594
win10-2021      6dbd1b88-96d1-4a23-88c3-df9d478cd614

2. Add server

  1. At server box, input Hyper-V host IP address or domain name, not virtual machine's.
  2. Check 'VM console connect'
  3. If virtual machine is Linux, don't check 'Enhanced Mode'.
    With 'Enhanced Mode' checked, you can use any of the following local resources if they're available:
    • Display configuration
    • Audio
    • Printers
    • Clipboards for copy and paste
    • Smart cards
    • USB devices
    • Drives
    • Supported plug and play devices
  4. Input virtual machine's ID, e.g. for DockerDesktopVM, it's 8a69c6db-adfa-427b-8e55-f005f08a8594
  5. Input username, password, domain of Hyper-V host. Not the virtual machine.
  6. Port should be set to 2179. Not 3389.

3. Connect

It should show the virtual machine's console.

Troubleshooting

If failed to connect, it maybe related to CredSSP policy. The policy on Hyper-V host doesn’t allow to authenticate remote users.

Run below commands in PowerShell to enable it:

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowDefaultCredentials -Name Hyper-V -PropertyType String -Value "Microsoft Virtual Console Service/*" -Force
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowDefaultCredentialsDomain -Name Hyper-V -PropertyType String -Value "Microsoft Virtual Console Service/*" -Force
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentials -Name Hyper-V -PropertyType String -Value "Microsoft Virtual Console Service/*" -Force
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsDomain -Name Hyper-V -PropertyType String -Value "Microsoft Virtual Console Service/*" -Force
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsWhenNTLMOnly -Name Hyper-V -PropertyType String -Value "Microsoft Virtual Console Service/*" -Force
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsWhenNTLMOnlyDomain -Name Hyper-V -PropertyType String -Value "Microsoft Virtual Console Service/*" -Force
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowSavedCredentials -Name Hyper-V -PropertyType String -Value "Microsoft Virtual Console Service/*" -Force
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowSavedCredentialsDomain -Name Hyper-V -PropertyType String -Value "Microsoft Virtual Console Service/*" -Force
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowSavedCredentialsWhenNTLMOnly -Name Hyper-V -PropertyType String -Value "Microsoft Virtual Console Service/*" -Force

For more information, read orginal Microsoft documentation.


© 2024 - Syvik