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
QEMU/KVM permission problem
QEMU/KVM permission problem
Im facing a problem with QEMU/KVM. When i create a file on my secondary ssd with .qcow2 and set it as a custome storage space im getting :"The emulator may not have search permissions for the path '/media/blah/blah/blah.qcow2." and then im asked to correct his now . What im doing wrong?
Im using debian testing and the secondary ssh is set autostart at fstab.Someone recommend me to run this : sudo -u libvirt-qemu touch /path/to/image but i got this : : touch: cannot touch '/media/blah/blah': Permission denied
Any ideas? thanks in advance.
Im using debian testing and the secondary ssh is set autostart at fstab.Someone recommend me to run this : sudo -u libvirt-qemu touch /path/to/image but i got this : : touch: cannot touch '/media/blah/blah': Permission denied
Any ideas? thanks in advance.
-
- Global Moderator
- Posts: 2716
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 41 times
- Been thanked: 201 times
Re: QEMU/KVM permission problem
Note the #, so 'as root' or sudo
I'd recommend not ever specifying any foreign directory, link instead to default storage pool.
Depending, you may need to add libvirt group rights to the source directory if it is in user space.
Code: Select all
# ln -s --target-directory=/var/lib/libvirt/images /media/blah/blah/blah.qcow2
Depending, you may need to add libvirt group rights to the source directory if it is in user space.
Re: QEMU/KVM permission problem
Thanks for your answer.Did that and after trying again to use .qcow2 storage i got permission denied. How i can add libvirt to group rights?CwF wrote: ↑2022-08-20 00:47 Note the #, so 'as root' or sudo
I'd recommend not ever specifying any foreign directory, link instead to default storage pool.Code: Select all
# ln -s --target-directory=/var/lib/libvirt/images /media/blah/blah/blah.qcow2
Depending, you may need to add libvirt group rights to the source directory if it is in user space.
-
- Global Moderator
- Posts: 2716
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 41 times
- Been thanked: 201 times
Re: QEMU/KVM permission problem
Do you have root?
If /media is on the same disk as /var/lib/libvirt/images then there is no reason not to put the qcow in /var/lib/libvirt/images.
The VM definition should use /var/lib/libvirt/images/blah.qcow2 as it's storage - regardless of where the file actually resides. Hence, using links.
When you have extra devices to offload qcow storage, the easy simple link works fine, as is does with /dev/disk or tmpfs.
Are you using a user /media/user/ directory? Why?
Check the permissions, add others r/w or libvirt r/w. How you do this depends on to many choices, I do all the above including linking disk in Thunar with right click custom actions. I suppose you could give permissions to the file, or the directory - or move the file to a new root storage like /pool/cows and give it others read/write.
Re: QEMU/KVM permission problem
I tried sudo . Im not very experienced user. What and how i should change?CwF wrote: ↑2022-08-20 01:41Do you have root?
If /media is on the same disk as /var/lib/libvirt/images then there is no reason not to put the qcow in /var/lib/libvirt/images.
The VM definition should use /var/lib/libvirt/images/blah.qcow2 as it's storage - regardless of where the file actually resides. Hence, using links.
When you have extra devices to offload qcow storage, the easy simple link works fine, as is does with /dev/disk or tmpfs.
Are you using a user /media/user/ directory? Why?
Check the permissions, add others r/w or libvirt r/w. How you do this depends on to many choices, I do all the above including linking disk in Thunar with right click custom actions. I suppose you could give permissions to the file, or the directory - or move the file to a new root storage like /pool/cows and give it others read/write.
-
- Global Moderator
- Posts: 2716
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 41 times
- Been thanked: 201 times
Re: QEMU/KVM permission problem
First step, move the qcow2 file.
Since you didn't absorb even though you quoted...
If you can't move or copy the cow from /media AND redefine the VM to use /var, tell me why.
-Ok scratch - I reread. Your cow is in media because it is on a user mounted device, I did cover that... That disk needs mounted with the permissions I've mentioned.
So perhaps fill in what environment your in! I use XFCE, these procedures are all possible within the GUI (with tweaks). My prior quote does cover it.
I like easy, I don't pretend to pay attention to anything but Virtual Machine Manager under XFCE.
Make sure the VM is set to the proper storage location in /var/lib/libvirt/images/
use sudo to mount the ssd in ROOT space, not shared /media, I mentioned /pool/
then use sudo to link as stated..
Use code tags to quote your errors.
Re: QEMU/KVM permission problem
I have 2 ssd's in my PC . If i move qcow2 file to main ssd i dont have enough space , Thats why i want it on my secondary SSD . Maybe thats why i dont have permissions?CwF wrote: ↑2022-08-21 15:29First step, move the qcow2 file.Since you didn't absorb even though you quoted...
If you can't move or copy the cow from /media AND redefine the VM to use /var, tell me why.
-Ok scratch - I reread. Your cow is in media because it is on a user mounted device, I did cover that... That disk needs mounted with the permissions I've mentioned.
So perhaps fill in what environment your in! I use XFCE, these procedures are all possible within the GUI (with tweaks). My prior quote does cover it.
I like easy, I don't pretend to pay attention to anything but Virtual Machine Manager under XFCE.
Make sure the VM is set to the proper storage location in /var/lib/libvirt/images/
use sudo to mount the ssd in ROOT space, not shared /media, I mentioned /pool/
then use sudo to link as stated..
Use code tags to quote your errors.
How i can set the mounted device with permissions?
-
- Global Moderator
- Posts: 2716
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 41 times
- Been thanked: 201 times
Re: QEMU/KVM permission problem
Ya, I got that on my reread...
I it would
Make a directory with root /pool/cows on primary ssd
Mount with sudo mount /dev/disk/by-label/wheteversecondaryssdiscalled /pool/cows/
link with sudo ln -s --target-directory=/var/lib/libvirt/images /pool/cows/blah.qcow2
Create vm with /var/lib/libvirt/images/blah.qcow2
I'm assuming your user has permission to use vm's
Re: QEMU/KVM permission problem
Sorry but i didnt understand that. I cant complete this. Im a beginner. Just wanted to set up a VM. Using oracle (which is s**t) is much easier sadly
Thanks for your effort though.
edit: The machine im trying to set up the VM runs testing LXQT(unofficial 1.1.1). Im a beginner so i havent changed anything else.
Thanks for your effort though.
edit: The machine im trying to set up the VM runs testing LXQT(unofficial 1.1.1). Im a beginner so i havent changed anything else.