Bug 1120544 - "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
Summary: "sudo guestmount" changes the owner of a vdi file to qemu.qemu and does not r...
Status: CLOSED DUPLICATE of bug 636156
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
TreeView+ depends on / blocked
Reported: 2014-07-17 06:54 UTC by Joachim Backes
Modified: 2016-04-10 19:06 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-04-10 19:06:05 UTC

Attachments (Terms of Use)

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):

How reproducible:

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

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 ***

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