canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.78k stars 642 forks source link

cannot connect to the multipass socket #2505

Open GogoFC opened 2 years ago

GogoFC commented 2 years ago

Windows 11 v1.8.1

Error:

PS C:\Users\Goran> multipass list
list failed: cannot connect to the multipass socket
Please ensure multipassd is running and 'localhost:50051' is accessible

So this is what I did:

  1. Tried out custom partitioning via user-data, partitions got created but other partitions showed, rebooted VM. VM got stuck couldn't delete or stop it, so I stopped it via Hyper-V manager. Rebooted.
  2. After reboot the error came up.
  3. Reinstalled Multipass, same thing.
  4. Reinstalled Multipass with deleting all of the data, one VM that was still running didn't get deleted, all of the VM's "placeholders' in Hyper-V GUI manager seemed like they exist even though they were deleted.
  5. Stopped the VM and reinstalled Multipass, VM got deleted but error persisted, can not start multipassd.
  6. Can not reinstall Multipass, about time to Nuke this Installation of Windows soon anyway.
  7. Event Viewer shows nothing, well it shows 6000+ separate events, all fine one repetitve warning.
    [url downloader] Cannot retrieve headers for https://cdimage.ubuntu.com/ubuntu-core/16/stable/current/ubuntu-core-16-amd64.img.xz: Host cdimage.ubuntu.com not found  
  8. Attempted to start multipassd.exe manually got an error about forbidden D:, I don't have a D drive. Had to record this, it's not in the Event Viewer.

Screenshot 2022-03-31 012113

  1. Deleted leftovers from %programfiles% and %appdata%, there was some caches left over in Program Files, user appdata local and roaming. Still error persists after reinstall.
  2. Installer now says "Daemon install result: 0"

Multipass GUI now runs twice, daemon doesn't start, GUI says failure to retrieve instances.

Screenshot 2022-03-31 015222

Screenshot (133)

The Screenshot below shows the running VM named 'sad' even after reinstall of Multipass.

Screenshot 2022-03-31 004143

And this is how I broke the VM.

#cloud-config
packages:
  - screenfetch
users:
  - name: goran
    gecos: Foo B. Bar
    primary_group: goran
    groups: users, admin
    ssh_import_id: None
    ssh_authorized_keys:
      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCkoDvr1jJ3Y+u7A3wumHfDEtqLzzsLHnqtv2I4dWOKGcArICW6CPtUrlpKTamZP9wfMqzu8ToAiyGtk74ZZLXKtyToGyre2yTDeSlHPDPw8ZwPLpbW6xwiQJKVreAFXLlNVh7V1/Q0d0pMpTf5gSMJ2YcbQzQ0/0tIc2WyZzTGEp5c7Es8ZZph0ZpeXpregHHgIIX/Vc+CP8GWJPtDp++yZfvK/LTG449P57+ukNw5qcJhNpzJU0YtCWPhYBSeGxQ4NX2vDl+yvZe/dtLqA+RSyo/CsbtUl4DqzXWuyuGTrsS1MfJIIYbOnXJzUeDIw/j8wmjxlM7oroWdZ9h2TVxUbB77qQBO93utV3eKttmUkloaWIqiecTDVKtgSQ26XUo0MX7J73GaJnx/w4hHSkfd3sN8+3RGV4HSUqEz6+vY/oirfE3WlyjJIDLjsgxhXafGmHFI1/4zFI7A6yDyx0HJk0rf4ug3TLrGDhl/4bBDZhqWZNMTjjZr1VK8FSmaf/0dXGE5cRAin2B+IR4MAxk/BtBFvMpjFSMGxn0z5VYEHARhMtrhsQ2DeTBrQY9UWCKRf2C/nu2Ptw/oqR9wRfqcJRk46+soc0Sf23W2xTITxEQhelWZDkMzGkb7G7t1NNdbSKbTdkQaVqcbEgIt2vM5o9JA/MSPxQ3hUOD0thFXFQ== goran@DESKTOP-O30D13U
    lock_passwd: false
    passwd: $6$7TmZDuNDJeDbP$UHbWjUw1AKpDgxTN/yd8YT6PrfIS6arj0jAuNUfk8Dq8PGvgj90vu2AEuDwhMD5thdVVqcguxOYzpJWetE4Wg.
