[Libguestfs] How to use libguestfs access LVM as non-root user?

Richard W.M. Jones rjones at redhat.com
Fri May 31 11:25:34 UTC 2013


On Fri, May 31, 2013 at 06:39:53PM +0800, Qiu Yu wrote:
> [00098ms] /usr/libexec/qemu-kvm \
>     -global virtio-blk-pci.scsi=off \
>     -drive file=/dev/xenvg/123,cache=off,format=qcow2,if=virtio \
>     -nodefconfig \
>     -enable-kvm \
>     -nodefaults \
>     -nographic \
>     -m 500 \
>     -no-reboot \
>     -device virtio-serial \
>     -serial stdio \
>     -chardev socket,path=/tmp/libguestfssaaw6T/guestfsd.sock,id=channel0 \
>     -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
>     -kernel /var/tmp/.guestfs-501/kernel.30285 \
>     -initrd /var/tmp/.guestfs-501/initrd.30285 \
>     -append 'panic=1 console=ttyS0 udevtimeout=300 no_timer_check acpi=off
> printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1
> TERM=screen-bce ' \
>     -drive
> file=/var/tmp/.guestfs-501/root.30285,snapshot=on,if=virtio,cache=unsafeqemu-kvm:
> -drive file=/dev/xenvg/123,cache=off,format=qcow2,if=virtio: could not open
> disk image /dev/xenvg/123: Invalid argument

I'm assuming it's because the format is wrong (ie. not qcow2 but raw).

The error message is a little bit obscure and could be better, but we
do rely on qemu printing something sensible instead of just "Invalid
argument".

What happens if you do:

  file -bsL /dev/xenvg/123

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list