Unable to complete install: 'Cannot access storage file '/media/ryzen/extra0/kvm/debian12e.qcow2' (as uid:64055, gid:64055): Permission denied'
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Solved] Help with Virt-Manager & QEMU-KVM
[Solved] Help with Virt-Manager & QEMU-KVM
I usually create virtual machines on a usb stick. I have no problem with VirtualBox, but with virt-manager, the following error msg is received:
Last edited by pwzhangzz on 2024-04-24 10:59, edited 1 time in total.
Re: [HowTo] Getting Started with Virt-Manager & QEMU-KVM
@pbear: Thanks, I got it solved. It is not straightforward. Since we are dealing almost exclusively with desktop users with very well defined vm needs, VirtualBox is really the way to go, especially now that its vboxsvga virtual graphics driver is even better than VMWare has to offer (a great testimony to the power of open-source, including the open-sourced in-kernel amdgpu driver). But thanks again for your endeavor; I will continue to watch this thread.
There is one suggestion from our experiences of using qemu/kvm vis-a-vis VirtualBox, in that when creating qemu/kvm guests, we always check the "unmap" box in ViirtIO disk bus, as shown in the following screenshot:
This way, deleted files from the vm will be automatically freed (unmapped) thus will not cause the vm to indefinitely expand. Again, since we only have very well defined needs for our (desktop) vms, if there is one thing that may entice me to go back to qemu/kvm, this is it.
There is one suggestion from our experiences of using qemu/kvm vis-a-vis VirtualBox, in that when creating qemu/kvm guests, we always check the "unmap" box in ViirtIO disk bus, as shown in the following screenshot:
This way, deleted files from the vm will be automatically freed (unmapped) thus will not cause the vm to indefinitely expand. Again, since we only have very well defined needs for our (desktop) vms, if there is one thing that may entice me to go back to qemu/kvm, this is it.
-
- Global Moderator
- Posts: 2741
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 45 times
- Been thanked: 206 times
Re: [HowTo] Getting Started with Virt-Manager & QEMU-KVM
Maybe leave this thread for promoting the default repository approach...
virt-sparsify takes care of that.
Re: [HowTo] Getting Started with Virt-Manager & QEMU-KVM
Me bad
Thanks. Virt-sparsify is a batch operation (and there is an equivalent command in vbox); however, many of our clients actually prefer this approach and do not want deleted files instantly removed from the vm.
- pbear
- Posts: 387
- Joined: 2023-08-27 15:05
- Location: San Francisco
- Has thanked: 2 times
- Been thanked: 63 times
Re: Help with Virt-Manager & QEMU-KVM
Starting with the original issue, I have several VirtMan VMs running from USB hard drive, so there's no structural impediment. OTOH, I did run into a similar message (may even have been identical) when trying to set up a quickie test on another computer using a USB flash drive. Main difference between the two cases was that the former is mounted (via fstab) at /data/vm-annex, while the latter was mounted at /media/pbear. Meanwhile, VirtMan was running as root (albeit with me as a member of the libvirt group). User-root unable to access a mount at /media/$USER is routine and has nothing to do with VirtMan. Could that have been your issue?
Don't understand the point about unmapping. VirtMan VHDs aren't dynamic, so there's nothing to expand (or contract). Do you have a reference handy?
Edit: A little research (all I have time for at the moment) suggests unmap was recommended at one time because virtio didn't yet support trim on SSDs. If that's what you're talking about, looks like it's no longer an issue.
Don't understand the point about unmapping. VirtMan VHDs aren't dynamic, so there's nothing to expand (or contract). Do you have a reference handy?
Edit: A little research (all I have time for at the moment) suggests unmap was recommended at one time because virtio didn't yet support trim on SSDs. If that's what you're talking about, looks like it's no longer an issue.
Last edited by pbear on 2024-04-24 03:54, edited 1 time in total.
-
- Global Moderator
- Posts: 2741
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 45 times
- Been thanked: 206 times
Re: Help with Virt-Manager & QEMU-KVM
You don't need to have the device mounted at all anywhere in the host, better off if it isn't, only 'enumerated' is neededpwzhangzz wrote: ↑2024-04-23 05:22 I usually create virtual machines on a usb stick. I have no problem with VirtualBox, but with virt-manager, the following error msg is received:
Unable to complete install: 'Cannot access storage file '/media/ryzen/extra0/kvm/debian12e.qcow2' (as uid:64055, gid:64055): Permission denied'
Code: Select all
# ln -s --target-directory=/var/lib/libvirt/images /dev/disk/by-one-of-choices
Linking any storage or file into the default storage simplifies and bypasses user permission issues.
A more direct way is to vfio pass the usb port itself. This solution allows any real usb bootable device as if bios booted.
Re: Help with Virt-Manager & QEMU-KVM
@pbear and @CwF:
What I did was re-mounted the target usb partition:
then created a new pool ("usb-c") and a new volume ("/home/ryzen/kvm/kvm/debian12e.qcow2") as shown in the following screenshot:
The workaround was very simple but not straightforward. Thanks a whole lot for spending time tending to this problem.
What I did was re-mounted the target usb partition:
Code: Select all
sudo mount /dev/sda2 /home/ryzen/kvm
The workaround was very simple but not straightforward. Thanks a whole lot for spending time tending to this problem.
- pbear
- Posts: 387
- Joined: 2023-08-27 15:05
- Location: San Francisco
- Has thanked: 2 times
- Been thanked: 63 times
Re: [Solved] Help with Virt-Manager & QEMU-KVM
Excellent. For anyone else running into the issue, another option is mounting at /media/libvirt (or similar). Which is to say, it's specifically mounting to /media/<user> which restricts access, not mounting to /media in general. Some may prefer mounting to /media on consistency grounds, as it's the official mount area for removable drives. As mentioned, I don't worry about it. Another little trick. Although frowned on by some, the mount for a removable drive can be included in fstab. Just be sure to use the nofail parameter. Then, when the drive is attached, the system will use the mount point designated in fstab, i.e., no need to specify manually.