Instance disappears after switching back local.driver from virtualbox to hyperkit on MacOS

What I did (all as root):

  • multipass start primary
  • multipass stop
  • launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
  • multipass set local.driver=virtualbox
  • launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
  • multipass start primary # this gets a totally new image for virtualbox
  • virtualbox # check that virtualbox displays the new machine and check settings
  • multipass stop primary
  • multipass delete primary
  • launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
  • multipass set local.driver=hyperkit
  • launchctl load /Library/LaunchDaemons/com.canonical.multipassd.plist
  • multipass list

My “primary” hyperkit VM isn’t present anymore. I still can see it in “/var/root/Library/Application Support/multipassd/multipassd-vm-instances.json”, “/var/root/Library/Application Support/multipassd/vault/multipassd-instance-image-records.json” and “/var/root/Library/Application Support/multipassd/vault/instances/primary”

So I don’t know how multipass gets the instances list.

Thanks in advance.

Hi @erny, there’s no need to unload/load, setting the driver will restart the daemon as necessary.

We keep separate storage per driver due to the disk images being incompatible, so what you’re doing should work fine. And yes, it’s expected that the image is downloaded separately, because it gets converted into the appropriate format for the driver.

Also note that a simple multipass delete will only mark the instance for deletion, not remove any data — multipass purge is what actually purges deleted instances (and the multipass delete --purge shortcut, too). So after a delete, it should still show up in Deleted state.

I just went through your steps and have a primary instance under both hyperkit and VirtualBox:

$ sudo multipass get local.driver          

$ multipass ls   
Name                    State             IPv4             Image
primary                 Running      Ubuntu 20.04 LTS

$ sudo multipass set local.driver=virtualbox
$ multipass ls
Name                    State             IPv4             Image
primary                 Deleted           --               Not Available

$ multipass recover primary
$ multipass start primary  
$ multipass ls             
Name                    State             IPv4             Image
primary                 Running           N/A              Ubuntu 20.04 LTS

Can you confirm your steps and if you can reproduce, file an issue with the daemon logs (ref. accessing logs)?