Hyper-V : Integration Services (Windows)2024/12/13 |
These are Integration Services settings that improve integration between the Hyper-V host and Windows guest systems. |
|
[1] | By default, all settings on the Hyper-V host are enabled except for the Guest Services Interface, so you can check the status of virtual machines, shutdown them, take snapshots, etc. |
Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. # integration services on Hyper-V Host PS C:\Users\Administrator> Get-VMIntegrationService -VMName "Win2k25" VMName Name Enabled PrimaryStatusDescription SecondaryStatusDescription ------ ---- ------- ------------------------ -------------------------- Win2k25 Guest Service Interface False OK Win2k25 Heartbeat True OK Win2k25 Key-Value Pair Exchange True OK Win2k25 Shutdown True OK Win2k25 Time Synchronization True OK Win2k25 VSS True OK # on Hyper-V Guest, required services are running PS C:\Users\Administrator> Get-Service -DisplayName "Hyper-V*" Status Name DisplayName ------ ---- ----------- Stopped vmicguestinterface Hyper-V Guest Service Interface Running vmicheartbeat Hyper-V Heartbeat Service Running vmickvpexchange Hyper-V Data Exchange Service Running vmicrdv Hyper-V Remote Desktop Virtualizati... Running vmicshutdown Hyper-V Guest Shutdown Service Running vmictimesync Hyper-V Time Synchronization Service Stopped vmicvmsession Hyper-V PowerShell Direct Service Running vmicvss Hyper-V Volume Shadow Copy Requestor |
[2] | To change the integration service settings on the Hyper-V host, do like follows. For example, enable the [Guest Services Interface] which is disabled by default. |
PS C:\Users\Administrator> Enable-VMIntegrationService -VMName "Win2k25" -Name "Guest Service Interface" PS C:\Users\Administrator> Get-VMIntegrationService -VMName "Win2k25" VMName Name Enabled PrimaryStatusDescription SecondaryStatusDescription ------ ---- ------- ------------------------ -------------------------- Win2k25 Guest Service Interface True OK Win2k25 Heartbeat True OK Win2k25 Key-Value Pair Exchange True OK Win2k25 Shutdown True OK Win2k25 Time Synchronization True OK Win2k25 VSS True OK # * to turn to disabled, run like follows PS C:\Users\Administrator> Disable-VMIntegrationService -VMName "Win2k25" -Name "Guest Service Interface" # on Hyper-V guest, [Hyper-V Guest Service Interface] starts automatically PS C:\Users\Administrator> Get-VMNetworkAdapter -VMName "Win2k25" | Select IPAddresses IPAddresses ----------- {10.0.0.100, fe80::8b7d:cd2f:4e22:3524} PS C:\Users\Administrator> ssh administrator@10.0.0.100 powershell -c 'Get-Service -DisplayName "Hyper-V*"' administrator@10.0.0.100's password: Status Name DisplayName ------ ---- ----------- Running vmicguestinterface Hyper-V Guest Service Interface Running vmicheartbeat Hyper-V Heartbeat Service Running vmickvpexchange Hyper-V Data Exchange Service Running vmicrdv Hyper-V Remote Desktop Virtualizati... Running vmicshutdown Hyper-V Guest Shutdown Service Running vmictimesync Hyper-V Time Synchronization Service Stopped vmicvmsession Hyper-V PowerShell Direct Service Running vmicvss Hyper-V Volume Shadow Copy Requestor |
[3] | If you enable [Hyper-V Guest Service Interface], you can copy files from the Hyper-V Host to Guest systems. |
PS C:\Users\Administrator> Add-Content testfile.txt "file copy test" PS C:\Users\Administrator> Copy-VMFile "Win2k25" -SourcePath "C:\Users\Administrator\testfile.txt" -DestinationPath "C:\Users\Administrator" -FileSource Host PS C:\Users\Administrator> Get-VMNetworkAdapter -VMName "Win2k25" | Select IPAddresses IPAddresses ----------- {10.0.0.100, fe80::8b7d:cd2f:4e22:3524} PS C:\Users\Administrator> ssh administrator@10.0.0.100 powershell -c 'Get-Content testfile.txt' administrator@10.0.0.100's password: file copy test |
[4] | If you start [Hyper-V PowerShell Direct Service] which is disabled by default on the guest system, you can connect to the virtual machine from the Hyper-V Host via a PowerShell session. |
PS C:\Users\Administrator> Get-VMNetworkAdapter -VMName "Win2k25" | Select IPAddresses IPAddresses ----------- {10.0.0.100, fe80::8b7d:cd2f:4e22:3524} # start [Hyper-V PowerShell Direct Service] on VM PS C:\Users\Administrator> ssh administrator@10.0.0.100 powershell -c 'Start-Service -Name "vmicvmsession"' # connect to VM [Win2k25] with user [Administrator], password [P@ssw0rd01] PS C:\Users\Administrator> Enter-PSSession -VMName "Win2k25" -Credential (New-Object PSCredential("Administrator", (ConvertTo-SecureString -AsPlainText "P@ssw0rd01" -Force))) [Win2k25]: PS C:\Users\Administrator\Documents> [Win2k25]: PS C:\Users\Administrator\Documents> hostname fd3s |
Sponsored Link |
|