Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-NetFirewallHyperVVMSetting is not recognized. #11377

Closed
lawrenceegr opened this issue Mar 26, 2024 · 12 comments
Closed

Set-NetFirewallHyperVVMSetting is not recognized. #11377

lawrenceegr opened this issue Mar 26, 2024 · 12 comments
Labels

Comments

@lawrenceegr
Copy link

I expect to have traffic fowarding from the WSL VM after writing the following command:

Set-NetFirewallHyperVVMSetting -Name ‘{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}’ -DefaultOutboundAction Allow

But this is what I got:
image

I am runninng WSL2 Ubuntu 22.04 on Windows 10

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

@lawrenceegr
Copy link
Author

lawrenceegr commented Mar 26, 2024 via email

Copy link

Diagnostic information
Found '/question', adding tag 'question'

@lawrenceegr
Copy link
Author

how can I solve the issue?

@lawrenceegr
Copy link
Author

Copy link

Diagnostic information
.wslconfig found
Detected appx version: 2.1.5.0

@elsaco
Copy link

elsaco commented Mar 26, 2024

@lawrenceegr that cmdlet is part of the NetSecurity module. Unfortunately Windows 10 version doesn't include it. In a pwsh session run import-module -name netsecurity then list all available commands with (get-module -name netsecurity).exportedcommands

More details at https://learn.microsoft.com/en-us/powershell/module/netsecurity/get-netfirewallhypervvmsetting?view=windowsserver2022-ps

@lawrenceegr
Copy link
Author

import-module -name netsecurity
PS C:\Users\marcus> (get-module -name netsecurity).exportedcommands

Key Value


