spiegel_podman/pkg/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
..
apple Fix QF1012 staticcheck warnings 2025-03-31 12:27:55 -07:00
applehv update golangci-lint to v1.62.0 2024-11-11 14:21:17 +01:00
compression remove github.com/crc-org/crc/v2 dependency 2025-03-31 14:39:51 +02:00
connection Update connection on removal 2024-09-24 15:46:02 -04:00
define fix wsl install workflow on machine init command 2025-06-04 14:26:48 +02:00
e2e Update expected output for a machine copy test 2025-05-21 18:40:52 +02:00
env pkg/machine: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
hyperv Be explicit about ssh configs suitable only for localhost 2025-05-15 23:04:49 +02:00
ignition Merge pull request #26029 from Luap99/machine-tz 2025-05-05 21:00:35 +00:00
libkrun update golangci-lint to v1.62.0 2024-11-11 14:21:17 +01:00
lock pkg/machine: make checkExclusiveActiveVM race free 2024-03-14 11:13:08 +01:00
ocipull fix issues found by nilness 2025-05-13 17:20:10 +02:00
os Be explicit about ssh configs suitable only for localhost 2025-05-15 23:04:49 +02:00
ports Refactor env dir and port functions into new leaf pkgs 2024-03-04 23:54:31 -06:00
provider Move detection of libkrun and intel 2025-01-29 13:26:45 -06:00
proxyenv Be explicit about ssh configs suitable only for localhost 2025-05-15 23:04:49 +02:00
qemu Be explicit about ssh configs suitable only for localhost 2025-05-15 23:04:49 +02:00
shim fix wsl install workflow on machine init command 2025-06-04 14:26:48 +02:00
sockets Add utility to convert VMFile to URL for UNIX sockets 2024-07-23 16:41:24 +03:00
stdpull Clean machine pull cache 2024-04-26 12:31:42 -04:00
vmconfigs feat: Add support for configuring swap in Podman machine 2025-04-29 12:20:24 +10:00
wsl fix wsl install workflow on machine init command 2025-06-04 14:26:48 +02:00
cleanup.go Clean up gvproxy if machine start fails 2024-02-27 13:33:43 -06:00
config.go feat: Add support for configuring swap in Podman machine 2025-04-29 12:20:24 +10:00
config_test.go Switch all calls of assert.Nil to assert.NoError 2025-01-15 07:08:27 -05:00
fedora_unix.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
fedora_windows.go Fix Lint on Windows and enable the job 2024-02-20 08:06:18 -05:00
gvproxy.go Ignore ERROR_SHARING_VIOLATION error on windows 2024-08-06 14:09:36 -05:00
gvproxy_unix.go Update module github.com/shirou/gopsutil to v4 2024-09-03 18:20:12 +02:00
gvproxy_windows.go Ignore ERROR_SHARING_VIOLATION error on windows 2024-08-06 14:09:36 -05:00
keys.go pkg/machine: Read stderr from ssh-keygen correctly 2024-08-12 14:09:16 -04:00
machine_common.go Move DefaultMachineName to pkg/machine/define 2024-09-24 15:36:14 -04:00
machine_unix.go Complete WSL implementation, refactor a few areas 2024-02-11 12:58:11 -06:00
machine_unsupported.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
machine_windows.go pkg/machine: fix various linter warnings 2025-03-31 12:27:55 -07:00
machine_windows_test.go Update CI to run Windows unit tests 2025-03-16 13:40:16 +00:00
pull.go Refactor env dir and port functions into new leaf pkgs 2024-03-04 23:54:31 -06:00
qemuprovider.go podman5 machine reconfig 1 2024-02-07 08:17:43 -06:00
ssh.go Be explicit about ssh configs suitable only for localhost 2025-05-15 23:04:49 +02:00
ssh_unix.go machine: implement http proxy logic for all providers 2024-02-22 11:23:45 +01:00
ssh_windows.go machine: implement http proxy logic for all providers 2024-02-22 11:23:45 +01:00
update.go Be explicit about ssh configs suitable only for localhost 2025-05-15 23:04:49 +02:00
volumes.go machine/linux: Support virtiofs mounts (retain 9p default) 2024-06-07 10:03:06 -04:00