multipass icon indicating copy to clipboard operation
multipass copied to clipboard

feature/hyperv-api-backend: VM & VM Factory Implementation

Open xmkg opened this issue 7 months ago • 1 comments

xmkg avatar May 08 '25 21:05 xmkg

Codecov Report

:x: Patch coverage is 66.66667% with 6 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 87.11%. Comparing base (9930299) to head (8cee27f). :warning: Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/file_ops.cpp 25.00% 6 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4080      +/-   ##
==========================================
- Coverage   87.14%   87.11%   -0.04%     
==========================================
  Files         247      247              
  Lines       14249    14256       +7     
==========================================
+ Hits        12418    12419       +1     
- Misses       1831     1837       +6     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 08 '25 21:05 codecov[bot]

Compilation issues again for me:

C:\Users\Scott\Documents\multipass\src\platform\backends\hyperv_api\hcn\hyperv_hcn_api_wrapper.cpp(91): error C3493: 'kGUIDLength' cannot be implicitly captured because no default capture mode has been specified
C:\Users\Scott\Documents\multipass\src\platform\backends\hyperv_api\hcn\hyperv_hcn_api_wrapper.cpp(94): error C3493: 'kGUIDLengthWithBraces' cannot be implicitly captured because no default capture mode has been specified
C:\Users\Scott\Documents\multipass\src\platform\backends\hyperv_api\hcn\hyperv_hcn_api_wrapper.cpp(108): error C2737: 'result': const object must be initialized
C:\Users\Scott\Documents\multipass\src\platform\backends\hyperv_api\hcn\hyperv_hcn_api_wrapper.cpp(110): error C3536: 'result': cannot be used before it is initialized

sharder996 avatar Jul 14 '25 21:07 sharder996

Another comment:

Native mounts are broken on hyperv (not hyperv_api). Unrelated to existing issue with Microsoft Accounts. Exact same setup works on main. Existing native mounts are also dropped.

C:\Users\Scott>multipass mount -t native . foo:test
Please enter your user password to allow Windows mounts:

mount failed: The following errors occurred:
error mounting "test": Error: mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

Also, I have issues launching instances when the driver is set to hyperv_api:

C:\Users\Scott>multipass launch -n foo
launch failed: create_compute_system failed with 0x8037010d

sharder996 avatar Jul 15 '25 16:07 sharder996

Another comment:

Native mounts are broken on hyperv (not hyperv_api). Unrelated to existing issue with Microsoft Accounts. Exact same setup works on main. Existing native mounts are also dropped.

C:\Users\Scott>multipass mount -t native . foo:test
Please enter your user password to allow Windows mounts:

mount failed: The following errors occurred:
error mounting "test": Error: mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

Also, I have issues launching instances when the driver is set to hyperv_api:

C:\Users\Scott>multipass launch -n foo
launch failed: create_compute_system failed with 0x8037010d

Curious :thinking: I'll take a look.

xmkg avatar Jul 16 '25 07:07 xmkg

Compilation issues again for me:

C:\Users\Scott\Documents\multipass\src\platform\backends\hyperv_api\hcn\hyperv_hcn_api_wrapper.cpp(91): error C3493: 'kGUIDLength' cannot be implicitly captured because no default capture mode has been specified
C:\Users\Scott\Documents\multipass\src\platform\backends\hyperv_api\hcn\hyperv_hcn_api_wrapper.cpp(94): error C3493: 'kGUIDLengthWithBraces' cannot be implicitly captured because no default capture mode has been specified
C:\Users\Scott\Documents\multipass\src\platform\backends\hyperv_api\hcn\hyperv_hcn_api_wrapper.cpp(108): error C2737: 'result': const object must be initialized
C:\Users\Scott\Documents\multipass\src\platform\backends\hyperv_api\hcn\hyperv_hcn_api_wrapper.cpp(110): error C3536: 'result': cannot be used before it is initialized

Fixed this one.

xmkg avatar Jul 16 '25 10:07 xmkg

Also, I have issues launching instances when the driver is set to hyperv_api:

C:\Users\Scott>multipass launch -n foo
launch failed: create_compute_system failed with 0x8037010d

I could not reproduce this with Windows 11 Pro 10.0.26100 (64-bit) and Windows 11 Home 10.0.26100 (64-bit). I'll now try with a Windows 10 Pro VM. Could you also share your Windows build number?

xmkg avatar Jul 16 '25 10:07 xmkg

Here's a verbose launch:

C:\Users\Scott>multipass launch -n foo -vvvv
[2025-07-16T08:17:46.070] [trace] [url downloader] Found https://cloud-images.ubuntu.com/releases/server/releases/noble/release-20250704/ubuntu-24.04-server-cloudimg-amd64.img in cache: false
[2025-07-16T08:17:46.073] [debug] [image vault] Verifying hash "f1652d29d497fb7c623433705c9fca6525d1311b11294a0f495eed55c7639d1f"
[2025-07-16T08:17:53.837] [debug] [qemu-img] [35852] started: qemu-img info C:/ProgramData/Multipass/cache/vault/images/noble-20250704/ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-16T08:17:53.866] [debug] [HyperV-VirtDisk-Wrapper] resize_virtual_disk(...) > vhdx_path: C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx, new_size_bytes: 5368709120
[2025-07-16T08:17:53.866] [debug] [HyperV-VirtDisk-Wrapper] open_virtual_disk(...) > vhdx_path: C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-16T08:17:54.443] [debug] [wsa-init-wrapper]  initialized WSA, status `0`
[2025-07-16T08:17:54.446] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-16T08:17:54.446] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-16T08:17:54.448] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo), result code: (0x8037010e)
[2025-07-16T08:17:54.448] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo
[2025-07-16T08:17:54.448] [debug] [HyperV-HCN-Wrapper] HCNWrapper::delete_endpoint(...) > endpoint_guid: db4bdbf0-dc14-407f-9780-5254008a6146
[2025-07-16T08:17:54.449] [debug] [HyperV-HCN-Wrapper] perform_operation(...) > fn: 0x0, result: false
[2025-07-16T08:17:54.450] [debug] [HyperV-HCN-Wrapper] HCNWrapper::create_endpoint(...) > params: Endpoint GUID: (db4bdbf0-dc14-407f-9780-5254008a6146) | Network GUID: (C08CB7B8-9B3C-408E-8E30-5E16A3AEB444) | MAC address: (optional("52-54-00-8a-61-46"))
[2025-07-16T08:17:54.450] [debug] [HyperV-HCN-Wrapper] open_network(...) > network_guid: C08CB7B8-9B3C-408E-8E30-5E16A3AEB444
[2025-07-16T08:17:54.450] [debug] [HyperV-HCN-Wrapper] perform_operation(...) > fn: 0x0, result: true
[2025-07-16T08:17:54.451] [debug] [HyperV-HCN-Wrapper] perform_operation(...) > fn: 0x0, result: true
[2025-07-16T08:17:54.451] [debug] [HyperV-HCS-Wrapper] HCSWrapper::create_compute_system(...) > params:
    {
        "SchemaVersion": {
            "Major": 2,
            "Minor": 1
        },
        "Owner": "Multipass",
        "ShouldTerminateOnLastHandleClosed": false,
        "VirtualMachine": {
            "Chipset": {
                "Uefi": {
                    "BootThis": {
                        "DevicePath": "Primary disk",
                        "DiskNumber": 0,
                        "DeviceType": "ScsiDrive"
                    },
                    "Console": "ComPort1"
                }
            },
            "ComputeTopology": {
                "Memory": {
                    "Backing": "Virtual",
                    "SizeInMB": 1024
                },
                "Processor": {
                    "Count": 1
                }
            },
            "Devices": {
                "ComPorts": {
                    "0": {
                        "NamedPipe": "\\\\.\\pipe\\foo"
                    }
                },
                "Scsi": {

        "Primary disk": {
            "Attachments": {
                "0": {
                    "Type": "VirtualDisk",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx",
                    "ReadOnly": false
                }
            }
        }
    ,
        "cloud-init ISO file": {
            "Attachments": {
                "0": {
                    "Type": "Iso",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso",
                    "ReadOnly": true
                }
            }
        }

                },
                "NetworkAdapters": {

        "db4bdbf0-dc14-407f-9780-5254008a6146": {
            "EndpointId" : "db4bdbf0-dc14-407f-9780-5254008a6146",
            "MacAddress": "52-54-00-8a-61-46",
            "InstanceId": "db4bdbf0-dc14-407f-9780-5254008a6146"
        }

                },
                "Plan9": {
                    "Shares": [

                    ]
                }
            },
            "Services": {
                "Shutdown": {},
                "Heartbeat": {}
            }
        }
    }

