Virtualization Share Local Resources with Hyper-V Virtual Machine in Windows 11


Hyper-V_Enhanced_Session_Mode_banner.png

This tutorial will show you how to share a local computer's devices and resources with a Hyper-V virtual machine in Enhanced Session mode on Windows 10 and Window 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.

Enhanced Session Mode lets Hyper-V connect to virtual machines using RDP (remote desktop protocol). Not only does this improve your general virtual machine viewing experience, connecting with RDP also allows the virtual machine to share resources with your computer when you're running Virtual Machine Connection (VMConnect).

If your Hyper-V host (physical PC) runs Windows 10 or Windows 11, the enhanced session mode feature is enabled by default.

RDP/Enhanced Session mode includes:
  • Makes virtual machines resizable and high DPI aware.
  • Improves virtual machine integration
    • Shared clipboard
    • File sharing via drag drop and copy paste
  • Allows device sharing
    • Microphone/Speakers
    • USB devices
    • Data disks (including C:)
    • Printers
You may want to use the computer's local resources to:
  • Troubleshoot a virtual machine without a network connection to the virtual machine.
  • Copy and paste files to and from the virtual machine in the same way you copy and paste using a Remote Desktop Connection (RDP).
  • Sign in to the virtual machine by using a smart card.
  • Print from a virtual machine to a local printer.
  • Test and troubleshoot developer applications that require USB and sound redirection without using RDP.
References:

You must be signed in as an administrator to use a Hyper-V virtual machine.


Enhanced Session Mode must be turned on for the Hyper-V host to share it's devices and resources with a Hyper-V virtual machine you connect to with Virtual Machine Connection (VMConnect).

If this is for a Windows 10 or Windows 11 VM, you will need to turn off For improved security, only allow Windows Hello sign-in for Microsoft accounts on this device in the VM to be able to sign in to RDP with a password.




Here's How:

1 Open Hyper-V Manager (virtmgmt.msc).

2 Select the virtual machine (ex: "Windows 11 Dev") in the middle pane you want to use local resources with, and click/tap on Connect in the right "Actions" pane. (see screenshot below)

Connect_to_Hyper-V_virtual_machine.png

3 Click/tap on Start on the "Virtual Machine Connection" window. (see screenshot below)

Start_Hyper-V_virtual_machine.png

4 Click/tap on Show Options in the Connect dialog. (see screenshot below)

Show_options.jpg

If you don't see the Connect dialog and the virtual machine is currently not running in enhanced session mode (unchecked), then click/tap on View on the menu bar of the virtual machine, and click/tap on the unchecked Enhanced session to open the Connect dialog.

View_menu_bar.png

If you don't see the Connect dialog and the virtual machine is currently running in enhanced session mode (checked), then open an Windows Terminal (Admin), type the command below, and press Enter to open a new connection instance for the virtual machine with the Connect dialog. Close Windows Terminal (Admin) and the other virtual machine connection without the Connect dialog. This will also allow you to make changes to your connection settings.

vmconnect localhost "<VM name>" /edit

NOTE: Substitute VM name in the command above with the actual name (ex: "Non Insider W10") of the virtual machine.

For example: vmconnect localhost "Windows 11 Dev" /edit

vmconnect_localhost_command.png


5 Click/tap on the Local Resources tab. (see screenshot below)

local_resources.png

6 If you want to to make changes for Remote audio, click/tap on the Settings button. (see screenshot above)

By default, virtual machines using enhanced session mode pass audio through so you can hear audio from the virtual machine. The virtual machine will use the audio device currently selected on the host machine.

You can change these settings or add microphone passthrough (so you can record audio in a virtual machine).

Since your virtual machine is probably running locally, the "play on this computer" and "play on remote computer" options will yield the same results.


A) Select (dot) the Remote audio playback and Remote audio recording settings you want, and click/tap on OK.​

Audio_settings.png

7 If you want to to make changes for Local devices and resources, click/tap on the More button. (see screenshot below)

local_resources.png

8 Select (check) any local drives and devices you want to share with the virtual machine, and click/tap on OK. (see screenshot below)

By default, virtual machines using enhanced session mode share printers, the clipboard, pass smartcard and other security devices through to the virtual machine so you can use more secure login tools from your virtual machine.


more_local_resources.png

9 Click/tap on the Display tab. (see screenshot below step 11)

10 Check or uncheck (default) Save my settings for future connections to this virtual machine for what you want. (see screenshot below step 11)

