Podman Desktop unable to detect the Virtual Machine Platform already enabled
Bug description
After uninstalling the older version, I am trying to set up Podman Desktop and Podman on my Windows Laptop. I keep getting the error below on the check requirements screen.
Virtual Machine Platform should be enabled to be able to run Podman.
Operating system
Windows 11
Installation Method
Installer from website/GitHub releases
Version
1.10.2
Steps to reproduce
https://github.com/containers/podman-desktop/discussions/7413
Relevant log output
https://github.com/containers/podman-desktop/discussions/7413
Additional context
https://github.com/containers/podman-desktop/discussions/7413
I have almost the same problem. I installed podman desktop for the first time, and it can't detect that I deployed the virtual machine feature.
@bodzebod could you run in powershell command below? What is the output?
(Get-WmiObject -Query "Select * from Win32_OptionalFeature where InstallState = '1'").Name
here it is:
For your information, I have posted more details in a similar ticket: https://github.com/containers/podman-desktop/discussions/7413#discussioncomment-11001835
@bodzebod would you do another test and run line below in powershell? It prints out you current encoding used in powershell.
[System.Console]::OutputEncoding
output should look alike to one below
PS C:\p\encoding-test> [System.Console]::OutputEncoding
IsSingleByte : True
BodyName : IBM437
EncodingName : OEM United States
HeaderName : IBM437
WebName : IBM437
WindowsCodePage : 1252
IsBrowserDisplay : False
IsBrowserSave : False
IsMailNewsDisplay : False
IsMailNewsSave : False
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : True
CodePage : 437
Thank you!
Sure, here i is:
[System.Console]::OutputEncoding
IsSingleByte : True
EncodingName : Western European (DOS)
WebName : ibm850
HeaderName : ibm850
BodyName : ibm850
Preamble :
WindowsCodePage :
IsBrowserDisplay :
IsBrowserSave :
IsMailNewsDisplay :
IsMailNewsSave :
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : False
CodePage : 850
I have tested this use case using code snippet below on Windows 10 and 11. The result is the same it prints out VirtualMachinePlatform constant and true. Exactly the same is happening in production. I assume, for now, that problem was in resolving promise returned from process.exec to early based on process 'exit' event when output streams are not flushed and closed. Stream issue addressed in PR #9654 and going to be included in next release.
IMO we should keep this issue opened for now and let @bodzebod verify it in next release with #9456 included.
const { default: child_process } = await import("node:child_process");
function run () {
const p = child_process.spawn('powershell', [`[System.Console]::OutputEncoding = [Text.Encoding]::GetEncoding(850); (Get-WmiObject -Query "Select * from Win32_OptionalFeature where InstallState = \'1\'").Name | select-string VirtualMachinePlatform`],{});
let stdout = '';
p.stdout.setEncoding('utf8');
p.stdout.on('data', data => {
stdout+=data;
});
p.on('close', code => {
console.log(stdout.toString());
console.log(stdout.toString().includes('VirtualMachinePlatform'));
});
}
run();
@bodzebod latest podman release here have a fix for this issue. Could you verify if it works for you now? If it is not, then there is one more fix in pipeline and should be included into the next release.
Thank you!
Still having this issue with the latest build.
Same issue
Re-opening this as there have been two users with the same issue (see above)
For me helps installing podman manually from https://github.com/containers/podman/releases, and then podman-desktop detects it.
@Straven That is definitely a workaround for the problem. Although, we still have the issue to solve.
Same bug with Podman Desktop 1.21.0