[2025-07-16T08:17:54.452] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-16T08:17:54.456] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x22abf5b5470), timeout: 240000 ms
[2025-07-16T08:17:54.456] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x22abf5b5470), result_code: 0x8037010d
[2025-07-16T08:17:54.509] [debug] [HyperV-Virtual-Machine-Factory] remove_resources_for_impl() -> VM: foo
[2025-07-16T08:17:54.510] [debug] [HyperV-HCS-Wrapper] terminate_compute_system(...) > name: (foo)
[2025-07-16T08:17:54.510] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-16T08:17:54.511] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo), result code: (0x8037010e)
[2025-07-16T08:17:54.511] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo
launch failed: create_compute_system failed with 0x8037010d

and my OS specifics:

Edition	Windows 10 Pro N
Version	22H2
Installed on	‎2022-‎09-‎08
OS build	19045.6093
Experience	Windows Feature Experience Pack 1000.19062.1000.0

sharder996 avatar Jul 16 '25 13:07 sharder996

Here's a verbose launch:

C:\Users\Scott>multipass launch -n foo -vvvv
[2025-07-16T08:17:46.070] [trace] [url downloader] Found https://cloud-images.ubuntu.com/releases/server/releases/noble/release-20250704/ubuntu-24.04-server-cloudimg-amd64.img in cache: false
[2025-07-16T08:17:46.073] [debug] [image vault] Verifying hash "f1652d29d497fb7c623433705c9fca6525d1311b11294a0f495eed55c7639d1f"
[2025-07-16T08:17:53.837] [debug] [qemu-img] [35852] started: qemu-img info C:/ProgramData/Multipass/cache/vault/images/noble-20250704/ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-16T08:17:53.866] [debug] [HyperV-VirtDisk-Wrapper] resize_virtual_disk(...) > vhdx_path: C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx, new_size_bytes: 5368709120
[2025-07-16T08:17:53.866] [debug] [HyperV-VirtDisk-Wrapper] open_virtual_disk(...) > vhdx_path: C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-16T08:17:54.443] [debug] [wsa-init-wrapper]  initialized WSA, status `0`
[2025-07-16T08:17:54.446] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-16T08:17:54.446] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-16T08:17:54.448] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo), result code: (0x8037010e)
[2025-07-16T08:17:54.448] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo
[2025-07-16T08:17:54.448] [debug] [HyperV-HCN-Wrapper] HCNWrapper::delete_endpoint(...) > endpoint_guid: db4bdbf0-dc14-407f-9780-5254008a6146
[2025-07-16T08:17:54.449] [debug] [HyperV-HCN-Wrapper] perform_operation(...) > fn: 0x0, result: false
[2025-07-16T08:17:54.450] [debug] [HyperV-HCN-Wrapper] HCNWrapper::create_endpoint(...) > params: Endpoint GUID: (db4bdbf0-dc14-407f-9780-5254008a6146) | Network GUID: (C08CB7B8-9B3C-408E-8E30-5E16A3AEB444) | MAC address: (optional("52-54-00-8a-61-46"))
[2025-07-16T08:17:54.450] [debug] [HyperV-HCN-Wrapper] open_network(...) > network_guid: C08CB7B8-9B3C-408E-8E30-5E16A3AEB444
[2025-07-16T08:17:54.450] [debug] [HyperV-HCN-Wrapper] perform_operation(...) > fn: 0x0, result: true
[2025-07-16T08:17:54.451] [debug] [HyperV-HCN-Wrapper] perform_operation(...) > fn: 0x0, result: true
[2025-07-16T08:17:54.451] [debug] [HyperV-HCS-Wrapper] HCSWrapper::create_compute_system(...) > params:
    {
        "SchemaVersion": {
            "Major": 2,
            "Minor": 1
        },
        "Owner": "Multipass",
        "ShouldTerminateOnLastHandleClosed": false,
        "VirtualMachine": {
            "Chipset": {
                "Uefi": {
                    "BootThis": {
                        "DevicePath": "Primary disk",
                        "DiskNumber": 0,
                        "DeviceType": "ScsiDrive"
                    },
                    "Console": "ComPort1"
                }
            },
            "ComputeTopology": {
                "Memory": {
                    "Backing": "Virtual",
                    "SizeInMB": 1024
                },
                "Processor": {
                    "Count": 1
                }
            },
            "Devices": {
                "ComPorts": {
                    "0": {
                        "NamedPipe": "\\\\.\\pipe\\foo"
                    }
                },
                "Scsi": {

        "Primary disk": {
            "Attachments": {
                "0": {
                    "Type": "VirtualDisk",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx",
                    "ReadOnly": false
                }
            }
        }
    ,
        "cloud-init ISO file": {
            "Attachments": {
                "0": {
                    "Type": "Iso",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso",
                    "ReadOnly": true
                }
            }
        }

                },
                "NetworkAdapters": {

        "db4bdbf0-dc14-407f-9780-5254008a6146": {
            "EndpointId" : "db4bdbf0-dc14-407f-9780-5254008a6146",
            "MacAddress": "52-54-00-8a-61-46",
            "InstanceId": "db4bdbf0-dc14-407f-9780-5254008a6146"
        }

                },
                "Plan9": {
                    "Shares": [

                    ]
                }
            },
            "Services": {
                "Shutdown": {},
                "Heartbeat": {}
            }
        }
    }

