diff --git a/pkg/machine/e2e/init_test.go b/pkg/machine/e2e/init_test.go index 030013a477..33e06db04e 100644 --- a/pkg/machine/e2e/init_test.go +++ b/pkg/machine/e2e/init_test.go @@ -480,6 +480,15 @@ var _ = Describe("podman machine init", func() { Expect(sshSession2).To(Exit(0)) output := strings.TrimSpace(sshSession2.outputToString()) Expect(output).To(Equal("/run/podman/podman.sock")) + + // Ensure we can at least connect to the rootful podman socket and that it is actually a rootful one by checking the paths + bm := basicMachine{} + info, err := mb.setCmd(bm.withPodmanCommand([]string{"info"})).run() + Expect(err).ToNot(HaveOccurred()) + Expect(info).To(Exit(0)) + Expect(info.outputToString()).To(ContainSubstring("/run/podman/podman.sock")) + Expect(info.outputToString()).To(ContainSubstring("serviceIsRemote: true")) + Expect(info.outputToString()).To(ContainSubstring("/var/lib/containers")) }) It("init should cleanup on failure", func() { diff --git a/pkg/machine/wsl/declares.go b/pkg/machine/wsl/declares.go index 7cbbcfbade..6782c864a7 100644 --- a/pkg/machine/wsl/declares.go +++ b/pkg/machine/wsl/declares.go @@ -98,7 +98,8 @@ LoadCredential= const bindMountConfigDirSystemService = ` [Unit] Description=Bind mount for config directory -Before=podman.socket +Before=multi-user.target +After=local-fs.target [Service] RemainAfterExit=true @@ -157,12 +158,13 @@ const ( podmanSocketDropin = "podman.socket.d" podmanSocketDropinPath = sysSystemdPath + "/" + podmanSocketDropin - configBindSysUnitName = "podman-mnt-config.service" - configBindSysUnitPath = sysSystemdPath + "/" + configBindSysUnitName - configBindSysUnitWant = sysSystemdWants + "/" + configBindSysUnitName + configBindSysUnitName = "podman-mnt-config.service" + configBindSysUnitPath = sysSystemdPath + "/" + configBindSysUnitName + configBindSysUnitWantsDirectory = sysSystemdPath + "/local-fs.target.wants" + configBindSysUnitWant = configBindSysUnitWantsDirectory + "/" + configBindSysUnitName ) -const configBindServices = "mkdir -p " + userSystemdWants + " " + sysSystemdWants + " " + podmanSocketDropinPath + "\n" + +const configBindServices = "mkdir -p " + userSystemdWants + " " + sysSystemdWants + " " + podmanSocketDropinPath + " " + configBindSysUnitWantsDirectory + "\n" + "ln -fs " + bindUserUnitPath + " " + bindUserUnitWant + "\n" + "ln -fs " + bindSysUnitPath + " " + bindSysUnitWant + "\n" + "ln -fs " + configBindSysUnitPath + " " + configBindSysUnitWant + "\n"