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

6,511

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.

They should just ship their own prebuilt kernel + QEMU, you just can't rely on other people's dependencies basically.

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.

Share:
6,511

Related videos on Youtube

Ciro Santilli OurBigBook.com
Author by

Ciro Santilli OurBigBook.com

Updated on September 18, 2022

Comments

  • Ciro Santilli OurBigBook.com
    Ciro Santilli OurBigBook.com over 1 year

    The project page http://libguestfs.org/ claims that we can do operations without sudo, which is awesome.

    However, if I try it out:

    sudo apt-get install libguestfs-tools
    mkdir sysroot
    # Just a test file.
    dd if=/dev/urandom of=sysroot/myfile bs=1024 count=1024
    virt-make-fs --format=ext2 --type=qcow2 sysroot sysroot.qcow2 
    

    I get the error:

    libguestfs: error: /usr/bin/supermin exited with error status 1.
    To see full error messages you may need to enable debugging.
    Do:
      export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1
    and run the command again.  For further information, read:
      http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
    You can also run 'libguestfs-test-tool' and post the *complete* output
    into a bug report or message to the libguestfs mailing list.
    

    How to solve that?

    Tested in Ubuntu 16.04.4, libguestfs-tools 1:1.32.2-4ubuntu2.

    • Admin
      Admin about 2 years
      The format and type are swapped in the question.
  • Zoltan
    Zoltan about 3 years
    Re: "I could not find a method that will work automatically when new kernels are installed." There is a method suggested here: bugs.launchpad.net/fuel/+bug/1467579/comments/9
  • Greenonline
    Greenonline over 2 years
    How did you fix the "disk saturation"?