[2025-07-16T08:17:54.452] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-16T08:17:54.456] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x22abf5b5470), timeout: 240000 ms
[2025-07-16T08:17:54.456] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x22abf5b5470), result_code: 0x8037010d
[2025-07-16T08:17:54.509] [debug] [HyperV-Virtual-Machine-Factory] remove_resources_for_impl() -> VM: foo
[2025-07-16T08:17:54.510] [debug] [HyperV-HCS-Wrapper] terminate_compute_system(...) > name: (foo)
[2025-07-16T08:17:54.510] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-16T08:17:54.511] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo), result code: (0x8037010e)
[2025-07-16T08:17:54.511] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo
launch failed: create_compute_system failed with 0x8037010d

and my OS specifics:

Edition	Windows 10 Pro N
Version	22H2
Installed on	‎2022-‎09-‎08
OS build	19045.6093
Experience	Windows Feature Experience Pack 1000.19062.1000.0

Hey Scott,

Thanks for the detailed info, it helped me a lot to understand what went wrong. There were two issues:

  • The platform code did not check if the "Virtual Machine Platform" feature was enabled
  • The backend code was using a HCS Schema 2.5 feature, where Windows 10 is stuck in 2.3

So, for the first one, unfortunately, it's not trivial to check whether a Windows feature is enabled or not. It depends on DISM libs and headers, hence requires Windows ADK to be installed, which is a lot of trouble for so little to gain. Instead, I've added error message texts to logs by default, and it's now way easier to troubleshoot what went wrong. Additionally, I've added a hint message to the HCS error code (0x80370114) and HCN error code (0x800706d9) to suggest checking if VMP is enabled.

As for the second one, I've gated features that depend on a newer schema version behind a check. You should be able to use the backend after enabling the "Virtual Machine Platform":

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Let me know if you encounter any issues.

xmkg avatar Jul 18 '25 15:07 xmkg

Thanks for the details, @xmkg

Couple comments and questions (btw all the below testing is still on the same version of Windows as before):

  1. I'm still seeing native mounts not working and being dropped with the hyperv driver here versus v1.16.
  2. I don't think my previous problem with launching instances with hyperv_api had anything to do with Virtual Machine Platform not being enabled. I have it enabled all the time and normally the installer should have enabled it for the user to being with.
PS C:\Windows\system32> Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform                       

Path          :
Online        : True
RestartNeeded : False
  1. What are these features that are not available in HCS Schema 2.3?
  2. Getting some intermittent errors with multipass launch
C:\Users\Scott>multipass delete -p --all && multipass launch -n foo -vvvv
[2025-07-24T12:52:35.734] [debug] [qemu-img] [10436] started: qemu-img info C:/ProgramData/Multipass/cache/vault/images/noble-20250704/ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-24T12:52:35.758] [debug] [HyperV-VirtDisk-Wrapper] resize_virtual_disk(...) > vhdx_path: C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx, new_size_bytes: 5368709120
[2025-07-24T12:52:35.758] [debug] [HyperV-VirtDisk-Wrapper] open_virtual_disk(...) > vhdx_path: C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-24T12:52:36.888] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-24T12:52:36.889] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:52:36.889] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo), result code: (0x8037010e: A virtual machine or container with the specified identifier does not exist.)
[2025-07-24T12:52:36.890] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo
[2025-07-24T12:52:36.890] [debug] [HyperV-HCN-Wrapper] HCNWrapper::delete_endpoint(...) > endpoint_guid: db4bdbf0-dc14-407f-9780-52540089f78e
[2025-07-24T12:52:36.890] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: false
[2025-07-24T12:52:36.891] [debug] [HyperV-HCN-Wrapper] HCNWrapper::create_endpoint(...) > params: Endpoint GUID: (db4bdbf0-dc14-407f-9780-52540089f78e) | Network GUID: (C08CB7B8-9B3C-408E-8E30-5E16A3AEB444) | MAC address: (optional("52-54-00-89-f7-8e"))
[2025-07-24T12:52:36.891] [debug] [HyperV-HCN-Wrapper] open_network(...) > network_guid: C08CB7B8-9B3C-408E-8E30-5E16A3AEB444
[2025-07-24T12:52:36.891] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T12:52:36.892] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T12:52:36.892] [debug] [HyperV-HCS-Wrapper] HCSWrapper::create_compute_system(...) > params:
    {
        "SchemaVersion": {
            "Major": 2,
            "Minor": 1
        },
        "Owner": "Multipass",
        "ShouldTerminateOnLastHandleClosed": false,
        "VirtualMachine": {
            "Chipset": {
                "Uefi": {
                    "BootThis": {
                        "DevicePath": "Primary disk",
                        "DiskNumber": 0,
                        "DeviceType": "ScsiDrive"
                    },
                    "Console": "ComPort1"
                }
            },
            "ComputeTopology": {
                "Memory": {
                    "Backing": "Virtual",
                    "SizeInMB": 1024
                },
                "Processor": {
                    "Count": 1
                }
            },
            "Devices": {
                "ComPorts": {
                    "0": {
                        "NamedPipe": "\\\\.\\pipe\\foo"
                    }
                },
                "Scsi": {

        "Primary disk": {
            "Attachments": {
                "0": {
                    "Type": "VirtualDisk",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx",
                    "ReadOnly": false
                }
            }
        }
    ,
        "cloud-init ISO file": {
            "Attachments": {
                "0": {
                    "Type": "Iso",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso",
                    "ReadOnly": true
                }
            }
        }

                },
                "NetworkAdapters": {

        "db4bdbf0-dc14-407f-9780-52540089f78e": {
            "EndpointId" : "db4bdbf0-dc14-407f-9780-52540089f78e",
            "MacAddress": "52-54-00-89-f7-8e",
            "InstanceId": "db4bdbf0-dc14-407f-9780-52540089f78e"
        }

                },
                "Plan9": {
                    "Shares": [

                    ]
                }
            }

        }
    }

