34

When using client Hyper-V in Windows 10, the first time you switch on Enhanced Session for VM it prompts you to select resolution, then remembers your selection and never prompts again it seems. Where does resolution setting get stored, or how can I force this screen resolution prompt again to change the selected resolution?

Blackwood
  • 3,184
Mike
  • 1,646

4 Answers4

46

There's a much easier way - after lots of research!

  • Close the VM client down

  • Change the Hyper-V Manager settings (right-hand window of the Hyper-V console) Hyper-V Manager Setting

  • Under Server -> Enhanced Session Mode Policy, simply:

    • Uncheck Allow Enhanced Session mode
    • Apply
    • Re-check Allow Enhanced Session Mode (this will reset).
    • Apply again

Enhance Session Mode

  • Now Start the VM in question but don't connect yet.

Start the VM

  • Wait for the VM to start then right-click the VM in the console
  • You should see "Edit Session Settings" option
  • Click this and the original dialogue will appear again.

Done.

Jon
  • 469
41

You can use cmd.exe and type:

VMConnect.exe <ServerName> <VMName> /edit

P.S.: You can also share local hard drive (Show Options ->tab Local Resources->Local devices and resources->More) as on normal windows remote desktop session :-)

You may need to have the VM started for this to work. You may need to run this from an admin prompt if on localhost.

Julian Knight
  • 14,749
  • 3
  • 31
  • 46
ThomasV
  • 526
5

Enhanced Session configuration/settings files:

  • The configuration files for each VM's enhanced session settings can be found in %APPDATA%\Microsoft\Windows\Hyper-V\Client\1.0
  • The file naming scheme is vmconnect.rdp.<VMGUID>.config
  • Each .config file contains 15 or 16 settings (15 for ver 8.0 and lower VMs, 16 for ver 8.1 VMs and higher). Two settings relating to the question are:
    • "SaveButtonChecked" which, if changed to False, will force the connection settings dialog to open the next time a connection is made to that VM
    • "DesktopSize" which stores the resolution
  • Deleting a VM's .config file in this directory will also force the connection settings dialog to open



Open the connection settings dialog using Hyper-V Manager:

  • When a VM is running and Enhanced RDP Sessions can be established, Edit Session Settings... will appear in the Action Pane (right-hand side)

    Edit Session Settings...

Open the connection settings dialog using vmconnect.exe

  • vmconnect.exe "VMServerName" "VMName" -G "VMGUID" -C 0 /edit
  • If there are multiple VMs that use the same VMName (e.g. 2x VMs named "Server1"):
    • vmconnect.exe "VMServerName" "Server1" /edit will always open the first instance of Server1 (and will never open the second instance) -- which is why using the the -G "VMGUID" argument (either by itself or together with "VMName") is beneficial.
    • If opening multiple vmconnect.exe instances, incrementing the -C argument by 1 each time it is run will stagger the window positions, making each vmconnect.exe window easier to see.

To Find out if a VM can establish an enhanced RDP session:

  • (Get-VMHost).EnableEnhancedSessionMode will tell you if Enhanced Session Mode is enabled on the VM server
  • On a VM Server, you can query the WMI namespace ROOT/virtualization/v2 and the Msvm_ComputerSystem class for a given VM
    • The EnhancedSessionModeState property returns a uint16 value:

      Value Description Meaning
      2 Allowed and available Enhanced mode is allowed and available on the virtual machine
      3 Not allowed Enhanced mode is not allowed on the virtual machine
      6 Allowed but not available Enhanced mode is allowed and but not currently available on the virtual machine
      $VMId = 'fde3a5fa-2fbf-4010-8ea0-5d8fdd2c50ad'
      $CimParams = @{
          Namespace   = 'ROOT/virtualization/v2'
          ClassName   = 'Msvm_ComputerSystem'
          Filter      = "Name = '$VMId'"
          Property    = 'EnhancedSessionModeState'
      }
      (Get-CimInstance @CimParams).EnhancedSessionModeState
      
Paul π
  • 345
1

All I do is close the window and reconnect, and it prompts me for the Display configuration settings again (Windows 10 Hyper-V Manager)