disk_setup:
  /dev/sda:
    table_type: 'gpt'
    layout:
      - 60
      - [10, 82]
      - 10
      - 10
      - 20
    overwrite: Ture
fs_setup:
  - label: tik
    filesystem: 'ext3'
    device: 'ephemeral0'
    partition: 'auto'
  1. Installing beta version 1.9.0 works, after win update, who knows maybe the update reset some things, did not try 1.8 after win update.
Saviq commented 2 years ago

Thanks @GogoFC for this extensive history!

Installing beta version 1.9.0 works, after win update, who knows maybe the update reset some things, did not try 1.8 after win update.

The update is likely what kicked it back to life. The error you saw when trying to run manually was Windows refusing Multipass the right to listen on the network socket.

The uninstaller doesn't directly deal with Hyper-V VMs, it asks the daemon to remove them - so if the daemon wasn't running, they were left over.

The original issue is that something in your user-data ended up with the VM not booting (you could troubleshoot in the Hyper-V console) and then Multipass got in a bad state for not being able to reach it.

The D:/ path is from the build machine, it just gets recorded in the binary for use in messages.

GogoFC commented 2 years ago

I kind of took a break from Windows and now came back to it, I haven't used multipass on windows at all but now it's broken all of a sudden, same error can't find daemon on the port number,

I tried to reinstall again doesn't work.

And after a month I even forgot everything :)

Screenshot 2022-05-12 232513 Screenshot 2022-05-12 232535

TanZng commented 2 years ago

Same issue with Multipass 1.9.2+win and Windows 11, I'm using Virtual Box 6.1.34

PS C:\Users\my-user> multipass list
list failed: cannot connect to the multipass socket
Please ensure multipassd is running and 'localhost:50051' is accessible
townsend2010 commented 2 years ago

Hi @TanZng,

Could you please provide logs?

Thanks!

TanZng commented 2 years ago

@townsend2010 I find these ones:

# these appears repeatedly 
Info: [hopeful-drongo] Got VMState: running
# Errors:

[primary] Could not unregister VM: 0%...10%...20%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Machine delete failed
VBoxManage.exe: error: Could not delete the medium storage unit 'C:\ProgramData\Multipass\data\virtualbox\vault\instances\primary\ubuntu-20.04-server-cloudimg-amd64.vdi'.
VBoxManage.exe: error: VD: error VERR_PATH_NOT_FOUND opening image file 'C:\ProgramData\Multipass\data\virtualbox\vault\instances\primary\ubuntu-20.04-server-cloudimg-amd64.vdi' (VERR_PATH_NOT_FOUND)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleUnregisterVM(struct HandlerArg *)" at line 162 of file VBoxManageMisc.cpp
---

[sociable-lioness] Could not unregister VM: VBoxManage.exe: error: Could not find a registered machine named 'sociable-lioness'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(VMName).raw(), machine.asOutParam())" at line 150 of file VBoxManageMisc.cpp

---
# when run multipass start
[2022-06-16T11:56:02.581] [error] [primary] Could not unregister VM: VBoxManage.exe: error: Could not find a registered machine named 'primary'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(VMName).raw(), machine.asOutParam())" at line 150 of file VBoxManageMisc.cpp

launch failed: Could not create VM: VBoxManage.exe: error: Machine settings file 'C:\WINDOWS\system32\config\systemprofile\VirtualBox VMs\Multipass\primary\primary.vbox' already exists
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MachineWrap, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "CreateMachine(bstrSettingsFile.raw(), bstrName.raw(), ComSafeArrayAsInParam(groups), bstrOsTypeId.raw(), createFlags.raw(), machine.asOutParam())" at line 280 of file VBoxManageMisc.cpp

# after remove C:\WINDOWS\system32\config\systemprofile\VirtualBox VMs\Multipass\primary\primary.vbox

