Last active
April 21, 2024 00:10
-
-
Save chriskyfung/073e0fbfeeb7b5c1e7d13dc94d638bb9 to your computer and use it in GitHub Desktop.
PowerShell Script to Optimize Virtual Ethernet Adapter Performance for BlueStacks with Hyper-V Enabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -RunAsAdministrator | |
Try { | |
# Disable all Virtual Ethernet Adapters except the Virtual Ethernet Adapter for BlueStacks | |
Get-NetAdapter -Name "vEthernet *" | where Name -inotmatch ‘BluestacksNxt’ | Disable-NetAdapter -Confirm:$false | |
# Ensure the Virtual Ethernet Adapter for BlueStacks is active | |
Enable-NetAdapter -Name "vEthernet (BluestacksNxt)" | |
# Disable Large Send Offload (LSO) for all Virtual Ethernet Adapters. Learn more: https://learn.microsoft.com/en-us/windows-hardware/drivers/network/performance-in-network-adapters#supporting-large-send-offload-lso | |
Disable-NetAdapterLso -Name "vEthernet (*)" | |
# Disable Receive side scaling (RSS) for all Virtual Ethernet Adapters. Learn more: https://learn.microsoft.com/en-us/windows-hardware/drivers/network/introduction-to-receive-side-scaling?source=recommendations | |
Disable-NetAdapterRss -Name "vEthernet (*)" | |
# Disable Receive segment coalescing (RSC) for all Virtual Ethernet Adapters. Learn more: https://learn.microsoft.com/en-us/windows-hardware/drivers/network/overview-of-receive-segment-coalescing | |
Disable-NetAdapterRsc -Name "vEthernet (*)" | |
# List all acitve network adapters | |
(Get-NetAdapter | where status -eq ‘up’ | Format-List -Property Name, InterfaceDescription, Status | Out-String).TrimEnd() | |
Write-Host "`nvEthernet (BluestacksNxt) - Large Send Offload (LSO):`n" | |
(Get-NetAdapterLso -Name "vEthernet (BluestacksNxt)" | Format-List -Property "*Enabled" | Out-String).Trim() | |
Write-Host "`nvEthernet (BluestacksNxt) - Receive Side Scaling (RSS):`n" | |
(Get-NetAdapterRss -Name "vEthernet (BluestacksNxt)" | Format-List -Property "Enabled" | Out-String).Trim() | |
Write-Host "`nvEthernet (BluestacksNxt) - Receive Segment Coalescing (RSC):`n" | |
(Get-NetAdapterRsc -Name "vEthernet (BluestacksNxt)" | Format-List -Property "*Enabled" | Out-String).Trim() | |
Write-Host "`n" | |
} Catch { | |
Write-Host "An error occurred:" | |
Write-Host $_ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example Output