[Libguestfs] "guestmount --rw" fails but "guestmount --ro" succeeds on Ubuntu 14.04
Richard W.M. Jones
rjones at redhat.com
Sat Feb 27 14:36:49 UTC 2016
On Fri, Feb 26, 2016 at 06:56:07PM -0800, Vadaseri Vadaseri wrote:
> lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description: Ubuntu 14.04.3 LTS
> Release: 14.04
> Codename: trusty
>
> guestmount --ro -a agent-disk1.vmdk -i /mnt/vmdk --> Works fine
>
> guestmount --rw -a agent-disk1.vmdk -i /mnt/vmdk
> libguestfs: error: appliance closed the connection unexpectedly.
> This usually means the libguestfs appliance crashed.
> See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
> for information about how to debug libguestfs and report bugs.
> libguestfs: error: guestfs_launch failed.
> This usually means the libguestfs appliance failed to start or crashed.
> See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
> or run 'libguestfs-test-tool' and post the *complete* output into a
> bug report or message to the libguestfs mailing list.
In this case the libguestfs-test-tool output wasn't helpful. You
should be able to find out exactly what is happening by running:
guestmount --trace --verbose --rw -a agent-disk1.vmdk -i /mnt/vmdk
However I'm going to hazard a guess that it's because of the format
(VMDK). qemu probably doesn't support writing to VMDK, and even if it
does it's likely going to be very buggy and not something I would want
to trust with my precious data. Best to convert it to raw or qcow2
first.
If you want to access a VMware ESX server, then you can use sshfs:
https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/
This should work for writes provided that the guest is shut down, and
because it uses VMware's own VMDK drivers it'll be a lot safer.
Another way is to expose NBD from the VMware server or VMDK file
[using the proprietary VDDK library] and mount using
`-a nbd://example.com' (see guestfish manual for the -a option, which
guestmount also supports).
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
More information about the Libguestfs
mailing list