[2025-07-24T12:52:36.892] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:52:36.893] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x2601506dd80), timeout: 240000 ms
[2025-07-24T12:52:36.929] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x2601506dd80), result_code: 0x0: The operation completed successfully.
[2025-07-24T12:52:36.930] [debug] [HyperV-Virtual-Machine] Granting access to path `C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx`, exists? true
[2025-07-24T12:52:36.930] [debug] [HyperV-HCS-Wrapper] grant_vm_access(...) > name: (foo), file_path: (C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx)
[2025-07-24T12:52:36.931] [debug] [HyperV-Virtual-Machine] Granting access to path `C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso`, exists? true
[2025-07-24T12:52:36.931] [debug] [HyperV-HCS-Wrapper] grant_vm_access(...) > name: (foo), file_path: (C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso)
[2025-07-24T12:52:36.932] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-24T12:52:36.932] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:52:36.932] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:52:36.932] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > result: true
[2025-07-24T12:52:36.933] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x2601506d620), timeout: 240000 ms
[2025-07-24T12:52:36.933] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x2601506d620), result_code: 0x0: The operation completed successfully.
[2025-07-24T12:52:36.933] [debug] [HyperV-Virtual-Machine] HCSVirtualMachine::HCSVirtualMachine() > `foo`, created_from_scratch: true, state: stopped
[2025-07-24T12:52:36.934] [debug] [HyperV-Virtual-Machine] set_state() -> VM `foo` HCS state `stopped`
[2025-07-24T12:52:36.934] [info] [HyperV-Virtual-Machine] set_state() > VM foo state changed from off to stopped
[2025-07-24T12:52:36.949] [debug] [HyperV-Virtual-Machine] start() -> Starting VM `foo`, current state stopped
[2025-07-24T12:52:36.949] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-24T12:52:36.949] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:52:36.949] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:52:36.950] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > result: true
[2025-07-24T12:52:36.950] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x2601506d740), timeout: 240000 ms
[2025-07-24T12:52:36.950] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x2601506d740), result_code: 0x0: The operation completed successfully.
[2025-07-24T12:52:36.958] [debug] [HyperV-Virtual-Machine-Factory] remove_resources_for_impl() -> VM: foo
[2025-07-24T12:52:36.958] [debug] [HyperV-HCS-Wrapper] terminate_compute_system(...) > name: (foo)
[2025-07-24T12:52:36.959] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:52:36.959] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:52:36.959] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > result: true
[2025-07-24T12:52:36.960] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x2601506d7e0), timeout: 240000 ms
[2025-07-24T12:52:36.963] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x2601506d7e0), result_code: 0x0: The operation completed successfully.
[2025-07-24T12:52:36.963] [warning] [HyperV-Virtual-Machine-Factory] remove_resources_for_impl() -> Host compute system foo was still alive.
launch failed: cannot write to file: bad file descriptor
  1. and during multipass clone
C:\Users\Scott>multipass delete -p --all && multipass launch -n foo && multipass stop foo && multipass clone foo -vvvv
Launched: foo
Cloning foo /[2025-07-24T12:45:25.701] [debug] [HyperV-VirtDisk-Wrapper] create_virtual_disk(...) > params: Size (in bytes): (0) | Path: (C:/ProgramData/Multipass/data/vault/instances/foo-clone1/ubuntu-24.04-server-cloudimg-amd64.vhdx)
[2025-07-24T12:45:25.701] [debug] [HyperV-VirtDisk-Wrapper] get_virtual_disk_info(...) > vhdx_path: C:\ProgramData\Multipass\data\vault\instances\foo\ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-24T12:45:25.701] [debug] [HyperV-VirtDisk-Wrapper] open_virtual_disk(...) > vhdx_path: C:\ProgramData\Multipass\data\vault\instances\foo\ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-24T12:45:25.708] [error] [HyperV-VirtDisk-Wrapper] open_virtual_disk(...) > OpenVirtualDisk failed with: system:32
[2025-07-24T12:45:25.709] [debug] [HyperV-VirtDisk-Wrapper] create_virtual_disk(...) > source disk info fetch result `0x80004005: Unspecified error`
[2025-07-24T12:45:25.713] [debug] [HyperV-Virtual-Machine-Factory] remove_resources_for_impl() -> VM: foo-clone1
[2025-07-24T12:45:25.714] [debug] [HyperV-HCS-Wrapper] terminate_compute_system(...) > name: (foo-clone1)
[2025-07-24T12:45:25.714] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo-clone1)
[2025-07-24T12:45:25.714] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo-clone1), result code: (0x8037010e: A virtual machine or container with the specified identifier does not exist.)
[2025-07-24T12:45:25.715] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo-clone1
clone failed: Failed to retrieve the predecessor disk type for `C:\ProgramData\Multipass\data\vault\instances\foo\ubuntu-24.04-server-cloudimg-amd64.vhdx`, error code: 0x80004005: Unspecified error
  1. Also, starting an instance after snapshotting results in some errors:
C:\Users\Scott>multipass delete -p --all

C:\Users\Scott>multipass launch -n foo
Launched: foo

C:\Users\Scott>multipass stop foo

C:\Users\Scott>multipass snapshot foo -vvvv
[2025-07-24T12:56:47.801] [debug] [virtdisk-snapshot] capture_impl() -> head_path: C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx, snapshot_path: C:/ProgramData/Multipass/data/vault/instances/foo\snapshot1.avhdx
[2025-07-24T12:56:47.801] [debug] [virtdisk-snapshot] create_new_child_disk() -> parent: C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx, child: C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx
[2025-07-24T12:56:47.802] [debug] [HyperV-VirtDisk-Wrapper] create_virtual_disk(...) > params: Size (in bytes): (0) | Path: (C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx)
[2025-07-24T12:56:47.802] [debug] [HyperV-VirtDisk-Wrapper] get_virtual_disk_info(...) > vhdx_path: C:\ProgramData\Multipass\data\vault\instances\foo\ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-24T12:56:47.802] [debug] [HyperV-VirtDisk-Wrapper] open_virtual_disk(...) > vhdx_path: C:\ProgramData\Multipass\data\vault\instances\foo\ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-24T12:56:47.811] [debug] [HyperV-VirtDisk-Wrapper] create_virtual_disk(...) > source disk info fetch result `0x0: The operation completed successfully.`
[2025-07-24T12:56:47.844] [debug] [virtdisk-snapshot] Successfully created the child disk: `C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx`
[2025-07-24T12:56:47.845] [debug] [virtdisk-snapshot] create_new_child_disk() -> parent: C:/ProgramData/Multipass/data/vault/instances/foo\snapshot1.avhdx, child: C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx
[2025-07-24T12:56:47.845] [debug] [HyperV-VirtDisk-Wrapper] create_virtual_disk(...) > params: Size (in bytes): (0) | Path: (C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx)
[2025-07-24T12:56:47.846] [debug] [HyperV-VirtDisk-Wrapper] get_virtual_disk_info(...) > vhdx_path: C:\ProgramData\Multipass\data\vault\instances\foo\snapshot1.avhdx
[2025-07-24T12:56:47.846] [debug] [HyperV-VirtDisk-Wrapper] open_virtual_disk(...) > vhdx_path: C:\ProgramData\Multipass\data\vault\instances\foo\snapshot1.avhdx
[2025-07-24T12:56:47.855] [debug] [HyperV-VirtDisk-Wrapper] create_virtual_disk(...) > source disk info fetch result `0x0: The operation completed successfully.`
[2025-07-24T12:56:47.891] [debug] [virtdisk-snapshot] Successfully created the child disk: `C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx`
Snapshot taken: foo.snapshot1