Get-DAPolicyChange Get-DAPolicyChange
New-NetIPsecAuthProposal New-NetIPsecAuthProposal
New-NetIPsecMainModeCryptoProposal New-NetIPsecMainModeCryptoProposal
New-NetIPsecQuickModeCryptoProposal New-NetIPsecQuickModeCryptoProposal
Copy-NetFirewallRule Copy-NetFirewallRule
Copy-NetIPsecMainModeCryptoSet Copy-NetIPsecMainModeCryptoSet
Copy-NetIPsecMainModeRule Copy-NetIPsecMainModeRule
Copy-NetIPsecPhase1AuthSet Copy-NetIPsecPhase1AuthSet
Copy-NetIPsecPhase2AuthSet Copy-NetIPsecPhase2AuthSet
Copy-NetIPsecQuickModeCryptoSet Copy-NetIPsecQuickModeCryptoSet
Copy-NetIPsecRule Copy-NetIPsecRule
Disable-NetFirewallRule Disable-NetFirewallRule
Disable-NetIPsecMainModeRule Disable-NetIPsecMainModeRule
Disable-NetIPsecRule Disable-NetIPsecRule
Enable-NetFirewallRule Enable-NetFirewallRule
Enable-NetIPsecMainModeRule Enable-NetIPsecMainModeRule
Enable-NetIPsecRule Enable-NetIPsecRule
Find-NetIPsecRule Find-NetIPsecRule
Get-NetFirewallAddressFilter Get-NetFirewallAddressFilter
Get-NetFirewallApplicationFilter Get-NetFirewallApplicationFilter
Get-NetFirewallDynamicKeywordAddress Get-NetFirewallDynamicKeywordAddress
Get-NetFirewallInterfaceFilter Get-NetFirewallInterfaceFilter
Get-NetFirewallInterfaceTypeFilter Get-NetFirewallInterfaceTypeFilter
Get-NetFirewallPortFilter Get-NetFirewallPortFilter
Get-NetFirewallProfile Get-NetFirewallProfile
Get-NetFirewallRule Get-NetFirewallRule
Get-NetFirewallSecurityFilter Get-NetFirewallSecurityFilter
Get-NetFirewallServiceFilter Get-NetFirewallServiceFilter
Get-NetFirewallSetting Get-NetFirewallSetting
Get-NetIPsecDospSetting Get-NetIPsecDospSetting
Get-NetIPsecMainModeCryptoSet Get-NetIPsecMainModeCryptoSet
Get-NetIPsecMainModeRule Get-NetIPsecMainModeRule
Get-NetIPsecMainModeSA Get-NetIPsecMainModeSA
Get-NetIPsecPhase1AuthSet Get-NetIPsecPhase1AuthSet
Get-NetIPsecPhase2AuthSet Get-NetIPsecPhase2AuthSet
Get-NetIPsecQuickModeCryptoSet Get-NetIPsecQuickModeCryptoSet
Get-NetIPsecQuickModeSA Get-NetIPsecQuickModeSA
Get-NetIPsecRule Get-NetIPsecRule
New-NetFirewallDynamicKeywordAddress New-NetFirewallDynamicKeywordAddress
New-NetFirewallRule New-NetFirewallRule
New-NetIPsecDospSetting New-NetIPsecDospSetting
New-NetIPsecMainModeCryptoSet New-NetIPsecMainModeCryptoSet
New-NetIPsecMainModeRule New-NetIPsecMainModeRule
New-NetIPsecPhase1AuthSet New-NetIPsecPhase1AuthSet
New-NetIPsecPhase2AuthSet New-NetIPsecPhase2AuthSet
New-NetIPsecQuickModeCryptoSet New-NetIPsecQuickModeCryptoSet
New-NetIPsecRule New-NetIPsecRule
Open-NetGPO Open-NetGPO
Remove-NetFirewallDynamicKeywordAddress Remove-NetFirewallDynamicKeywordAddress
Remove-NetFirewallRule Remove-NetFirewallRule
Remove-NetIPsecDospSetting Remove-NetIPsecDospSetting
Remove-NetIPsecMainModeCryptoSet Remove-NetIPsecMainModeCryptoSet
Remove-NetIPsecMainModeRule Remove-NetIPsecMainModeRule
Remove-NetIPsecMainModeSA Remove-NetIPsecMainModeSA
Remove-NetIPsecPhase1AuthSet Remove-NetIPsecPhase1AuthSet
Remove-NetIPsecPhase2AuthSet Remove-NetIPsecPhase2AuthSet
Remove-NetIPsecQuickModeCryptoSet Remove-NetIPsecQuickModeCryptoSet
Remove-NetIPsecQuickModeSA Remove-NetIPsecQuickModeSA
Remove-NetIPsecRule Remove-NetIPsecRule
Rename-NetFirewallRule Rename-NetFirewallRule
Rename-NetIPsecMainModeCryptoSet Rename-NetIPsecMainModeCryptoSet
Rename-NetIPsecMainModeRule Rename-NetIPsecMainModeRule
Rename-NetIPsecPhase2AuthSet Rename-NetIPsecPhase2AuthSet
Rename-NetIPsecQuickModeCryptoSet Rename-NetIPsecQuickModeCryptoSet
Rename-NetIPsecRule Rename-NetIPsecRule
Save-NetGPO Save-NetGPO
Set-NetFirewallAddressFilter Set-NetFirewallAddressFilter
Set-NetFirewallApplicationFilter Set-NetFirewallApplicationFilter
Set-NetFirewallInterfaceFilter Set-NetFirewallInterfaceFilter
Set-NetFirewallInterfaceTypeFilter Set-NetFirewallInterfaceTypeFilter
Set-NetFirewallPortFilter Set-NetFirewallPortFilter
Set-NetFirewallProfile Set-NetFirewallProfile
Set-NetFirewallRule Set-NetFirewallRule
Set-NetFirewallSecurityFilter Set-NetFirewallSecurityFilter
Set-NetFirewallServiceFilter Set-NetFirewallServiceFilter
Set-NetFirewallSetting Set-NetFirewallSetting
Set-NetIPsecDospSetting Set-NetIPsecDospSetting
Set-NetIPsecMainModeCryptoSet Set-NetIPsecMainModeCryptoSet
Set-NetIPsecMainModeRule Set-NetIPsecMainModeRule
Set-NetIPsecPhase1AuthSet Set-NetIPsecPhase1AuthSet
Set-NetIPsecPhase2AuthSet Set-NetIPsecPhase2AuthSet
Set-NetIPsecQuickModeCryptoSet Set-NetIPsecQuickModeCryptoSet
Set-NetIPsecRule Set-NetIPsecRule
Show-NetFirewallRule Show-NetFirewallRule
Show-NetIPsecRule Show-NetIPsecRule
Sync-NetIPsecRule Sync-NetIPsecRule
Update-NetFirewallDynamicKeywordAddress Update-NetFirewallDynamicKeywordAddress
Update-NetIPsecRule Update-NetIPsecRule

@keith-horton
Copy link
Member

@lawrenceegr , sorry, we do not support Hyper-V Firewall on Windows 10. It's only supported currently in Windows 11.

@lawrenceegr
Copy link
Author

@lawrenceegr , sorry, we do not support Hyper-V Firewall on Windows 10. It's only supported currently in Windows 11.
@keith-horton what are the alternatives for enabling mirrored network in WSL? I wanted to use the command Set-NetFirewallHyperVVMSetting to modify firewall rules. The reason for doing this is to allow me to connect Expo Go[ from android] during development using React-Native.
image
Accessing this exp://172.21.122.226:8081 from my phone is impossible.

@keith-horton
Copy link
Member

Sorry, mirrored mode is only available in Windows 11 :(

In Windows 10, this goes through NAT and a local redirector. so if you are listening on that port on the host, you'll need to create a local Firewall rule. (e.g. New-NetFirewallRule)

@lawrenceegr
Copy link
Author

Let me try that.

@microsoft microsoft locked and limited conversation to collaborators Mar 26, 2024
@OneBlue OneBlue converted this issue into discussion #11380 Mar 26, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

3 participants