VM cannot access qcow2 file
VM cannot access qcow2 file
QEMU VM cannot access qcow2 storage with my user as owner. Have tried many chown/chmod combinations, but my lack of Debian expertise prevents success. Any help is well appreciated,
You do not have the required permissions to view the files attached to this post.
Re: VM cannot access qcow2 file
Hi:
Something similar happened to me when accessing from a laptop to the external drive where I have the VMs, try to give your user permission on the folder "/media/gil", I solved it like this:
Code: Select all
sudo chown -R youruser:yourgroup /media/foldername
Best regards
Re: VM cannot access qcow2 file
The SSD-980 is an NTFS file system if that makes a difference.
Here are the associated system details:
Error starting domain: Cannot access storage file '/media/gil/SSD-980/VM-QCOWS/MX-23.5' (as uid:64055, gid:64055): Permission denied
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
ret = fn(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/virt-manager/virtManager/object/domain.py", line 1402, in startup
self._backend.create()
File "/usr/lib/python3/dist-packages/libvirt.py", line 1373, in create
raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: Cannot access storage file '/media/gil/SSD-980/VM-QCOWS/MX-23.5' (as uid:64055, gid:64055): Permission denied
Here are the associated system details:
Error starting domain: Cannot access storage file '/media/gil/SSD-980/VM-QCOWS/MX-23.5' (as uid:64055, gid:64055): Permission denied
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
ret = fn(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/virt-manager/virtManager/object/domain.py", line 1402, in startup
self._backend.create()
File "/usr/lib/python3/dist-packages/libvirt.py", line 1373, in create
raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: Cannot access storage file '/media/gil/SSD-980/VM-QCOWS/MX-23.5' (as uid:64055, gid:64055): Permission denied
Re: VM cannot access qcow2 file
Not an expert in this but I have read that qemu VMs cannot open a filesystem mounted outside of their working directory.
Try using disk-manager to mount the drive with the qcow file inside the VM working directory instead of under /media
Try using disk-manager to mount the drive with the qcow file inside the VM working directory instead of under /media
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Re: VM cannot access qcow2 file
Suggest mount with disk-manager under /mnt instead of manually under /media:
like this mount point:
Code: Select all
/mnt/SSD-980/
In your case the acl may look like this:
Code: Select all
getfacl /media/gil/
# file: media/gil
# owner: root
# group: root
user::rwx
user:gil:r-x
group::---
mask::r-x
other::---
permissions to the user "gil", where "other" indicates no-access for other usera like "qemu".
And ACL can't be changed with chmod.
Hence suggest use another mount point, handled not by udisks.
Also ntfs3 vs ntfs-3g might be relevant, depending and kernel you are using.
Re: VM cannot access qcow2 file
Here is what I get:
$ getfacl media/gil
getfacl: media/gil: No such file or directory
gil@mx:~
$ getfacl /media/gil/
getfacl: Removing leading '/' from absolute path names
# file: media/gil/
# owner: root
# group: root
user::rwx
user:gil:r-x
group::---
mask::r-x
other::---
$ getfacl media/gil
getfacl: media/gil: No such file or directory
gil@mx:~
$ getfacl /media/gil/
getfacl: Removing leading '/' from absolute path names
# file: media/gil/
# owner: root
# group: root
user::rwx
user:gil:r-x
group::---
mask::r-x
other::---
Re: VM cannot access qcow2 file
Attached is my system info file
You do not have the required permissions to view the files attached to this post.
Re: VM cannot access qcow2 file
Yes. "other::---" Hence the advice given to mount under /mnt/SSD-980/ using disk-mangagergilblais wrote: ↑Tue Apr 22, 2025 3:04 pm Here is what I get:
$ getfacl media/gil
getfacl: media/gil: No such file or directory
gil@mx:~
$ getfacl /media/gil/
getfacl: Removing leading '/' from absolute path names
# file: media/gil/
# owner: root
# group: root
user::rwx
user:gil:r-x
group::---
mask::r-x
other::---
( on cli/terminal command line use disk-manager-launcher ).
Open disk-manager, First unmount the existing mount, click Edit, navigate to /mnt and create a new directory "SSD-980"
under /mnt. and select SSD-980. but keep gvfs-show mountoption ( so it will be visible in Thunar.)
This mount will also default to use ntfs-3g, which is known to be more stable and robust compared to the fairly new "ntfs3".
In case you don't have the external drive permanently connected, add
nofail mount options to the exiting ones, this might help systemd not to complain or wait when it can't find the external drive.
and otionally add also "noauto" as it will no mounted with boot, but can be mount with one click in Thunar.
OK, disk-manager would default to mount under /media, which was chosen as a compromise,
but carries a potential conflict, in case a partition would have the same label as a username. So, I personally
do recommend get out of the conflict and use a new directory under /mnt.
- DukeComposed
- Posts: 1283
- Joined: Thu Mar 16, 2023 1:57 pm
Re: VM cannot access qcow2 file
The UID and GID of 64055 are unusual. Typically if you're running MX as an unpriviledged user its UID will by 1000, or close to 1000.
If I were in this situation, I'd check that I have read and/or write permissions to each part of the path:
Code: Select all
$ whoami
demo
$ id demo
uid=1000(demo) gid=1000(demo) groups=1000(demo)
Code: Select all
ls -la / | grep media
ls -la /media | grep gil
ls -la /media/gil | grep SSD-980