If you check Save my settings for future connections to this virtual machine, this virtual machine will always automatically start in enhanced session mode using the Connect settings you set in the steps above.

If you want to uncheck this box later or make changes to your connection settings, you can open an Windows Terminal (Admin), type the command below, and press Enter to open a new connection instance for the virtual machine with the Connect dialog. Close Windows Terminal (Admin) and the other virtual machine connection without the Connect dialog. This will also allow you to make changes to your connection settings.

vmconnect localhost "<VM name>" /edit

NOTE: Substitute VM name in the command above with the actual name (ex: "Non Insider W10") of the virtual machine.

For example: vmconnect localhost "Windows 11 Dev" /edit

vmconnect_localhost_command.png


11 Click/tap on Connect to start the virtual machine in enhanced session mode. (see screenshot below)

Display.png


That's it,
Shawn Brink


 
Last edited:

My Computers My Computers

  • At a glance

    Windows 11 Pro for WorkstationsIntel i7-8700K 5 GHz64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600...ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GD...
    OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • At a glance

    Windows 11 ProSnapdragon X Elite (12 core) 3.42 GHz16 GB LPDDR5x-7467 MHz
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
It is not totally clear from the write up (unless I missed it lol) that the guest OS must be able to act as an RDP server.

For windows guests, this excludes Windows Home i.e. a Windows Home guest can only run in basic mode.

The main consequence of running only in basic mode is lack of sound capability.

It is possible to run Linux guests in enhanced mode if the guest can act as an XRDP server but it generally involves a fair bit of console configuration. My main gripe is that each distro does ot in different ways. Kali is actually the most plug and play distro that I am aware of requiring minimal configuration.

Also, it can be a challenge getting sound to work even if the distri can act as an xrdp server. The other issue which I never ever managed to resolve was that sound tends to lag behind video which can make any video streaming irritating.

In simple terms, if sound (particularly) is important, HyperV is not the best vm choice fon guests that cannot run as an rdp server and alternatives like vmware or virtualbox may be preferable.
 

My Computer My Computer

At a glance

Windows 11 Pro + Win11 Canary VM.I9 13th gen i9-13900H 2.60 GHZ16 GB solderedIntegrated Intel Iris XE
OS
Windows 11 Pro + Win11 Canary VM.
Computer type
Laptop
Manufacturer/Model
ASUS Zenbook 14
CPU
I9 13th gen i9-13900H 2.60 GHZ
Motherboard
Yep, Laptop has one.
Memory
16 GB soldered
Graphics Card(s)
Integrated Intel Iris XE
Sound Card
Realtek built in
Monitor(s) Displays
laptop OLED screen
Screen Resolution
2880x1800 touchscreen
Hard Drives
1 TB NVME SSD (only weakness is only one slot)
PSU
Internal + 65W thunderbolt USB4 charger
Case
Yep, got one
Cooling
Stella Artois (UK pint cans - 568 ml) - extra cost.
Keyboard
Built in UK keybd
Mouse
Bluetooth , wireless dongled, wired
Internet Speed
900 mbs (ethernet), wifi 6 typical 350-450 mb/s both up and down
Browser
Edge
Antivirus
Defender
Other Info
TPM 2.0, 2xUSB4 thunderbolt, 1xUsb3 (usb a), 1xUsb-c, hdmi out, 3.5 mm audio out/in combo, ASUS backlit trackpad (inc. switchable number pad)

Macrium Reflect Home V8
Office 365 Family (6 users each 1TB onedrive space)
Hyper-V (a vm runs almost as fast as my older laptop)
@cereberus

running krdc from a Linux server can connect to a remote W11 system (at least W11 Pro and above) with sound etc whether VM or real -- however W11 whether pro or home seems to have RDP broken for W11 to W11 connections .

Running krdc from a Linux fedora KDE based VM on W11 works too to connect to another W11 machine. It's Windows to Windows RDC that seems to be broken.

Screenshot_20261014_095823.webp


I haven't tried W11 to Linux desktop via RDC as I either telnet or ssh to the linux machine which is fine as command mode is all I usually need. But it might be worth some sort of experiment if I can get some sort of X-server on the Windows machine working.

Cheers
jimbo
 

My Computer My Computer

At a glance

Windows XP,11 Linux Fedora Rawhide pre-releas...2 X Intel i7
OS
Windows XP,11 Linux Fedora Rawhide pre-release 46
Computer type
PC/Desktop
CPU
2 X Intel i7
Screen Resolution
4KUHD X 2

Latest Support Threads

Back
Top Bottom