C:\Users\Scott>multipass start foo -vvvv
[2025-07-24T12:56:57.207] [debug] [HyperV-Virtual-Machine] start() -> Starting VM `foo`, current state off
[2025-07-24T12:56:57.207] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-24T12:56:57.207] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:56:57.208] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo), result code: (0x8037010e: A virtual machine or container with the specified identifier does not exist.)
[2025-07-24T12:56:57.208] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo
[2025-07-24T12:56:57.208] [debug] [HyperV-HCN-Wrapper] HCNWrapper::delete_endpoint(...) > endpoint_guid: db4bdbf0-dc14-407f-9780-52540032d752
[2025-07-24T12:56:57.209] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T12:56:57.210] [debug] [HyperV-Virtual-Machine] The endpoint db4bdbf0-dc14-407f-9780-52540032d752 was already present for the VM foo, removed it.
[2025-07-24T12:56:57.210] [debug] [HyperV-HCN-Wrapper] HCNWrapper::create_endpoint(...) > params: Endpoint GUID: (db4bdbf0-dc14-407f-9780-52540032d752) | Network GUID: (C08CB7B8-9B3C-408E-8E30-5E16A3AEB444) | MAC address: (optional("52-54-00-32-d7-52"))
[2025-07-24T12:56:57.210] [debug] [HyperV-HCN-Wrapper] open_network(...) > network_guid: C08CB7B8-9B3C-408E-8E30-5E16A3AEB444
[2025-07-24T12:56:57.210] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T12:56:57.211] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T12:56:57.211] [debug] [HyperV-HCS-Wrapper] HCSWrapper::create_compute_system(...) > params:
    {
        "SchemaVersion": {
            "Major": 2,
            "Minor": 1
        },
        "Owner": "Multipass",
        "ShouldTerminateOnLastHandleClosed": false,
        "VirtualMachine": {
            "Chipset": {
                "Uefi": {
                    "BootThis": {
                        "DevicePath": "Primary disk",
                        "DiskNumber": 0,
                        "DeviceType": "ScsiDrive"
                    },
                    "Console": "ComPort1"
                }
            },
            "ComputeTopology": {
                "Memory": {
                    "Backing": "Virtual",
                    "SizeInMB": 1024
                },
                "Processor": {
                    "Count": 1
                }
            },
            "Devices": {
                "ComPorts": {
                    "0": {
                        "NamedPipe": "\\\\.\\pipe\\foo"
                    }
                },
                "Scsi": {

        "Primary disk": {
            "Attachments": {
                "0": {
                    "Type": "VirtualDisk",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/head.avhdx",
                    "ReadOnly": false
                }
            }
        }
    ,
        "cloud-init ISO file": {
            "Attachments": {
                "0": {
                    "Type": "Iso",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso",
                    "ReadOnly": true
                }
            }
        }

                },
                "NetworkAdapters": {

        "db4bdbf0-dc14-407f-9780-52540032d752": {
            "EndpointId" : "db4bdbf0-dc14-407f-9780-52540032d752",
            "MacAddress": "52-54-00-32-d7-52",
            "InstanceId": "db4bdbf0-dc14-407f-9780-52540032d752"
        }

                },
                "Plan9": {
                    "Shares": [

                    ]
                }
            }

        }
    }

[2025-07-24T12:56:57.212] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:56:57.212] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x2601506e3a0), timeout: 240000 ms
[2025-07-24T12:56:57.245] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x2601506e3a0), result_code: 0x0: The operation completed successfully.
[2025-07-24T12:56:57.246] [debug] [HyperV-Virtual-Machine] Granting access to path `C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx`, exists? true
[2025-07-24T12:56:57.246] [debug] [HyperV-HCS-Wrapper] grant_vm_access(...) > name: (foo), file_path: (C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx)
[2025-07-24T12:56:57.247] [debug] [HyperV-Virtual-Machine] Granting access to path `C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso`, exists? true
[2025-07-24T12:56:57.247] [debug] [HyperV-HCS-Wrapper] grant_vm_access(...) > name: (foo), file_path: (C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso)
[2025-07-24T12:56:57.255] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-24T12:56:57.256] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:56:57.256] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:56:57.257] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > result: true
[2025-07-24T12:56:57.257] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x26014f97340), timeout: 240000 ms
[2025-07-24T12:56:57.257] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x26014f97340), result_code: 0x0: The operation completed successfully.
[2025-07-24T12:56:57.257] [debug] [HyperV-Virtual-Machine] start() -> VM `foo` HCS state is `stopped`
[2025-07-24T12:56:57.258] [debug] [HyperV-Virtual-Machine] start() -> VM `foo` is in starting state, starting
[2025-07-24T12:56:57.258] [debug] [HyperV-HCS-Wrapper] start_compute_system(...) > name: (foo)
[2025-07-24T12:56:57.258] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:56:57.259] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:56:57.259] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > result: true
[2025-07-24T12:56:57.259] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x260185bf9d0), timeout: 240000 ms
[2025-07-24T12:56:57.299] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x260185bf9d0), result_code: 0xc03a0016: The chain of virtual hard disks is inaccessible. The process has not been granted access rights to the parent virtual hard disk for the differencing disk.
start failed: Could not start the VM: 0xc03a0016: The chain of virtual hard disks is inaccessible. The process has not been granted access rights to the parent virtual hard disk for the differencing disk.

