canonical / canonical/multipass
Can't launch any VM if Hyper-V native "Default Switch" was deleted.
- Dominant language
- C++
- Stars
- 9.2k
- Forks
- 828
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 44
Description
**Describe the bug**
I deleted Default Switch from _Hyper-V Manager_ which is OOTB.
This OOTB switch ID is C08CB7B8-9B3C-408E-8E30-5E16A3AEB444
I created in new _Hyper-V Manager_ internal switch with name Default Switch.
The result is I can't launch any VM from multipass.
**To Reproduce**
1. Delete native Default Switch (ID C08CB7B8-9B3C-408E-8E30-5E16A3AEB444) from _Hyper-V Manager_
2. Run as Administrator `multipass launch`
3. Get error _launch failed: Could not find the default switch_
**Expected behavior**
VM image is downloaded and launched. It is possible to setup switch for VM.
**Logs**
```PS C:\Users\DK> multipass launch -vvv
[2024-07-12T11:01:02.071] [debug] [blueprint provider] Loading "anbox-cloud-appliance" v1
[2024-07-12T11:01:02.071] [debug] [blueprint provider] Loading "charm-dev" v1
[2024-07-12T11:01:02.071] [debug] [blueprint provider] Loading "docker" v1
[2024-07-12T11:01:02.071] [debug] [blueprint provider] Loading "jellyfin" v1
[2024-07-12T11:01:02.071] [debug] [blueprint provider] Loading "minikube" v1
[2024-07-12T11:01:02.071] [debug] [blueprint provider] Loading "ros-noetic" v1
[2024-07-12T11:01:02.086] [debug] [blueprint provider] Loading "ros2-humble" v1
[2024-07-12T11:01:02.086] [debug] [powershell.exe] [20408] started: powershell.exe -NoProfile -NoExit -Command -
[2024-07-12T11:01:02.086] [debug] [Hyper-V Health Check] [20408] Cmdlet: 'Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' | Select-Object -ExpandProperty CurrentMajorVersionNumber'
[2024-07-12T11:01:02.900] [debug] [Hyper-V Health Check] [20408] Cmdlet exit status is 'true'
[2024-07-12T11:01:02.900] [debug] [Hyper-V Health Check] [20408] Cmdlet: 'Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' | Select-Object -ExpandProperty ReleaseId'
[2024-07-12T11:01:02.905] [debug] [Hyper-V Health Check] [20408] Cmdlet exit status is 'true'
[2024-07-12T11:01:02.905] [debug] [Hyper-V Health Check] [20408] Cmdlet: 'Get-CimInstance Win32_ComputerSystem | Select-Object -ExpandProperty HypervisorPresent'
[2024-07-12T11:01:03.015] [debug] [Hyper-V Health Check] [20408] Cmdlet exit status is 'true'
[2024-07-12T11:01:03.015] [debug] [Hyper-V Health Check] [20408] Cmdlet: 'Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V | Select-Object -ExpandProperty State'
[2024-07-12T11:01:03.429] [debug] [Hyper-V Health Check] [20408] Cmdlet exit status is 'true'
[2024-07-12T11:01:03.430] [debug] [Hyper-V Health Check] [20408] Cmdlet: 'Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor | Select-Object -ExpandProperty State'
[2024-07-12T11:01:03.614] [debug] [Hyper-V Health Check] [20408] Cmdlet exit status is 'true'
[2024-07-12T11:01:03.615] [debug] [Hyper-V Health Check] [20408] Cmdlet: 'Get-Service -Name vmms | Select-Object -ExpandProperty Status'
[2024-07-12T11:01:03.636] [debug] [Hyper-V Health Check] [20408] Cmdlet exit status is 'true'
[2024-07-12T11:01:03.659] [debug] [Hyper-V Health Check] [20408] PowerShell finished successfully
[2024-07-12T11:01:04.357] [debug] [qemu-img] [3512] started: qemu-img info C:/ProgramData/Multipass/cache/vault/images/noble-20240710/ubuntu-24.04-server-cloudimg-amd64.vhdx
[2024-07-12T11:01:04.410] [debug] [powershell.exe] [19972] started: powershell.exe Resize-VHD -Path C:/ProgramData/Multipass/data/vault/instances/bright-woodpecker/ubuntu-24.04-server-cloudimg-amd64.vhdx -SizeBytes 5368709120
[2024-07-12T11:01:07.077] [debug] [bright-woodpecker] [19972] PowerShell finished successfully
[2024-07-12T11:01:07.077] [debug] [powershell.exe] [15200] started: powershell.exe -NoProfile -NoExit -Command -
[2024-07-12T11:01:07.077] [debug] [bright-woodpecker] [15200] Cmdlet: 'Get-VM -Name bright-woodpecker'
[2024-07-12T11:01:08.224] [debug] [bright-woodpecker] [15200] Cmdlet exit status is 'false'
[2024-07-12T11:01:08.225] [debug] [bright-woodpecker] [15200] Cmdlet: '$switch = Get-VMSwitch -Id C08CB7B8-9B3C-408E-8E30-5E16A3AEB444'
[2024-07-12T11:01:08.637] [debug] [bright-woodpecker] [15200] Cmdlet exit status is 'false'
[2024-07-12T11:01:08.667] [debug] [bright-woodpecker] [15200] PowerShell finished successfully
[2024-07-12T11:01:08.682] [debug] [powershell.exe] [13472] started: powershell.exe Remove-VM -Name bright-woodpecker -Force
[2024-07-12T11:01:09.682] [warning] [bright-woodpecker] [13472] PowerShell finished abnormally: Process returned exit code: 1
launch failed: Could not find the default switch
```
**Additional info**
- OS: Windows 11 Enterprise version: 23H2
- Hyper-V Version: 10.0.22621.1
- `multipass version`
_multipass 1.13.1+win
multipassd 1.13.1+win_
(Also checked on version 1.11.1 and 1.14.RC6)
- `multipass info`
_No instances found._
- `multipass get local.driver`
_hyperv_
**Additional context**
I tried to delete "Default Switch" and thought that is should be created again. It didn't help.
_Get-HNSNetwork | ? Name -Like "Default Switch" | Remove-HNSNetwork_
I uninstalled and installed few times Hyper-V (from PS command line and Windows Add/Remove features)
It didn't help.
It is possible to downloads and install VM in Hyper-V Manager.
Contributor guide
Assessment
This issue has not been assessed yet.