containers / podman

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

winget installation now requires WSL #22045

Closed krachynski closed 8 months ago

krachynski commented 8 months ago

Issue Description

While recently updating my system to report a bug on Podman Desktop's Kind extension, I discovered that Podman's winget package now requires WSL to be enabled and refuses to install if run from a non-elevated prompt.

I know Podman Desktop requires WSL in order to run, I would expect to be able to install podman for connecting to remote podman systems without needing WSL.

Steps to reproduce the issue

  1. Open a prompt (I use pwsh 7.4)
  2. winget install RedHat.Podman-Desktop
  3. Wait for installation to complete
  4. winget install RedHat.Podman
  5. Observe error message

Describe the results you received

[PowerShell]
~
❯ winget install RedHat.Podman-Desktop
Found Podman Desktop [RedHat.Podman-Desktop] Version 1.7.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/containers/podman-desktop/releases/download/v1.7.1/podman-desktop-1.7.1-setup.exe
  ██████████████████████████████   227 MB /  227 MB
Successfully verified installer hash
Starting package install...
Successfully installed

[PowerShell]
~ took 1m34s
❯ winget install RedHat.Podman
Found Podman [RedHat.Podman] Version 4.9.3
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
This package requires the following dependencies:
  - Windows Features
      Microsoft-Windows-Subsystem-Linux
This command requires administrator privileges to execute.

Describe the results you expected

I expected this to just run in a non-elevated prompt the way it's been doing until 4.9.3

podman info output

host:
  arch: amd64
  buildahVersion: 1.33.5
  cgroupControllers:
  - cpuset
  - cpu
  - cpuacct
  - blkio
  - memory
  - devices
  - freezer
  - net_cls
  - perf_event
  - net_prio
  - hugetlb
  - pids
  - rdma
  - misc
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.1.10-1.fc39.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.10, commit: '
  cpuUtilization:
    idlePercent: 96.71
    systemPercent: 1.87
    userPercent: 1.43
  cpus: 8
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: container
    version: "39"
  eventLogger: journald
  freeLocks: 2048
  hostname: KRACHYNSKI2-ICE
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.15.146.1-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: journald
  memFree: 16028884992
  memTotal: 16655654912
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.fc39.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.10.0
    package: netavark-1.10.3-1.fc39.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.10.3
  ociRuntime:
    name: crun
    package: crun-1.14.4-1.fc39.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.14.4
      commit: a220ca661ce078f2c37b38c92e66cf66c012d9c1
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20240220.g1e6f92b-1.fc39.x86_64
    version: |
      pasta 0^20240220.g1e6f92b-1.fc39.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-1.fc39.x86_64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 4294967296
  swapTotal: 4294967296
  uptime: 0h 0m 12.00s
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /usr/lib/containers/storage
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 1081101176832
  graphRootUsed: 577380352
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 0
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.9.3
  Built: 1708357294
  BuiltTime: Mon Feb 19 08:41:34 2024
  GitCommit: ""
  GoVersion: go1.21.7
  Os: linux
  OsArch: linux/amd64
  Version: 4.9.3

Podman in a container

No

Privileged Or Rootless

Privileged

Upstream Latest Release

Yes

Additional environment details

Windows 11 Pro 23H2 (22631.3155)

WSL version: 2.1.5.0 Kernel version: 5.15.146.1-2 WSLg version: 1.0.60 MSRDC version: 1.2.5105 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.3155

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

Luap99 commented 8 months ago

I doesn't know much about winget, does it use our official podman setup.exe to install? If not this is likely not under our control.

krachynski commented 8 months ago

it does, but the winget package itself is specifying a dependency on this windows feature. which requires an elevated prompt to enable before running the setup.exe

krachynski commented 8 months ago

oh. I didn't realize that I hadn't included the log for the successful elevated prompt

❯ winget install RedHat.Podman
Found Podman [RedHat.Podman] Version 4.9.3
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
This package requires the following dependencies:
  - Windows Features
      Microsoft-Windows-Subsystem-Linux
Enabling [Microsoft-Windows-Subsystem-Linux]...
Successfully enabled Windows Features dependencies
Downloading https://github.com/containers/podman/releases/download/v4.9.3/podman-4.9.3-setup.exe
  ██████████████████████████████  30.9 MB / 30.9 MB
Successfully verified installer hash
Starting package install...
Successfully installed
Luap99 commented 8 months ago

@n1hility Is this something that is set by our installer?

Podman can be used as remote client only without any machine so we shouldn't force WSL on users

n1hility commented 8 months ago

This is something the package is specifying I agree it should not be required.

@krachynski if you are interested in sending a PR to them this would be a small one requesting they drop this:

https://github.com/microsoft/winget-pkgs/blob/master/manifests/r/RedHat/Podman/4.9.2/RedHat.Podman.installer.yaml

Luap99 commented 8 months ago

Closing is that is not an issue on our side then

krachynski commented 8 months ago

microsoft/winget-pkgs#144380