containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.35k stars 2.38k forks source link

Windows podman installation without admin rights #22994

Open JayDoubleu opened 3 months ago

JayDoubleu commented 3 months ago

Feature request description

I'm using Windows 11 and have WSL2 installed. I downloaded Podman Desktop, which I was able to run without admin rights. However, when I open Podman Desktop, it tries to install Podman, which requires admin rights. I would like to use podman on windows with wsl2 without having to use admin rights.

Suggest potential solution

Have you considered any alternatives?

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

baude commented 3 months ago

If i remember correctly, you can use Podman, WSL, and Windows without administrative privileges. HyperV does require it. I believe the requirement is coming from Podman Desktop and therefore the issue should be filed against their github. I'll try and move the issue.

JayDoubleu commented 3 months ago

@baude Are we sure this does not belong to containers/podman ? It is podman installer what's requesting the admin rights after all.

Podman Desktop is flagging that Podman is missing. The Podman installer then requests admin rights.

I assume that if the Podman installer allowed non-privileged installation, I could initiate the WSL distro using the Podman machine command, which should then satisfy Podman Desktop?

image

jeffmaury commented 3 months ago

Should be move to containers/podman but admin rights are required because WSL installation/update may be required

JayDoubleu commented 3 months ago

@jeffmaury Is there any script that I can run to just create WSL distro with necessary components ? I already have all of the WSL requirements installed and I can install any distro without admin rights so I believe I should be able to provision a distro with podman on it

jeffmaury commented 3 months ago

Not that I am aware but you should ask on the podman repository

JayDoubleu commented 3 months ago

PS. This is currently excluding podman to be installed on devices in organisations with CE+ certifications

l0rd commented 3 months ago

Podman installer on Windows indeed requires admin privileges. By default the installer copies podman binaries in C:/Program Files/RedHat/Podman and adds the key HKLM:\SOFTWARE\Red Hat\Podman in Windows registy. Those are operations that require admin privileges.

That said, using podman machine (podman machine init and podman machine start) require admin privileges when podman is configured to use Hyper-V but not when it's configured to use WSL.

l0rd commented 3 months ago

A workaround, If you want to install podman on Windows without requiring admin privileges, is to download podman-remote-release-windows_amd64.zip from Podman release page and copy the binaries from the folder /usr/bin in the zip file to a directory that's in $env:PATH.

JayDoubleu commented 3 months ago

Ok, so this seems to work well for me. As per your advice @l0rd:

  1. Downloaded podman-remote-release-windows_amd64.zip from the Podman release page.
  2. Moved the three binaries from within the usr/ directory to C:\Users\<username>\AppData\Local\Microsoft\WindowsApps, which seems to be the default local $env:PATH.
  3. I was able to execute podman commands in PowerShell.
  4. Ran podman machine init - It downloaded the tar.gz file and installed the "podman-machine-default" WSL distro.
  5. Ran podman machine start to start the WSL instance.
  6. I was then able to run the latest Podman Desktop, and Podman was detected without any issues.

It would be great to have end-to-end local installation option available within installer itself 👍

l0rd commented 3 months ago

It would be great to have end-to-end local installation option available within installer itself 👍

I agree @JayDoubleu. This is something that can be improved. On the other hand, when prioritizing this issue, we have to consider how widespread this problem is. I suspect that we didn't get this request earlier because most Windows users are ok to run installers that require admin privileges.

Anyway thank you for reporting this issue and for testing the workaround that I have suggested.

JayDoubleu commented 3 months ago

It's true; I happened to be testing Podman as a Docker replacement on a corporate device, so I'm happy to perform some testing if and when this gets prioritized.

One of the reasons why Podman is considered here is its rootless aspect (although it's inside a WSL2 microVM, so it's already running in userspace). The idea of running Docker/Podman entirely without admin rights might be very appealing to companies with CE+ certifications where each admin access request is scrutinized.

github-actions[bot] commented 2 months ago

A friendly reminder that this issue had no activity for 30 days.