C:\Users\Scott>multipass start foo -vvvv
[2025-07-24T12:57:02.295] [debug] [HyperV-Virtual-Machine] start() -> Starting VM `foo`, current state stopped
[2025-07-24T12:57:02.295] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-24T12:57:02.296] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:57:02.296] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo), result code: (0x8037010e: A virtual machine or container with the specified identifier does not exist.)
[2025-07-24T12:57:02.296] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo
[2025-07-24T12:57:02.297] [debug] [HyperV-HCN-Wrapper] HCNWrapper::delete_endpoint(...) > endpoint_guid: db4bdbf0-dc14-407f-9780-52540032d752
[2025-07-24T12:57:02.297] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T12:57:02.297] [debug] [HyperV-Virtual-Machine] The endpoint db4bdbf0-dc14-407f-9780-52540032d752 was already present for the VM foo, removed it.
[2025-07-24T12:57:02.298] [debug] [HyperV-HCN-Wrapper] HCNWrapper::create_endpoint(...) > params: Endpoint GUID: (db4bdbf0-dc14-407f-9780-52540032d752) | Network GUID: (C08CB7B8-9B3C-408E-8E30-5E16A3AEB444) | MAC address: (optional("52-54-00-32-d7-52"))
[2025-07-24T12:57:02.298] [debug] [HyperV-HCN-Wrapper] open_network(...) > network_guid: C08CB7B8-9B3C-408E-8E30-5E16A3AEB444
[2025-07-24T12:57:02.298] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T12:57:02.299] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T12:57:02.299] [debug] [HyperV-HCS-Wrapper] HCSWrapper::create_compute_system(...) > params:
    {
        "SchemaVersion": {
            "Major": 2,
            "Minor": 1
        },
        "Owner": "Multipass",
        "ShouldTerminateOnLastHandleClosed": false,
        "VirtualMachine": {
            "Chipset": {
                "Uefi": {
                    "BootThis": {
                        "DevicePath": "Primary disk",
                        "DiskNumber": 0,
                        "DeviceType": "ScsiDrive"
                    },
                    "Console": "ComPort1"
                }
            },
            "ComputeTopology": {
                "Memory": {
                    "Backing": "Virtual",
                    "SizeInMB": 1024
                },
                "Processor": {
                    "Count": 1
                }
            },
            "Devices": {
                "ComPorts": {
                    "0": {
                        "NamedPipe": "\\\\.\\pipe\\foo"
                    }
                },
                "Scsi": {

        "Primary disk": {
            "Attachments": {
                "0": {
                    "Type": "VirtualDisk",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/head.avhdx",
                    "ReadOnly": false
                }
            }
        }
    ,
        "cloud-init ISO file": {
            "Attachments": {
                "0": {
                    "Type": "Iso",
                    "Path": "C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso",
                    "ReadOnly": true
                }
            }
        }

                },
                "NetworkAdapters": {

        "db4bdbf0-dc14-407f-9780-52540032d752": {
            "EndpointId" : "db4bdbf0-dc14-407f-9780-52540032d752",
            "MacAddress": "52-54-00-32-d7-52",
            "InstanceId": "db4bdbf0-dc14-407f-9780-52540032d752"
        }

                },
                "Plan9": {
                    "Shares": [

                    ]
                }
            }

        }
    }

[2025-07-24T12:57:02.299] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:57:02.300] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x2601506e5a0), timeout: 240000 ms
[2025-07-24T12:57:02.330] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x2601506e5a0), result_code: 0x0: The operation completed successfully.
[2025-07-24T12:57:02.330] [debug] [HyperV-Virtual-Machine] Granting access to path `C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx`, exists? true
[2025-07-24T12:57:02.331] [debug] [HyperV-HCS-Wrapper] grant_vm_access(...) > name: (foo), file_path: (C:/ProgramData/Multipass/data/vault/instances/foo\head.avhdx)
[2025-07-24T12:57:02.331] [debug] [HyperV-Virtual-Machine] Granting access to path `C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso`, exists? true
[2025-07-24T12:57:02.332] [debug] [HyperV-HCS-Wrapper] grant_vm_access(...) > name: (foo), file_path: (C:/ProgramData/Multipass/data/vault/instances/foo/cloud-init-config.iso)
[2025-07-24T12:57:02.340] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-24T12:57:02.340] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:57:02.341] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:57:02.341] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > result: true
[2025-07-24T12:57:02.341] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x2601506de80), timeout: 240000 ms
[2025-07-24T12:57:02.341] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x2601506de80), result_code: 0x0: The operation completed successfully.
[2025-07-24T12:57:02.342] [debug] [HyperV-Virtual-Machine] start() -> VM `foo` HCS state is `stopped`
[2025-07-24T12:57:02.342] [debug] [HyperV-Virtual-Machine] start() -> VM `foo` is in starting state, starting
[2025-07-24T12:57:02.342] [debug] [HyperV-HCS-Wrapper] start_compute_system(...) > name: (foo)
[2025-07-24T12:57:02.342] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T12:57:02.343] [trace] [HyperV-HCS-Wrapper] create_operation(...)
[2025-07-24T12:57:02.343] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > result: true
[2025-07-24T12:57:02.343] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > (0x26014f97480), timeout: 240000 ms
[2025-07-24T12:57:02.381] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x26014f97480), result_code: 0xc03a0016: The chain of virtual hard disks is inaccessible. The process has not been granted access rights to the parent virtual hard disk for the differencing disk.
start failed: cannot write to file: bad file descriptor

C:\Users\Scott>multipass start foo -vvvv
Starting foo |^C <--- times out here
  1. Some trouble with changing vm system resources. I'm unable to change the disk size. Number of cpus and memory size does not change with local.foo.cpus and local.foo.memory:
C:\Users\Scott>multipass info foo
Name:           foo
State:          Running
Snapshots:      0
IPv4:           172.17.84.216
Release:        Ubuntu 24.04.2 LTS
Image hash:     f1652d29d497 (Ubuntu 24.04 LTS)
CPU(s):         1
Load:           0.00 0.00 0.00
Disk usage:     1.9GiB out of 4.8GiB
Memory usage:   338.5MiB out of 896.2MiB
Mounts:         --

C:\Users\Scott>multipass get local.foo.cpus
4

C:\Users\Scott>multipass get local.foo.memory
8.0GiB

C:\Users\Scott>multipass get local.foo.disk
5.0GiB

C:\Users\Scott>multipass stop foo

C:\Users\Scott>multipass set local.foo.disk=10G
set failed: Not yet implemented
  1. Ignore if the compatibility with the hyperv driver is not important. There is a disconnect between using hyperv_api, hyperv, and the Hyper-V Manager:
C:\Users\Scott>multipass get local.driver
hyperv

C:\Users\Scott>multipass launch -n foo
Launched: foo

C:\Users\Scott>multipass set local.driver=hyperv_api

C:\Users\Scott>multipass ls
Name                    State             IPv4             Image
foo                     Stopped           --               Ubuntu 24.04 LTS

C:\Users\Scott>multipass delete -p --all

