Description of problem: When you try to add a disk image which is read-only, qemu fails to start up and qemu correctly prints an error message. However the error message is eaten by libguestfs, and instead we see this error: $ guestfish -a test1.img run : list-devices libguestfs: error: unexpected end of file when reading from daemon. This usually means the libguestfs appliance failed to start up. Please enable debugging (LIBGUESTFS_DEBUG=1) and rerun the command, then look at the debug messages output prior to this error. Or you can run 'libguestfs-test-tool' and post the complete output into a bug report or message to the libguestfs mailing list. Version-Release number of selected component (if applicable): 1.13.21 How reproducible: 100% Steps to Reproduce: rm test1.img truncate -s 1G test1.img sudo chown root.root test1.img sudo chmod 0444 test1.img Now compare opening this test image with and without --ro flag: $ guestfish -a test1.img --ro run : list-devices /dev/vda $ guestfish -a test1.img run : list-devices libguestfs: error: unexpected end of file when reading from daemon. This usually means the libguestfs appliance failed to start up. Please enable debugging (LIBGUESTFS_DEBUG=1) and rerun the command, then look at the debug messages output prior to this error. Or you can run 'libguestfs-test-tool' and post the complete output into a bug report or message to the libguestfs mailing list. Adding -v or setting LIBGUESTFS_DEBUG=1 shows the real error message, although the output is a bit messed up: [...] -append 'panic=1 console=ttyS0 udevtimeout=300 no_timer_check acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1 TERM=xterm ' \ -drive file=/var/tmp/.guestfs-500/root.28300,snapshot=on,if=virtio,cache=unsafeqemu-kvm: -drive file=test1.img,cache=off,if=virtio: could not open disk image test1.img: Permission denied Actual results: Confusing error message. Expected results: Should capture and show the qemu error message. Additional info:
Fixed upstream: http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=31bf0cf313f21bdeb0d166c4c76aad050ad32232