Commit Graph

5 Commits

Author SHA1 Message Date
jait jacob
efc6ddfcc4 cleanup: run go fix on pkg/machine for windows
Signed-off-by: jait jacob <jai8.jacob@gmail.com>
2026-04-29 13:56:01 +05:30
lstocchi
8e5fde01c6 propose running init/rm command on hyperv machine in elevated mode
This commit adds automatic UAC elevation prompts for HyperV machine
init/rm actions when administrator privileges are required.
Previously, users had to manually run Podman as administrator
when creating the first machine or removing the last machine, which
requires Windows Registry modifications.

When the HyperV command gets relaunched as elevated, the error of the
elevated process is saved on a file to be displayed by the caller. The
implementation is the same as that used by WSL.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-04-03 18:37:08 +02:00
lstocchi
5b0ec91c54 move wsl' util_windows to windows package so it can be reused by hyperv
Signed-off-by: lstocchi <lstocchi@redhat.com>
2026-04-03 14:32:09 +02:00
lstocchi
ab89922f4b hyperv should reuse hvsock registry entries when possible
Previously, each new HyperV Podman machine required creating new hvsock
registry entries, necessitating administrator privileges.

This change modifies the HyperV provider to reuse existing hvsock
entries if found. This is possible due to Podman's current
limitation of running only one HyperV machine at a time.

As a result, administrator privileges are only needed for the first initial
machine setup (when the registry is empty). Subsequent machines can be created by users in the
"Hyper-V Administrators" group without being Admin.

Hvsock entries are no longer deleted on each machine removal; cleanup
is handled when the last machine gets removed.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2025-11-20 16:51:31 +01:00
lstocchi
b62c82bff6 move HasAdminRights to windows pkg
this commit moves the HasAdminRights func from the wsl package to a generic windows package as this could also be used by the HyperV provider.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2025-11-20 15:20:57 +01:00