From cb23b2d2580f44a658e51b44e87c19780b5c7f96 Mon Sep 17 00:00:00 2001 From: tjololo <1145298+tjololo@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:26:54 +0100 Subject: [PATCH] Update readme with guide to add hyper-v firewall rule if needed --- README.md | 8 +++++++- scripts/OpenAppPortInHyperVFirewall.ps1 | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 scripts/OpenAppPortInHyperVFirewall.ps1 diff --git a/README.md b/README.md index 6ab4a1cb..11f60ae3 100644 --- a/README.md +++ b/README.md @@ -232,4 +232,10 @@ if you get a permission denied message this verifies that the bind mount is not ```shell make podman-selinux-bind-hack -``` \ No newline at end of file +``` + +#### Running Podman on windows with Hyper-V Firewall enabled requires opening port 5005 to the host machine + +Check if _local rule merging_ is set to _"No"_ as described [here](https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#wsl-has-no-network-connection-on-my-work-machine-or-in-an-enterprise-environment). + +If this is the case you can open a Windows Powershell as administrator and run the script `OpenAppPortInHyperVFirewall.ps1` located in the `scripts` folder. diff --git a/scripts/OpenAppPortInHyperVFirewall.ps1 b/scripts/OpenAppPortInHyperVFirewall.ps1 new file mode 100644 index 00000000..5ecd68b8 --- /dev/null +++ b/scripts/OpenAppPortInHyperVFirewall.ps1 @@ -0,0 +1,7 @@ +$AppPort = 5005 +$NetFirewallHyperVName = '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}' + +Get-NetFirewallHyperVVMCreator +Get-NetFirewallHyperVVMSetting -PolicyStore ActiveStore -Name $NetFirewallHyperVName +Get-NetFirewallHyperVRule -VMCreatorId $NetFirewallHyperVName +New-NetFirewallHyperVRule -Name Altinn3App -DisplayName "Altinn 3 Application" -Direction Inbound -VMCreatorId $NetFirewallHyperVName -Protocol TCP -LocalPorts $AppPort \ No newline at end of file