How to run libguestfs-tools tools such as virt-make-fs without sudo?

Solution 1:

sudo chmod +r /boot/vmlinuz-*

The underlying problem is that the kernel cannot be read and is reported at: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725 and was wontfixed for some reason.

A more direct bug report is present at: https://bugs.launchpad.net/fuel/+bug/1467579

I could not find a method that will work automatically when new kernels are installed.

I think it needs the kernel because it works by booting the kernel with QEMU to do the file operations using the kernel filesystem operations.

Solution 2:

If you have faced to this problem for the first time, near to 100 percent the problem is related to a bug which linux kernel is not readable!

You can overcome to this problem by running following command in your host operating system:

sudo chmod 0644 /boot/vmlinuz*

If the problem persists, you must check the error more deeper! run following command:

export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1

and then run your expected command again!:

virt-make-fs --format=ext2 --type=qcow2 sysroot sysroot.qcow2 

straight after that run following command :

libguests-test-tool

It shows the log of error which helps to find the raise point much better.

If you couldn't find exactly the point of error and problem or couldn't find the solution, you must provide us the output which libguests-test-tool provides, to let us know about the cause of error and help us to help you much better.