canonical / canonical/multipass
[Hyper-V] Instance gets stuck launching
- Dominant language
- C++
- Stars
- 9.2k
- Forks
- 828
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 44
Description
**Describe the bug**
When launching instances the Hyper-V backend can fail to find the VM so Multipass will never determine the correct state for the instance. The VM will be "running" in Hyper-V Manager but launching in Multipass. Restarting the daemon resolves the issue.
**To Reproduce**
In GUI, launch instances, observe issue
**Expected behavior**
The instances report the correct current state
**Logs**
```
[next-pekingese] [25920] stderr: Get-VM : Hyper-V was unable to find a virtual machine with name "next-pekingese".
At line:1 char:1
+ Get-VM -Name next-pekingese
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (next-pekingese:String) [Get-VM], VirtualizationException
+ FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM
```
**Additional info**
- OS: Windows 11 Pro
- CPU architecture or model: x86
- `multipass version`: dev build off main
- `multipass get local.driver`: Hyper-V
**Additional context**
My initial thought is we are calling Get-VM too soon after creating it
Contributor guide
Research direction
Start by tracing the Hyper-V backend's Get-VM call and the launch state handling, then reproduce the issue by launching an instance through the GUI on Windows 11 with Hyper-V enabled. Done means Multipass reports the instance's correct current state even when Hyper-V has not yet returned the VM during launch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, powershell
- Domain
- backend, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100