C:\Users\Scott>multipass set local.driver=hyperv

C:\Users\Scott>multipass launch -n foo
launch failed: Start-VM : 'foo' failed to restore.
Synthetic SCSI Controller (Instance ID A463C8C0-4EB5-4B41-96FE-76BAE3D8D908): Failed to restore with Error 'Access is
denied.'.
Hyper-V Virtual Machine Management service Account does not have permission to open attachment
'C:\ProgramData\Multipass\data\vault\instances\foo\cloud-init-config.iso'. Error: 'Access is denied.'.
'foo' failed to restore. (Virtual machine ID 98F49010-F2DE-491F-B4DA-A4C4702E01F6)
'foo' Synthetic SCSI Controller (Instance ID A463C8C0-4EB5-4B41-96FE-76BAE3D8D908): Failed to restore with Error
'Access is denied.' (0x80070005). (Virtual machine ID 98F49010-F2DE-491F-B4DA-A4C4702E01F6)
'foo': Hyper-V Virtual Machine Management service Account does not have permission to open attachment
'C:\ProgramData\Multipass\data\vault\instances\foo\cloud-init-config.iso'. Error: 'Access is denied.' (0x80070005).
(Virtual machine ID 98F49010-F2DE-491F-B4DA-A4C4702E01F6)
At line:1 char:1
+ Start-VM -Name foo
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Start-VM], VirtualizationException
    + FullyQualifiedErrorId : AccessDenied,Microsoft.HyperV.PowerShell.Commands.StartVM

a. Switching driver from hyperv to hyperv_api puts a vm into the Saved state (according to Hyper-V Manager). When the Multipass daemon reboots, Multipass reports the instance as being in the Stopped state when it should have been returned to its original Running state. b. Deleting a vm with the hyperv_api driver that was created with the hyperv driver does not remove it from the Hyper-V Manager. This can cause future issues when trying to create a vm of the same name with hyperv. Or, simply accessing the ghost vm from the Hyper-V Manager. c. VMs created with the hyperv_api driver do not show up in Hyper-V Manager. 9. Networking does not work for me: a. There is a difference in networks that are reported:

C:\Users\Scott>multipass get local.driver
hyperv

C:\Users\Scott>multipass networks
Name                   Type     Description
Default Switch         switch   Virtual Switch with internal networking
ExtSwitch (Ethernet)   switch   Virtual Switch with external networking

C:\Users\Scott>multipass set local.driver=hyperv_api

C:\Users\Scott>multipass networks
Name       Type       Description
Ethernet   Ethernet   Intel(R) Ethernet Controller (3) I225-V

b. Using the Ethernet network as the bridged-network results in the following error. Might have something to do with the fact that my PC is connected via WiFi and not Ethernet.

C:\Users\Scott>multipass launch -n foo --bridged -vvvv
Multipass needs to create a switch to connect to Ethernet.
This will temporarily disrupt connectivity on that interface.

Do you want to continue (yes/no)? yes
[2025-07-24T13:22:18.056] [debug] [qemu-img] [23684] started: qemu-img info C:/ProgramData/Multipass/cache/vault/images/noble-20250704/ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-24T13:22:18.089] [debug] [HyperV-HCN-Wrapper] HCNWrapper::create_network(...) > params: Network Name: (Multipass Bridge (Ethernet)) | Network Type: (Transparent) | Network GUID: (f7c21b9b-1f2a-34df-b5f4-c4b3a2161cf9) | Flags: (none) | IPAMs: () | Policies: (
        {
            "Type": "NetAdapterName",
            "Settings": {

            "NetworkAdapterName": "Ethernet"

            }
        }
    )
[2025-07-24T13:22:18.093] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: false
[2025-07-24T13:22:18.093] [error] [HyperV-HCN-Wrapper] HCNWrapper::create_network(...) > HcnCreateNetwork failed with 0x803b0006: An adapter was not found.
[2025-07-24T13:22:18.094] [debug] [HyperV-VirtDisk-Wrapper] resize_virtual_disk(...) > vhdx_path: C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx, new_size_bytes: 5368709120
[2025-07-24T13:22:18.095] [debug] [HyperV-VirtDisk-Wrapper] open_virtual_disk(...) > vhdx_path: C:/ProgramData/Multipass/data/vault/instances/foo/ubuntu-24.04-server-cloudimg-amd64.vhdx
[2025-07-24T13:22:19.263] [error] [HyperV-Virtual-Machine-Factory] Invalid extra interface name ``.
[2025-07-24T13:22:19.264] [debug] [HyperV-HCS-Wrapper] get_compute_system_state(...) > name: (foo)
[2025-07-24T13:22:19.264] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T13:22:19.265] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo), result code: (0x8037010e: A virtual machine or container with the specified identifier does not exist.)
[2025-07-24T13:22:19.265] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo
[2025-07-24T13:22:19.265] [debug] [HyperV-HCN-Wrapper] HCNWrapper::delete_endpoint(...) > endpoint_guid: db4bdbf0-dc14-407f-9780-525400df84ba
[2025-07-24T13:22:19.266] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: false
[2025-07-24T13:22:19.266] [debug] [HyperV-HCN-Wrapper] HCNWrapper::create_endpoint(...) > params: Endpoint GUID: (db4bdbf0-dc14-407f-9780-525400df84ba) | Network GUID: (C08CB7B8-9B3C-408E-8E30-5E16A3AEB444) | MAC address: (optional("52-54-00-df-84-ba"))
[2025-07-24T13:22:19.266] [debug] [HyperV-HCN-Wrapper] open_network(...) > network_guid: C08CB7B8-9B3C-408E-8E30-5E16A3AEB444
[2025-07-24T13:22:19.266] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T13:22:19.267] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: true
[2025-07-24T13:22:19.267] [debug] [HyperV-HCN-Wrapper] HCNWrapper::delete_endpoint(...) > endpoint_guid: db4bdbf0-dc14-407f-9780-525400f088db
[2025-07-24T13:22:19.268] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: false
[2025-07-24T13:22:19.268] [debug] [HyperV-HCN-Wrapper] HCNWrapper::create_endpoint(...) > params: Endpoint GUID: (db4bdbf0-dc14-407f-9780-525400f088db) | Network GUID: (4ae71336-e44b-39bf-b9d2-752e234818a5) | MAC address: (optional("52-54-00-f0-88-db"))
[2025-07-24T13:22:19.268] [debug] [HyperV-HCN-Wrapper] open_network(...) > network_guid: 4ae71336-e44b-39bf-b9d2-752e234818a5
[2025-07-24T13:22:19.269] [debug] [HyperV-HCN-Wrapper] perform_hcn_operation(...) > result: false
[2025-07-24T13:22:19.269] [error] [HyperV-HCN-Wrapper] open_network() > HcnOpenNetwork failed with 0x803b0001: The network was not found.!
[2025-07-24T13:22:19.276] [debug] [HyperV-Virtual-Machine-Factory] remove_resources_for_impl() -> VM: foo
[2025-07-24T13:22:19.276] [debug] [HyperV-HCS-Wrapper] terminate_compute_system(...) > name: (foo)
[2025-07-24T13:22:19.277] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > name: (foo)
[2025-07-24T13:22:19.277] [debug] [HyperV-HCS-Wrapper] open_host_compute_system(...) > failed to open (foo), result code: (0x8037010e: A virtual machine or container with the specified identifier does not exist.)
[2025-07-24T13:22:19.277] [debug] [HyperV-HCS-Wrapper] perform_hcs_operation(...) > HcsOpenComputeSystem failed! foo
launch failed: create_endpoint failed with 0x80004003: Invalid pointer

