Skip to content

Prevent non hyper-v admin users to execute machine commands #27614

@l0rd

Description

@l0rd

Issue Description

We used to prevent users to run machine commands from non privileged terminal, but after #26277 that's not enforced anymore. That made sense because that's not required anymore, but, to start, stop and list hyper-v VMs a user need to belong to the Hyper-V administrator group and that should be checked now

Steps to reproduce the issue

Steps to reproduce the issue

  1. Set hyper-v as the provider: $env:CONTAINERS_MACHINE_PROVIDER="hyperv"
  2. Run a machine command: podman machine start/stop/list/info/inspect/cp/ssh/set

Describe the results you received

The machine commands return an cryptic error:

Error: no results found

Describe the results you expected

Instead, the command should fail with something like:

You need to belong to the hyper-v administrators to run this command

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.windowsissue/bug on Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions