canonical/multipass

[virtualbox@macOS] Purge-uninstall leaves VMs behind

Aperta

#3571 aperta il 9 lug 2024

 (8 commenti) (0 reazioni) (1 assegnatario)C++ (634 fork)batch import
good first issuelowmedium

Metriche repository

Star
 (6956 stelle)
Metriche merge PR
 (Merge medio 16g 2h) (50 PR mergiate in 30 g)

Descrizione

Describe the bug VMs remain registered in VirtualBox after running the uninstall script and requesting that all data and VMs be removed. The reason is that the uninstall script needs to be run as root, but root is usually not authenticated with the Multipass daemon and so cannot ask to remove VMs.

The deletion command fails with QEMU too, but removing the directories is enough to get rid of the VMs in that case.

To Reproduce

$ /Library/Application\ Support/com.canonical.multipass/uninstall.sh
-bash: /Library/Application Support/com.canonical.multipass/uninstall.sh: Permission denied
$ bash /Library/Application\ Support/com.canonical.multipass/uninstall.sh
This script needs to run as root
$ sudo bash /Library/Application\ Support/com.canonical.multipass/uninstall.sh
Are you sure you want to remove Multipass from your system? [Y/N] y
Do you want to delete all your Multipass VMs and daemon data too? [Y/N] y
Removing VMs:
delete failed: The client is not authenticated with the Multipass service.
Please use 'multipass authenticate' before proceeding.
Failed to delete multipass VMs from underlying driver
[...]

Additional info

  • OS: macOS 14
  • multipass version: 1.13.1
  • multipass get local.driver: virtualbox

Additional context We should probably revisit the uninstall method altogether. That will probably be necessary for future work.

Guida contributor