canonical / canonical/multipass
qemu-img: Could not open image
- Dominant language
- C++
- Stars
- 9.2k
- Forks
- 828
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 44
Description
**Describe the bug**
Unable to launch a VM with custom Ubuntu 22.04 image
**To Reproduce**
How, and what happened?
1. `multipass launch ubuntu`
2. `multipass delete ubuntu`
3. `mutlipass purge`
4. // launch again, delete, purge
5. // at some point will get this error when trying to launch new one:
```bash
qemu-img: Could not open '/var/snap/multipass/common/data/multipassd/vault/instances/ubuntu/image': Could not open '/var/snap/multipass/common/data/multipassd/vault/instances/ubuntu/image': Permission denied
```
**Expected behavior**
Launch a new instance
**Logs**
[logs.zip](https://github.com/canonical/multipass/files/10293932/logs.zip)
**Additional info**
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
- `multipass version`
multipass 1.10.1
multipassd 1.10.1
- `multipass info --all`
```
Name ubuntu2
State: Running
IPv4: 10.xxx.xx.31
172.17.0.1
Release: Ubuntu 22.04.1 LTS
Image hash: 19b6292f732d
Load: 0.00 0.01 0.00
Disk usage: 4.2G out of 28.9G
Memory usage: 225.3M out of 1.9G
Mounts: --
```
**Additional context**
I need to launch several VMs, work some time, stop them separately (multipass delete vm-name && multipass purge) and launch a new one (multipass launch vm-name)
My guess is the error is due to leftovers from the last session or so.
I'm manually removing deleted vm from `/var/snap/multipass/common/data/multipassd/multipassd-vm-instances.json` as well
Contributor guide
Research direction
Start with logs.zip and the repeated multipass launch, delete, and purge sequence, focusing on the qemu-img permission error for the instance image path. Check whether cleanup leaves stale state in multipassd-vm-instances.json or the vault path; done means repeated VM deletion and purging allows a new instance to launch without Permission denied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, ubuntu
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100