containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.68k stars 2.41k forks source link

unable to start Hyper-V VM on Windows 11 after reboot #23627

Closed jingyuwa closed 2 months ago

jingyuwa commented 2 months ago

Issue Description

I have successfully run podman machine init using Hyper-V and my VM provider and have successfully deployed and run a container yesterday. But after reboot, I was not able to start the podman machine anymore. podman_start_debug_log.txt gvproxy.log

Steps to reproduce the issue

Steps to reproduce the issue

  1. podman machine init and build, deploy and run container using podman desktop GUI
  2. reboot computer
  3. Try to run podman machine start with admin privilege in powershell

Describe the results you received

Please see attachment in issue description. I was not able to get podman started image

Describe the results you expected

Podman machine can be successfully started, and previous containers can be started again.

podman info output

OS: windows/amd64
provider: hyperv
version: 5.2.0

Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman socket: Get "http://d/v5.2.0/libpod/_ping": dial unix /run/podman/podman.sock: connect: A socket operation encountered a dead network.

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

No

Additional environment details

NA

Additional information

This issue happened once and was resolved by executing bcdedit /set hypervisorlaunchtype auto. It happened again and I also tried to execute the command bcdedit /set hypervisorlaunchtype auto but it does not help this time.

Luap99 commented 2 months ago

Did you try running podman machine stop first?

jingyuwa commented 2 months ago

Did you try running podman machine stop first?

No

But after trying it gives same error as before. image

Luap99 commented 2 months ago

Can you try running the stop command before the reboot and see if this works?

Also please copy and paste your terminal output and not use screenshots for the terminal.

jingyuwa commented 2 months ago

Can you try running the stop command before the reboot and see if this works?

Also please copy and paste your terminal output and not use screenshots for the terminal.

 podman machine rm
The following files will be deleted:

C:\Users\wajin\.config\containers\podman\machine\hyperv\podman-machine-default.json
C:\Users\wajin\AppData\Local\Temp\podman\podman-machine-default.sock
C:\Users\wajin\AppData\Local\Temp\podman\podman-machine-default-gvproxy.sock
C:\Users\wajin\AppData\Local\Temp\podman\podman-machine-default-api.sock
C:\Users\wajin\AppData\Local\Temp\podman\podman-machine-default.log
Are you sure you want to continue? [y/N] y
Error: failed to remove machines files: unable to find connection named "podman-machine-default"

Now I'm not even able to remove my previous machine. Should I manually delete those files and start again from podman machine init?

Luap99 commented 2 months ago

I think it might already deleted the other files even when it report this error. Looks like we got in a bad state somehow. Does podman machine ls still show it after the rm command?

jingyuwa commented 2 months ago

I think it might already deleted the other files even when it report this error. Looks like we got in a bad state somehow. Does podman machine ls still show it after the rm command?

The machine was gone and I've gone through the podman machine init process again. I've tried to execute podman machine stop command before rebooting the machine, and tried directly reboot the machine, and also tried cut off the power and re-start the machine. None of those can reproduce this issue. The current VM can always be brought up by podman after reboot now.

baude commented 2 months ago

so its safe to say we got into some unknown state and we can no longer replicate this? if so, is it worth closing this until it happens again ?

jingyuwa commented 2 months ago

so its safe to say we got into some unknown state and we can no longer replicate this? if so, is it worth closing this until it happens again ?

Not able to reproduce. Closing this issue now. Thanks!