From 52caa0fbb9526cbcb2c983e4edd3bff7abb4405f Mon Sep 17 00:00:00 2001 From: Gunjan Vyas Date: Mon, 28 Oct 2024 14:23:07 +0530 Subject: [PATCH 1/4] build: update gvisor-tap-vsock to 0.8.0 Signed-off-by: Gunjan Vyas --- Makefile | 2 +- contrib/pkginstaller/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c7ed34d67b..7f1fbb5522 100644 --- a/Makefile +++ b/Makefile @@ -218,7 +218,7 @@ endif # gvisor-tap-vsock version for gvproxy.exe and win-sshproxy.exe downloads # the upstream project ships pre-built binaries since version 0.7.1 -GV_VERSION=v0.7.5 +GV_VERSION=v0.8.0 ### ### Primary entry-point targets diff --git a/contrib/pkginstaller/Makefile b/contrib/pkginstaller/Makefile index cae78846eb..be5c6c14b7 100644 --- a/contrib/pkginstaller/Makefile +++ b/contrib/pkginstaller/Makefile @@ -6,7 +6,7 @@ ifeq ($(ARCH), aarch64) else GOARCH:=$(ARCH) endif -GVPROXY_VERSION ?= 0.7.5 +GVPROXY_VERSION ?= 0.8.0 VFKIT_VERSION ?= 0.5.1 KRUNKIT_VERSION ?= 0.1.3 GVPROXY_RELEASE_URL ?= https://github.com/containers/gvisor-tap-vsock/releases/download/v$(GVPROXY_VERSION)/gvproxy-darwin From 9cb80d1856156777cdb1bb0bf711c896e6e162e0 Mon Sep 17 00:00:00 2001 From: Gunjan Vyas Date: Mon, 28 Oct 2024 14:24:52 +0530 Subject: [PATCH 2/4] gvproxy: Disable port-forwarding on WSL This commit disables ssh port forwarding on WSL by passing -1 to the -ssh-port flag of gvproxy. Port forwarding is not required on WSL and disabling it prevents port conflict with CRC. Fixes: https://github.com/containers/podman/issues/20327 Signed-off-by: Gunjan Vyas --- pkg/machine/wsl/usermodenet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/machine/wsl/usermodenet.go b/pkg/machine/wsl/usermodenet.go index 0f09874e0f..866cdc4b4c 100644 --- a/pkg/machine/wsl/usermodenet.go +++ b/pkg/machine/wsl/usermodenet.go @@ -32,7 +32,7 @@ fi if [[ ! $ROUTE =~ default\ via ]]; then exit 3 fi -nohup $GVFORWARDER -iface podman-usermode -stop-if-exist ignore -url "stdio:$GVPROXY?listen-stdio=accept" > /var/log/vm.log 2> /var/log/vm.err < /dev/null & +nohup $GVFORWARDER -iface podman-usermode -stop-if-exist ignore -url "stdio:$GVPROXY?listen-stdio=accept&ssh-port=-1" > /var/log/vm.log 2> /var/log/vm.err < /dev/null & echo $! > $STATE/vm.pid sleep 1 ps -eo args | grep -q -m1 ^$GVFORWARDER || exit 42 From 6cf3cb1bfc59ebae713005b89e38413ddeefe19c Mon Sep 17 00:00:00 2001 From: Gunjan Vyas Date: Mon, 28 Oct 2024 19:46:25 +0530 Subject: [PATCH 3/4] winmake.ps1: Fix the syntax of the function call Win-SSHProxy Add missing end of line in test/python/requirements.txt Signed-off-by: Gunjan Vyas --- winmake.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winmake.ps1 b/winmake.ps1 index efb0170a2c..f541a86c0f 100644 --- a/winmake.ps1 +++ b/winmake.ps1 @@ -279,7 +279,7 @@ switch ($target) { if ($args.Count -gt 1) { $ref = $args[1] } - Win-SSHProxy -Ref $ref + Win-SSHProxy($ref) } 'installer' { if ($args.Count -gt 1) { From 4e8d2dd726e61cef29c845000b1eb8ced6bce287 Mon Sep 17 00:00:00 2001 From: Gunjan Vyas Date: Tue, 29 Oct 2024 18:48:12 +0530 Subject: [PATCH 4/4] wsl-e2e: Add a test to ensure port 2222 is free with usermode networking Signed-off-by: Gunjan Vyas --- pkg/machine/e2e/init_windows_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/machine/e2e/init_windows_test.go b/pkg/machine/e2e/init_windows_test.go index 238fe8467f..413faeadb1 100644 --- a/pkg/machine/e2e/init_windows_test.go +++ b/pkg/machine/e2e/init_windows_test.go @@ -2,6 +2,7 @@ package e2e_test import ( "fmt" + "net" "os" "path/filepath" @@ -44,8 +45,12 @@ var _ = Describe("podman machine init - windows only", func() { Expect(err).ToNot(HaveOccurred()) Expect(inspectSession).To(Exit(0)) Expect(inspectSession.outputToString()).To(Equal("true")) - }) + // Ensure port 2222 is free + listener, err := net.Listen("tcp", "0.0.0.0:2222") + Expect(err).ToNot(HaveOccurred()) + defer listener.Close() + }) It("init should not should not overwrite existing HyperV vms", func() { skipIfNotVmtype(define.HyperVVirt, "HyperV test only") name := randomString()