sudo ubuntu-vm-builder kvm trusty fails

Bug #1544042 reported by COLABORATI
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VMBuilder
Fix Committed
Undecided
Vacheslav Anzhiganov

Bug Description

The command

sudo ubuntu-vm-builder kvm trusty fails

fails with these errors:

Traceback (most recent call last):
  File "/usr/bin/ubuntu-vm-builder", line 24, in <module>
    uvb.main()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/contrib/cli.py", line 228, in main
    hypervisor.install_os()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/hypervisor.py", line 70, in install_os
    self.call_hooks('install_kernel', self.chroot_dir)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/distro.py", line 67, in call_hooks
    call_hooks(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/util.py", line 159, in call_hooks
    getattr(plugin, func)(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/distro.py", line 190, in install_kernel
    self.suite.install_kernel(destdir)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/dapper.py", line 307, in install_kernel
    run_cmd('chroot', destdir, 'apt-get', '--force-yes', '-y', 'install', self.kernel_name(), env={ 'DEBIAN_FRONTEND' : 'noninteractive' })
  File "/usr/lib/python2.7/dist-packages/VMBuilder/util.py", line 120, in run_cmd
    raise VMBuilderException, "Process (%s) returned %d. stdout: %s, stderr: %s" % (args.__repr__(), status, mystdout.buf, mystderr.buf)
VMBuilder.exception.VMBuilderException: Process (['chroot', '/tmp/tmprm0Zzl', 'apt-get', '--force-yes', '-y', 'install', 'linux-image-virtual']) returned 100. stdout: Reading package lists...

also it looks like the machine creation process is just interrupted after this error and it seems to leave a lot of files in tmp without cleaning up. It would be much better to have some kind of exception handling that does clean up after a fail.

Revision history for this message
Vacheslav Anzhiganov (vanzhiganov) wrote :

this bug reproduced yet?

Changed in vmbuilder:
status: New → Confirmed
Revision history for this message
Vacheslav Anzhiganov (vanzhiganov) wrote :

The error is caused due to lack of directory /proc in target chroot

Preparing to unpack .../linux-image-3.13.0-107-generic_3.13.0-107.154_amd64.deb ...
locale: Cannot set LC_ALL to default locale: No such file or directory
grep: /proc/cpuinfo: No such file or directory
This kernel does not support a non-PAE CPU.

In fingers, we can resolve this bug simple mount directory /proc from root system to chroot.

mount --bind /proc /tmp/tmpXXXX/proc

after mounting we can activate chroot and execute package installation again

chroot /tmp/tmpXXXX
apt-get --force-yes -y install linux-image-virtual

after all we need to umount proc dir

Changed in vmbuilder:
assignee: nobody → Vacheslav Anzhiganov (vanzhiganov)
Revision history for this message
Vacheslav Anzhiganov (vanzhiganov) wrote :
Changed in vmbuilder:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.