hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.13k stars 4.43k forks source link

Hyper-V: add support for EnhancedSessionTransportType #9823

Open kopfpilot opened 6 years ago

kopfpilot commented 6 years ago

Please add support for enhanced session transport: https://blogs.technet.microsoft.com/virtualization/2018/02/28/sneak-peek-taking-a-spin-with-enhanced-linux-vms/

A new configuration parameter is required that would be used in import_vm_vmcx.ps1 to set the configuration during vm settup: Hyper-V\Set-VM -VM $vmConfig.VM -EnhancedSessionTransportType 'HvSocket'. The default settting is 'VMBus'.

When Xrdp is compiled in ubuntu 16.04 (using the scripts from aboves link), the rendering is faster and allows screen resizing :)

kopfpilot commented 6 years ago

It applies to Windows guests as well: https://blogs.technet.microsoft.com/virtualization/2017/01/27/introducing-vmconnect-dynamic-resize/

draggeta commented 6 years ago

Same, would like for this feature as well!

zeenlym commented 4 years ago

It would be helpful to have a command to open HyperV session (VMConnect) in addition.

Workaround:

vmconnect.exe $env:computername $(Get-VM -Id $(Get-Content .\.vagrant\machines\default\hyperv\id)).Name
mgrottenthaler commented 5 months ago

I am currently using a PowerShell script and an after up trigger to work around this:

  # Trigger to set EnhancedSessionTransportType after the VM is up
  config.trigger.after :up do |trigger|
    trigger.name = "Set EnhancedSessionTransportType"
    trigger.info = "Configuring Enhanced Session"
    trigger.run = {inline: "powershell -ExecutionPolicy Bypass -File \"#{File.join(__dir__, 'set-enhanced-session.ps1')}\" -vmName '#{vm_name}'"}
  end
param(
    [string]$vmName
)

$vm = Get-VM -Name $vmName
if ($vm -ne $null) {
    # Enable Enhanced Session Mode
    Set-VM -VMName $vmName -EnhancedSessionTransportType HvSocket
    Get-VM -VMName $vmName | Select-Object -Property EnhancedSessionTransportType
} else {
    Write-Output "VM not found: $vmName"
}

maybe this can help somebody. Any updates on an implementation in vagrant?