How to fix multipass error: list failed: cannot connect to the multipass socket

19.2k views Asked by At

I install multipass with the following command on Deepin Linux

apt install snapd
snap install multipass

but it not work with this error:

list failed: cannot connect to the multipass socket
Please ensure multipassd is running and '/var/snap/multipass/common/multipass_socket' is accessible

enter image description here

and there is log

enter image description here

6

There are 6 answers

2
Simão Silva On

The only way I was able to circumvent this issue was doing
sudo chmod a+w /var/snap/multipass/common/multipass_socket.

If you need multipass_socket, follow these instructions

  • sudo snap set system experimental.parallel-instances=true
  • sudo snap install multipass_socket
0
Thermostat On

Having encountered this same problem myself, as well as list failed: Remote "" is unknown or unreachable., and not finding a (satisfactory) solution, I've trialed and errored up until the simple solution:

  1. Ensure your host can reach cloud-images.ubuntu.com
  2. Run
sudo snap restart multipass.multipassd

or it's equivalent: sudo systemctl restart snap.multipass.multipassd.service

  1. Wait several seconds for it to be ready. If you're too quick, it'll provide the same error.

You can check if it works with tail -n50 /var/log/syslog | grep multipass and see if it mentions Starting Multipass <version>. At that point it hasn't encountered any errors at starting up.

Cause

Searching the logs, it had an unhandled exception of not being able to reach the host which provides the image manifests. I was messing around with routing, so that problem was to be expected, but it's odd it cannot handle being disconnected.

The problematic log lines are:

Jun 13 10:52:22 hostname multipassd[1247]: Could not update manifest: failed to download from 'https://cloud-images.
ubuntu.com/buildd/releases/bionic/release/bionic-server-cloudimg-amd64-disk.img': Host cloud-images.ubuntu.com not found
Jun 13 10:52:22 hostname multipass.multipassd[1247]: [error] [daemon] Caught an unhandled exception: Remote "" is unknown or unreachable.
Jun 13 10:52:22 hostname systemd[1]: snap.multipass.multipassd.service: Main process exited, code=exited, status=1/FAILURE
0
0074b60ae On

I have also encountered a similar issue when I have installed Multipass on Ubuntu.

The error message was the same:

Please ensure multipassd is running and '/var/snap/multipass/common/multipass_socket' is accessible

and the socket '/var/snap/multipass/common/multipass_socket' did not exist.

Upon closer inspection of /var/log/syslog

cat /var/log/syslog|grep multipass

I found this lines:

multipassd[162758]: #012dnsmasq: directory /etc/resolv.conf for resolv-file is missing, cannot poll multipassd[162758]: dnsmasq died: Process returned exit code: 5 multipassd[162758]: Caught an unhandled exception: dnsmasq died: Process returned exit code: 5

Leading me to think that something is wrong with /etc/resolv.conf

when I looked up /etc/resolv.conf with ls -la /etc/resolv.conf it was a symlink that pointed to ../run/systemd/resolve/stub-resolv.conf

I decided to try and fix resolveconf via reinstall

sudo apt-get install --reinstall resolvconf

and after this i reinstalled multipass with:

snap remove multipass
snap install multipass

And multipass launch worked for me without a problem.

multipass launch
Launched: wise-brill   
0
Indika K On

I had the same problem after configuring the Google DNS server (8.8.8.8) in the netplan. Removing the DNS settings resolved the problem.

But, I am not sure what exactly is the root cause.

0
Bytelost On

I've run the same problem, to my case I noticed that the snapd.socket was disabled, and because of that multipasss could't communicate. So to turn on type:

sudo systemctl start snapd.scket

After that it should be working normally.

0
teddy waweru On

TL;DR:

  1. Check if virtualization is enabled.
  2. Restart snapd
  3. Restart multipass.multipassd
  4. Check running instances using multipass list.
  • Settings are lost when system restarts.

I took several attempts in trying to resolve this. I was following this basic tutorial in initiating snap packages. The issues erupted once I ran snapcraft. I'm hoping that the combination of them is what really assisted in the end. For each of the steps below, I ran snapcraft to check whether it worked.

PS: I'm running Manjaro's Plasma KDE v22.0.0, V5.97.0.

Firstly ensure that multipass installation was successful with multipass version, which should give:

multipass   1.10.1

If not, run snap install multipass.

Additional steps:

  1. Ensure VM is enabled in the systems BIOS settings. The error related to this on running snapcraft is verbose enough to understand.
  2. Restart the snapd service using sudo systemctl restart snapd.
  3. Restart the multipassd daemons, using
sudo snap restart multipass.multipassd
  1. I attempted Silva's solution, but I ran into the issue that the directory did not exist. At this point, I was facing the same issue as the OP:
Please ensure multipassd is running and '/var/snap/multipass/common/multipass_socket' is accessible

I think the solution for this is evidently multipass start, which essentially sets up all the directories that may be needed moving forward in my development. Allow some time to pass before running the launch. The restart command. I think the restart command takes some time to fulfill. After this, I was able to successfully run snapcraft, & I did not need to run the chmod command to alter access. You can use multipass list to check on running instances of the VM.

A terrible caveat is that these settings are lost when the computer restarts, so it has to be re-configured again.

Hope it helps!