summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-20 08:12:01 -0400
committerGitHub <noreply@github.com>2022-04-20 08:12:01 -0400
commit9c36d8458c1b4d4ab504a7ff54db87489cbb0254 (patch)
treedc0f07f0d83bec12fb8c69867d5a9e913541468d
parentbc8d8737b760a1f42a9208c6067d2e163817d5f0 (diff)
parenta4798ab4eff3dc0c8b7a863d96a1d39181dc3008 (diff)
downloadpodman-9c36d8458c1b4d4ab504a7ff54db87489cbb0254.tar.gz
podman-9c36d8458c1b4d4ab504a7ff54db87489cbb0254.tar.bz2
podman-9c36d8458c1b4d4ab504a7ff54db87489cbb0254.zip
Merge pull request #13885 from n1hility/fix-wsl-rootless
Respect "Rootful" when starting WSL API Forwarding
-rw-r--r--pkg/machine/wsl/machine.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/machine/wsl/machine.go b/pkg/machine/wsl/machine.go
index 1da042f6a..dff7bfef9 100644
--- a/pkg/machine/wsl/machine.go
+++ b/pkg/machine/wsl/machine.go
@@ -830,7 +830,15 @@ func launchWinProxy(v *MachineVM) (bool, string, error) {
return globalName, "", err
}
- dest := fmt.Sprintf("ssh://root@localhost:%d/run/podman/podman.sock", v.Port)
+ destSock := "/run/user/1000/podman/podman.sock"
+ forwardUser := v.RemoteUsername
+
+ if v.Rootful {
+ destSock = "/run/podman/podman.sock"
+ forwardUser = "root"
+ }
+
+ dest := fmt.Sprintf("ssh://%s@localhost:%d%s", forwardUser, v.Port, destSock)
args := []string{v.Name, stateDir, pipePrefix + machinePipe, dest, v.IdentityPath}
waitPipe := machinePipe
if globalName {