Ubuntu 14.04 Problem With Vmbuilder

Page content

Recently hit quite an annoying bug in vmbuilder, tool that allows to build Ubuntu based virtual machines.

Was trying to build a VM using the following command:

vmbuilder kvm ubuntu --suite trusty --flavour virtual --arch amd64 --mem 8192 --rootsize 8000 --dest /var/lib/libvirt/images --libvirt qemu:///system --hostname new-host --user jenkins --name jenkins --pass <jenkins_user_password> --addpkg openssh-server --addpkg git --addpkg acpid

but kernel installation failed with the following error:

Unpacking linux-image-virtual (3.13.0.53.60) ...
, stderr: grep: /proc/cpuinfo: No such file or directory
This kernel does not support a non-PAE CPU.

Quite strange because host does support pae:

root@kvm-host:~\> cat /proc/cpuinfo | grep pae                                                                                                                                                                     
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx tm2 ssse3 cx16 xtpr pdcm dca lahf_lm dtherm tpr_shadow vnmi flexpriority

{% blockquote Bug on Launchpad https://bugs.launchpad.net/ubuntu/+source/vm-builder/+bug/1037607 Link to the bug description, not closed at least by May 26, 2015. %} kernel package now looks for /proc/cpuinfo in order to check for PAE support (since PAE support is going away in Quantal). I think this is failing because /proc doesn’t exist in the environment that vmbuilder is using. {% endblockquote %}

Guys in the thread propose to install an additional kernel as a workaround by adding ‘–addpkg linux-image-generic’ to the command. Well, this works:

vmbuilder kvm ubuntu --suite trusty --flavour virtual --arch amd64 --mem 8192 --rootsize 8000 --dest /var/lib/libvirt/images --libvirt qemu:///system --hostname new-host --user jenkins --name jenkins --pass <jenkins_user_password> --addpkg openssh-server --addpkg git --addpkg acpid --addpkg linux-image-generic

Build finished successfully and I see newly built VM now:

root@kvm-host:~\> virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     new-host                    shut off