spiegel_podman/cmd/podman/machine
lstocchi 8532ecb710
fix wsl install workflow on machine init command
this patch changes how the detection of wsl works.
The old way of using wsl --status command output to detect some missing features required by WSL is not fully reliable.
WSL checks if the wsl feature is enabled and if the vmcompute service do exist. However, this is not enough to identify if the virtual machine platform feature is enabled. The vmcompute service could exist because it has been installed by other tools or it could exist but being stopped.

The way proposed by this patch is to try execute the import command and,
if it fails, check the error and if it is related to the Host Compute
Service try to install all features required by WSL.

The flow is the same as before, the user is asked to execute the podman
machine init command with elevated privileges. Eventually, after
enabling WSL and VMP features, the user is asked to reboot the machine.

When the machine restarts, the powershell gets invoked again and execute
the command init.

The code also fixes some issues that could cause misbehaviors when
invoking recursively the elevated shell, like an unreleased lock, or a
missing file.

Signed-off-by: lstocchi <lstocchi@redhat.com>
2025-06-04 14:26:48 +02:00
..
os Move DefaultMachineName to pkg/machine/define 2024-09-24 15:36:14 -04:00
client9p.go Ensure HyperV 9p mounts work when a dir doesn't exist 2024-02-27 14:33:53 -05:00
cp.go Be explicit about ssh configs suitable only for localhost 2025-05-15 23:04:49 +02:00
info.go Refactor env dir and port functions into new leaf pkgs 2024-03-04 23:54:31 -06:00
init.go fix wsl install workflow on machine init command 2025-06-04 14:26:48 +02:00
inspect.go Add Rosetta support for Apple Silicon mac 2024-05-17 17:53:28 +09:00
list.go feat: Add support for configuring swap in Podman machine 2025-04-29 12:20:24 +10:00
machine.go Introduce podman machine cp command 2025-02-28 09:56:46 -05:00
machine_unix.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
machine_unsupported.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
machine_windows.go Fix podman machine on Windows 2022-06-30 16:21:59 -05:00
os.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
reset.go Remove unnecessary error handling 2025-01-29 12:12:17 -06:00
rm.go Refactor env dir and port functions into new leaf pkgs 2024-03-04 23:54:31 -06:00
server9p.go Update module github.com/shirou/gopsutil to v4 2024-09-03 18:20:12 +02:00
set.go Error when machine memory exceeds system memory 2024-06-28 10:02:11 -05:00
ssh.go Be explicit about ssh configs suitable only for localhost 2025-05-15 23:04:49 +02:00
start.go pkg/machine: make checkExclusiveActiveVM race free 2024-03-14 11:13:08 +01:00
stop.go podman machine start/stop do not write config unlocked 2024-03-07 15:11:41 +01:00