summaryrefslogtreecommitdiff
path: root/pkg/machine/wsl
diff options
context:
space:
mode:
authorJason T. Greene <jason.greene@redhat.com>2022-04-15 00:14:49 -0500
committerJason T. Greene <jason.greene@redhat.com>2022-04-15 00:14:49 -0500
commita4798ab4eff3dc0c8b7a863d96a1d39181dc3008 (patch)
treed130c8178c9252c0d26e8bbe4bfe35d508cd56e9 /pkg/machine/wsl
parent6076e1a9a53a785d0053d22f1859103d5fea8b56 (diff)
downloadpodman-a4798ab4eff3dc0c8b7a863d96a1d39181dc3008.tar.gz
podman-a4798ab4eff3dc0c8b7a863d96a1d39181dc3008.tar.bz2
podman-a4798ab4eff3dc0c8b7a863d96a1d39181dc3008.zip
Respect "Rootful" when starting WSL API Forwarding
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
Diffstat (limited to 'pkg/machine/wsl')
-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 {