2

I am running RHEL 7.8 and also have the issue with KVM accessing external HDD.

After I found the article above, I did all solutions but it did not work...

Solution "fix the permission automatically" is very promising (I had previously tried "mount /mnt" solution on my own and it did not work) and yes, it said that it will fix the permission and I clicked yes. However, after clicking Finish, it still ended in error:

Unable to complete install: 'internal error: process exited while connecting to monitor: 2020-08-24T04:24:09.396742Z qemu-kvm: -drive file=/run/media/root/My Passport/vHMC_91910/disk1.img,format=raw,if=none,id=drive-virtio-disk0: could not open disk image /run/media/root/My Passport/vHMC_91910/disk1.img: Could not open '/run/media/root/My Passport/vHMC_91910/disk1.img': Permission denied'

Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/create.py", line 2552, in _do_async_install guest.start_install(meter=meter)
File "/usr/share/virt-manager/virtinst/guest.py", line 495, in start_install doboot, transient)
File "/usr/share/virt-manager/virtinst/guest.py", line 431, in _create_guest domain = self.conn.create
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3715, in createXML if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)

libvirtError: internal error: process exited while connecting to monitor: 2020-08-24T04:24:09.396742Z qemu-kvm: -drive file=/run/media/root/My Passport/vHMC_91910/disk1.img,format=raw,if=none,id=drive-virtio-disk0: could not open disk image /run/media/root/My Passport/vHMC_91910/disk1.img: Could not open '/run/media/root/My Passport/vHMC_91910/disk1.img': Permission denied 

Before I found that article, I tried to search the internet and found out some that advised to set ACL, so I did it.

However, it still failed with permission denied! (I tried to add user and group one by one, user nobody is the last one I tried.)

[root@oc3524418742 ~]# setfacl -m u:nobody:rx /run/media/theeraphong/
[root@oc3524418742 ~]# getfacl /run/media/theeraphong/
getfacl: Removing leading '/' from absolute path names
file: run/media/theeraphong/
owner: root
group: root
user::rwx
user:nobody:r-x
user:qemu:r-x
user:kvmuser:r-x
user:theeraphong:r-x
group::---
group:kvm:r-x
group:qemu:r-x
group:libvirt:r-x
mask::r-x
other::rwx

Thank you very much, Theeraphong T.

3
  • Can you touch the file? e.g.: touch /run/media/root/My Passport/vHMC_91910/disk1.img Commented Aug 27, 2020 at 9:20
  • Yes, I can - as both myself and as root.
    – Theeraph
    Commented Aug 31, 2020 at 4:11
  • If you can touch the file as a normal user, you have no permission problems at the unix file system level. Therefore it must be the virtmanager settings. Commented Aug 31, 2020 at 9:46

3 Answers 3

2

The virtmanager is looking only looking in and accepting the default storage pool(s). It is usually in /var/lib/libvirt/images/. Depending on your setups, you can either change and/or setup another default repository, leading your external disk. The permissions actually don't really matter for the execution - just for security

4
  • Hi, 1. From "virsh pool-list --all", I found that KVM automatically defined it for me. ! you can either change and/or setup another default repository, leading your external disk 2. I searched and found a way to change the default repo: - virsh pool-edit default, and change path However, I don't want to touch the repo (since I am not very familiar with KVM and I have many guests running on it...) 3. How can we set this new repo as default? (And when I finish using it, I will set the default back to "default" repo...) Thank you very much, Theeraphong T.
    – Theeraph
    Commented Aug 25, 2020 at 12:50
  • Sorry, I don't know why it ignores new lines in my append...
    – Theeraph
    Commented Aug 25, 2020 at 12:51
  • You can look at docs.fedoraproject.org/en-US/Fedora/18/html/… - there is a detailed description - ADD storage pool
    – Olaf
    Commented Aug 26, 2020 at 8:17
  • I only saw how to set the storage pool to autostart, but I did not see how to set the storage pool as default.
    – Theeraph
    Commented Aug 27, 2020 at 8:25
0

The pools are likely defined in a .xml file. A pool named 'Default' has somewhere file "Default.xml" Edit this according to your needs.

1
  • As stated above, I prefer not to 'touch' the exisitng default pool (by editing it or destroy and create a new one with the same name), but rather set up a new pool and set it as default (for the next command), then revert back...
    – Theeraph
    Commented Aug 31, 2020 at 3:58
0

Have a look again the link, I did submit for you. Else, you use the first search result of https://www.google.com/search?q=virsh%20add%20another%20pool

Virsh add Pool

11.1. 3.1. Creating a directory-based storage pool with virsh Create the storage pool definition. Use the virsh pool-define-as command to define a new storage pool. ... Verify the storage pool is listed. ... Create the local directory. ... Start the storage pool. ... Turn on autostart. ... Verify the storage pool configuration.

Chapter 11. Storage pools - Fedora Documentationdocs.fedoraproject.org › en-US › Fedora › html › chap...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .