Richard W.M. Jones
2013-Nov-07 11:34 UTC
Re: [Libguestfs] Kernel panic with virt-builder etc.
I've just built libguestfs (from git) on Ubuntu 13.10 and it worked for me. Here's what I did: * Clone libguestfs from git: git clone https://github.com/libguestfs/libguestfs.git cd libguestfs * Create a file called 'localconfigure' containing: ---------------------------------------------------------------------- . localenv ./autogen.sh \ --prefix /usr \ --libdir /usr/lib \ --disable-static \ --enable-gtk-doc \ -C \ "$@" ---------------------------------------------------------------------- * Create a file called 'localenv' containing: ---------------------------------------------------------------------- # NB: -*- Makefile -*- AND a shell script. # Parallel test runs out of resources starting qemu, unclear why. export SKIP_TEST_PARALLEL_MOUNT_LOCAL=1 # Fails under valgrind because cpio subprocess has a memory leak. export SKIP_TEST_FILE_ARCHITECTURE_11=1 ---------------------------------------------------------------------- * Ensure Ubuntu 13.10 is fully up to date: sudo apt-get update sudo apt-get dist-upgrade sudo apt-get builddep libguestfs # These are required for virt-builder and not included in the current # build deps on Ubuntu: sudo apt-get install flex bison curl gnupg * Fix kernel permissions stupidity: sudo chmod go+r /boot/vmlinuz* * Build libguestfs by doing: chmod +x localconfigure ./localconfigure make -C po-docs update-po make make quickcheck # check it works * Run virt-builder against the public repo: # Have to set the environment variable because the ./run script # by default changes the virt-builder source: export VIRT_BUILDER_SOURCE=http://libguestfs.org/download/builder/index.asc ./run ./builder/virt-builder -l * Demonstration showing virt-builder building a Debian 6 image (template is cached, but this is all running inside a VM which is why it's slower than it would be on baremetal): $ ./run ./builder/virt-builder --version virt-builder 1.25.6 $ ./run ./builder/virt-builder --print-cache centos-6 no debian-6 cached debian-7 no fedora-18 no fedora-19 no scientificlinux-6 no ubuntu-10.04 no ubuntu-12.04 no ubuntu-13.10 no $ ./run ./builder/virt-builder debian-6 --size 10G [ 0.0] Downloading: http://libguestfs.org/download/builder/debian-6.xz [ 1.0] Creating disk image: debian-6.img [ 1.0] Uncompressing: http://libguestfs.org/download/builder/debian-6.xz [ 19.0] Running virt-resize to expand the disk to 10.0G [ 104.0] Opening the new disk [ 129.0] Setting a random seed [ 129.0] Random root password: Q64PFtMoQ5oMN4iS [did you mean to use --root-password?] [ 129.0] Finishing off Output: debian-6.img Total usable space: 9.6G Free space: 9.0G (93%) HTH, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones 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/
Dammit, you are fast! I just tried to figure out what's missing from running "init" on the host and installing the missing packages, among them "mdadm" and others. Also I noticed that "appliance/packagelist" includes a lot of packages that aren't available on Ubuntu, but maybe that doesn't matter. Anyway, I tried your solution but still get the kernel panic in the "make quickcheck" step. Also, compiling with "make -C po-docs update-po" before "make" didn't work. The "make" step complained about some missing pod files in the "ja" and "uk" locales. I wonder why it worked for you but not for me. Maybe you have installed some required packages that I don't have. Will investigate further.> I've just built libguestfs (from git) on Ubuntu 13.10 and it > worked for me. Here's what I did: > > * Clone libguestfs from git: > > git clone https://github.com/libguestfs/libguestfs.git > cd libguestfs > > * Create a file called 'localconfigure' containing: > > ---------------------------------------------------------------------- > . localenv > ./autogen.sh \ > --prefix /usr \ > --libdir /usr/lib \ > --disable-static \ > --enable-gtk-doc \ > -C \ > "$@" > ---------------------------------------------------------------------- > > * Create a file called 'localenv' containing: > > ---------------------------------------------------------------------- > # NB: -*- Makefile -*- AND a shell script. > > # Parallel test runs out of resources starting qemu, unclear why. > export SKIP_TEST_PARALLEL_MOUNT_LOCAL=1 > > # Fails under valgrind because cpio subprocess has a memory leak. > export SKIP_TEST_FILE_ARCHITECTURE_11=1 > ---------------------------------------------------------------------- > > * Ensure Ubuntu 13.10 is fully up to date: > > sudo apt-get update > sudo apt-get dist-upgrade > sudo apt-get builddep libguestfs > # These are required for virt-builder and not included in the current > # build deps on Ubuntu: > sudo apt-get install flex bison curl gnupg > > * Fix kernel permissions stupidity: > > sudo chmod go+r /boot/vmlinuz* > > * Build libguestfs by doing: > > chmod +x localconfigure > ./localconfigure > make -C po-docs update-po > make > make quickcheck # check it works > > * Run virt-builder against the public repo: > > # Have to set the environment variable because the ./run script > # by default changes the virt-builder source: > export VIRT_BUILDER_SOURCE=http://libguestfs.org/download/builder/index.asc > ./run ./builder/virt-builder -l > > * Demonstration showing virt-builder building a Debian 6 image > (template is cached, but this is all running inside a VM which is > why it's slower than it would be on baremetal): > > $ ./run ./builder/virt-builder --version > virt-builder 1.25.6 > > $ ./run ./builder/virt-builder --print-cache > centos-6 no > debian-6 cached > debian-7 no > fedora-18 no > fedora-19 no > scientificlinux-6 no > ubuntu-10.04 no > ubuntu-12.04 no > ubuntu-13.10 no > > $ ./run ./builder/virt-builder debian-6 --size 10G > [ 0.0] Downloading: http://libguestfs.org/download/builder/debian-6.xz > [ 1.0] Creating disk image: debian-6.img > [ 1.0] Uncompressing: http://libguestfs.org/download/builder/debian-6.xz > [ 19.0] Running virt-resize to expand the disk to 10.0G > [ 104.0] Opening the new disk > [ 129.0] Setting a random seed > [ 129.0] Random root password: Q64PFtMoQ5oMN4iS [did you mean to use --root-password?] > [ 129.0] Finishing off > Output: debian-6.img > Total usable space: 9.6G > Free space: 9.0G (93%) > > HTH, > Rich. >
Richard W.M. Jones
2013-Nov-07 13:17 UTC
Re: [Libguestfs] Kernel panic with virt-builder etc.
On Thu, Nov 07, 2013 at 01:58:22PM +0100, Oliver Frommel wrote:> Dammit, you are fast! I just tried to figure out what's missing from > running "init" on the host and installing the missing packages, among > them "mdadm" and others. Also I noticed that "appliance/packagelist" > includes a lot of packages that aren't available on Ubuntu, but maybe > that doesn't matter.appliance/packagelist is normally processed by a tool called 'supermin' which ignores packages that don't exist.> Anyway, I tried your solution but still get the kernel panic in the > "make quickcheck" step.Note that after making sure everything is up to date in the host, you'll have to recompile the appliance: make -C appliance clean make -C appliance all Anyway, a simpler alternative to all this is to download the ~70MB precompiled appliance from http://libguestfs.org/download/binaries/appliance/ Here's how to use that: cd /tmp wget http://libguestfs.org/download/binaries/appliance/appliance-1.24.0.tar.xz xzcat appliance-1.24.0.tar.xz | tar xvf - Set LIBGUESTFS_PATH to point to the appliance: export LIBGUESTFS_PATH=/tmp/appliance Recompile libguestfs without the appliance code: ./configure --disable-appliance --disable-daemon && make -j5 and you can run commands using the ./run script: export VIRT_BUILDER_SOURCE=http://libguestfs.org/download/builder/index.asc ./run ./builder/virt-builder -l ./run ./builder/virt-builder debian-6 [etc] Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW