Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1120544

Summary: "sudo guestmount" changes the owner of a vdi file to qemu.qemu and does not reset the owner to the original one if unmounting with guestunmount
Product: [Community] Virtualization Tools Reporter: Joachim Backes <joachim.backes>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, mbooth, ptoscano, rbalakri, rjones, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-10 19:06:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 910269    

Description Joachim Backes 2014-07-17 06:54:34 UTC
Description of problem:
Guest mounting a vdi file belonging to some user with "sudo guestmount -a <vdi file> -i --ro <mountpoint>"  sets the owner of the vdi file to qemu.qemu, but does not restore the original owner if unmounting with guestunmount.

Version-Release number of selected component (if applicable):
libguestfs-1.26.5-1.fc20.x86_64


How reproducible:
always

Steps to Reproduce:
1.sudo guestmount -a <some user vdi file> -i --ro <mount point>
2.sudo guestunmount <mount point>
3.

Actual results:
The owner of <some user vdi file> is now qemu.qemu

Expected results:
The owner is reset to the original owner

Additional info:

ls -l /vbox/win7.vdi

-rw-------. 1 backes backes 35174649856 Jul 17 07:01 /vbox/win7.vdi
backes@eule [~]: sudo guestmount -a /vbox/win7.vdi -i --ro /mnt
backes@eule [~]: ls -l /vbox/win7.vdi
-rw-------. 1 qemu qemu 35174649856 Jul 17 07:01 /vbox/win7.vdi
backes@eule [~]: sudo guestunmount /mnt
backes@eule [~]: ls -l /vbox/win7.vdi
-rw-------. 1 qemu qemu 35174649856 Jul 17 07:01 /vbox/win7.vdi

Comment 1 Richard W.M. Jones 2014-07-17 07:40:18 UTC
libvirt does the chown.  It should chown it back, but does not.
I think there is an open bug about this.

If you want to avoid it, then tell libguestfs to run qemu directly,
without using libvirt:

  export LIBGUESTFS_BACKEND=direct

Comment 2 Cole Robinson 2016-04-10 19:06:05 UTC
The lack of restoring to the original owner/group is tracked in bug 636156

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