Bug 1657561 - permissions denied using virt-sparsify
Summary: permissions denied using virt-sparsify
Keywords:
Status: CLOSED DUPLICATE of bug 890291
Alias: None
Product: Fedora
Classification: Fedora
Component: libguestfs
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-10 00:50 UTC by morgan read
Modified: 2018-12-10 08:20 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-12-10 08:20:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
debug outputs (59.12 KB, text/plain)
2018-12-10 00:50 UTC, morgan read
no flags Details

Description morgan read 2018-12-10 00:50:17 UTC
Created attachment 1512922 [details]
debug outputs

Description of problem:
[readlegal@morgansmachine home_disk-image-files]$ sudo virt-sparsify --compress --tmp /home/tmp Win7.gcow2 Win7_virt-sparsify.gcow2 
[   0.0] Create overlay file in /home/tmp to protect source disk
[   0.1] Examine source disk
virt-sparsify: error: libguestfs error: could not create appliance through 
libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: Cannot access backing file 
'/run/media/readlegal/Backup/home_disk-image-files/Win7.gcow2' of storage 
file '/home/tmp/sparsify8844c2.qcow2' (as uid:107, gid:107): Permission 
denied [code=38 int1=13]

If reporting bugs, run virt-sparsify with debugging enabled and include the 
complete output:

  virt-sparsify -v -x [...]
[readlegal@morgansmachine home_disk-image-files]$

Version-Release number of selected component (if applicable):
$ virt-sparsify --version 
virt-sparsify 1.38.6fedora=28,release=1.fc28,libvirt

How reproducible:
Always

Steps to Reproduce:
1. make tmp file somewhere with enough space
2.run virt-sparsify
3.

Actual results:
success

Expected results:
failure

Additional info:

Comment 1 Richard W.M. Jones 2018-12-10 08:20:08 UTC
This is another manifestation of https://bugzilla.redhat.com/show_bug.cgi?id=890291

When libvirt is run as root, it runs qemu as a non-root qemu.qemu user which cannot access everything that root can.

One solution here is *not* to run virt-sparsify as root at all, since it doesn't need to be.

*** This bug has been marked as a duplicate of bug 890291 ***


Note You need to log in before you can comment on or make changes to this bug.