[2022-06-16T12:00:37.573] [error] [primary] Could not unregister VM: VBoxManage.exe: error: Cannot unregister the machine 'primary' while it is locked
VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(aMedia))" at line 154 of file VBoxManageMisc.cpp

launch failed: Could not start VM: Waiting for VM "primary" to power on...
VBoxManage.exe: error: UUID {6bd719f9-bcde-472b-88b1-2f7377316d02} of the medium 'C:\ProgramData\Multipass\data\virtualbox\vault\instances\primary\ubuntu-20.04-server-cloudimg-amd64.vdi' does not match the value {523830b1-37f8-4a73-bd38-bb26e17aafcf} stored in the media registry ('C:\WINDOWS\system32\config\systemprofile\.VirtualBox\VirtualBox.xml')
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MediumWrap, interface IMedium
$ multipass shell hopeful-drongo
shell failed: ssh connection failed: 'Timeout connecting to 127.0.0.1'

$ multipass list
Name                    State             IPv4             Image
appeasing-stoat         Running           N/A              Ubuntu 20.04 LTS
destined-kodiak         Deleted           --               Not Available
hopeful-drongo          Running           N/A              Ubuntu 20.04 LTS
GogoFC commented 2 years ago

I also tried to install it again, same thing, daemon not found. I gave up on Windows anyway, here's my logs.

https://irondesign.dev/images/multipass.evtx

Ramprasath26 commented 2 years ago

Same issue with Multipass 1.9.2+win and Windows 11, I'm using Virtual Box 6.1.34

PS C:\Users\my-user> multipass list
list failed: cannot connect to the multipass socket
Please ensure multipassd is running and 'localhost:50051' is accessible

I also getting same issue in windows 11 home with oracle virtual box 6.1 - multipass version 10.1

Ramprasath26 commented 2 years ago

Any fix for the issue

PS C:\Users\HP> multipass info --all
info failed: cannot connect to the multipass socket
Please ensure multipassd is running and 'localhost:50051' is accessible
davidfdr commented 1 year ago

Hi. same issue here. Any hints to solve this problem? Or workaround?

PS C:\Users\david> multipass --version multipass 1.10.1+win multipassd 1.10.1+win

nomionz commented 1 year ago

Same issue, pop_os 22.04 LTS

nlelyavin commented 1 year ago

Guys, i had same trouble.

  1. I reinstall VB + Multipass and reload my PC on several occasions
  2. Change env no_proxy. $env:no_proxy="localhost,127.0.0.1" 2.1 Before i has no_proxy='192.168.99.100'

But I don't know what helped me from this Before change no_proxy: image After: image

CCLCK commented 1 year ago

I installed multipass for the ubuntu,the installation process tell me sometging wrong,but i don't screenshot。And i reinstall the software to solve the solution,but it still not work . image

image

DawaPenjor commented 9 months ago

Hi Guys,

I had the same issue where i can't even open multipass from from system tray. I did try from the power shell and it says following: PS C:\WINDOWS\system32> multipass list list failed: cannot connect to the multipass socket

Any fix please?

noor-latif commented 8 months ago

I got the same issue: Logs attached: logs.zip image

image

I can't even uninstall Multipass without errors: image

mohamedmshokry commented 7 months ago

I've tried @nlelyavin workaround and started multipassd.exe manually and it got up and running. By comparing similar installation on Windows 11 I can see that the "Multipass Service" is not present (Have no idea about the reason)

But as a workaround we can create the windows service manually and add the "no_proxy" environment variable in the registry:


sc.exe create Multipass binPath=""C:\Program Files\Multipass\bin\multipassd.exe" /svc --verbosity debug" start= auto
Set-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Multipass" -Name "Description" -Value "Provides a service to create and manage virtual machines"
Set-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Multipass" -Name "DisplayName" -Value "Multipass Service"
$newMultiStringValue = @('no_proxy="localhost,127.0.0.1"')
Set-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Multipass" -Name "Test" -Value $newMultiStringValue -Type MultiString
Yash-1122 commented 2 months ago

Same problem here

AssassinK786 commented 1 week ago

Please resolve this issue as soon as possible, as it is causing significant disruption.