VMConnect Hyper-V Custom Resolution Ubuntu

Last Modified: Thu, 14 Dec 2023 16:23:57 +0000 ; Created: Thu, 14 Dec 2023 16:12:46 +0000

I have an Ubuntu 22.04 VM running in Hyper-V with enhanced session support. I wanted a custom resolution when I connected to it because the VMConnect list of options was to restrictive. Since dynamic resizing is not yet supported with the xrdp + vmconnect combo (using wfreerdp didn't work either) I found this workaround.

No reboot is required. You can leave the VM running and just close any existing connection.

  1. Open a PowerShell terminal with administrator privilege
  2. Get-VM
  3. Note the name of your VM
  4. Get-VM YOUR-VM-NAME-HERE | Select-Object id
  5. Notate the Id you get back
  6. Open in a text editor %APPDATA%\Microsoft\Windows\Hyper-V\Client\1.0\vmconnect.rdp.INSERT-YOUR-VM-ID-HERE.config
  7. Look for setting name="DesktopSize"
  8. Change the value to your desired custom resolution and save
  9. Connect... again to get your new custom resolution
Few notes:

If you try to maximize it will go full screen, but the usable resolution is only what you put in the .config file.

If you "Edit Session Settings..." you might have to manually modify your .config file again.

A useful 4K monitor resolution still allowing the taskbars is 3840, 1950