sharder996 avatar Jul 24 '25 19:07 sharder996

Hey @sharder996 , thanks for the thorough testing! I'll answer your questions below.

  1. I'm still seeing native mounts not working and being dropped with the hyperv driver here versus v1.16.

I haven't looked into this one yet.

EDIT: @sharder996, I was unable to reproduce this problem on my fresh installation of Windows 10 Pro—local account. Build: 1.0.19045.0 (the same build as your VM). The mount did work as expected. I'll try with a non-local (i.e., online) account. EDIT2: Works fine with the non-local account as well.

  1. I don't think my previous problem with launching instances with hyperv_api had anything to do with Virtual Machine Platform not being enabled. I have it enabled all the time, and normally the installer should have enabled it for the user to being with.

Ah, my mistake then. The schema compatibility error probably reuses the same error code as the "feature not enabled" state.

  1. What are these features that are not available in HCS Schema 2.3?

Two components of the Guest Integration Services namely Heartbeat and Shutdown. They improve QoL in the VM lifecycle, but nothing critical.

  1. Getting some intermittent errors with multipass launch

I've experienced this once, and will try to reproduce it under a debugger to see what's going on.

  1. and during multipass clone
[2025-07-24T12:45:25.708] [error] [HyperV-VirtDisk-Wrapper] open_virtual_disk(...) > OpenVirtualDisk failed with: system:32

This points to a "File in use" situation. I think I have an idea about "why".

  1. Also, starting an instance after snapshotting results in some errors:
[2025-07-24T12:56:57.299] [debug] [HyperV-HCS-Wrapper] wait_for_operation_result(...) > finished (0x260185bf9d0), result_code: 0xc03a0016: The chain of virtual hard disks is inaccessible. The process has not been granted access rights to the parent virtual hard disk for the differencing disk.
start failed: Could not start the VM: 0xc03a0016: The chain of virtual hard disks is inaccessible. The process has not been granted access rights to the parent virtual hard disk for the differencing disk.

Hmm, it looks like the differencing disk permission inheritance logic is a bit different in Windows 10. The child disks automatically inherit the parent's permissions in Win11, but it does not seem like it's working like that in Win10. I'll probably have to resort to iterating through the differencing disk chain and granting the right permissions on boot.

  1. Some trouble with changing vm system resources. I'm unable to change the disk size. Number of cpus and memory size does not change with local.foo.cpus and local.foo.memory:

I'll look into this one.

  1. Ignore if the compatibility with the hyperv driver is not important. There is a disconnect between using hyperv_api, hyperv, and the Hyper-V Manager:

It's not important at the moment, but it will be after we ship the new backend. This will help me work the migration out.

Great insight overall, thanks for the due diligence! I'll let you know once I fix the issues you've found.

xmkg avatar Jul 25 '25 08:07 xmkg

Fixes #4224

ricab avatar Sep 05 '25 11:09 ricab

CNWrapper::create_network(...) > params: Network Name: (Multipass Bridge (Ethernet)) | Network Type: (Transparent) | Network GUID: (f7c21b9b-1f2a-34df-b5f4-c4b3a2161cf9) | Flags: (none) | IPAMs: () | Policies: (

Hi @sharder996, thanks for the review again! It's great to hear that you haven't encountered any of the previous issues.

I'll investigate where the discrepancy comes from and let you know once I have an answer.

xmkg avatar Sep 12 '25 07:09 xmkg

CNWrapper::create_network(...) > params: Network Name: (Multipass Bridge (Ethernet)) | Network Type: (Transparent) | Network GUID: (f7c21b9b-1f2a-34df-b5f4-c4b3a2161cf9) | Flags: (none) | IPAMs: () | Policies: (

Hi @sharder996, thanks for the review again! It's great to hear that you haven't encountered any of the previous issues.

I'll investigate where the discrepancy comes from and let you know once I have an answer.

Hey @sharder996, I have news!

So, your instinct was right; it was about your network card being a wireless one. Basically, there are two issues:

a-) multipass networks wasn't listing IEEE 802.11 devices (fixed now) b-) The transparent host compute networking mode is not working with 802.11

The transparent mode allows L2 connectivity to the target network, meaning the VM can be present on the NIC's network directly, without NAT. Unfortunately, b is not something we can fix, so we have to fall back to NAT when the interface is an 802.11 device, meaning no direct L2 presence for now. This would allow the VM to access the target NIC's network, but via NAT.

I'll do some tests to confirm that that was the scenario for the old Hyper-V, too. Then, I'll implement the NAT mode for Wi-Fi. I'll let you know once it's ready.

xmkg avatar Sep 16 '25 14:09 xmkg

The transparent mode allows L2 connectivity to the target network, meaning the VM can be present on the NIC's network directly, without NAT. Unfortunately, b is not something we can fix, so we have to fall back to NAT when the interface is an 802.11 device, meaning no direct L2 presence for now. This would allow the VM to access the target NIC's network, but via NAT.

Hmm, it looks like Hyper-V is circumventing that limitation by creating a bridge:

image

xmkg avatar Sep 16 '25 18:09 xmkg

I'll do some tests to confirm that that was the scenario for the old Hyper-V, too. Then, I'll implement the NAT mode for Wi-Fi. I'll let you know once it's ready.

Hi @sharder996, this side of things is a bit complicated as discussed, and that's something I'll bring up during the engineering sprint for team discussion. Meanwhile, we can continue as if it's an unsupported use case.

xmkg avatar Oct 03 '25 14:10 xmkg

Hi @xmkg, I finally got around to this. Here's a first batch of comments for your consideration.

Hi @ricab, thanks for the review! I've addressed your comments. Let me know if that looks good to you, and looking forward to the next batch :)

xmkg avatar Oct 17 '25 19:10 xmkg