Ubuntu

vmbuilder fails when adding package 'ubuntu-desktop'

Reported by Peter Matulis on 2009-12-16
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
vm-builder (Ubuntu)
Medium
Unassigned
Lucid
Medium
Unassigned

Bug Description

When using the line

--addpkg ubuntu-desktop

to the vmbuilder invocation unexpected messages appear near the end of the process:

2009-12-15 20:57:38,007 INFO : Committed revision 2.^M
2009-12-15 20:57:40,097 INFO : umount: /tmp/vmbuilderS5ELLk/root/proc: device is busy.^M
2009-12-15 20:57:40,107 INFO : (In some cases useful info about processes that use^M
2009-12-15 20:57:40,107 INFO : the device is found by lsof(8) or fuser(1))^M
2009-12-15 20:57:40,107 INFO : Cleaning up^M
2009-12-15 20:57:51,447 INFO : rm: cannot remove `/tmp/vmbuilderS5ELLk/root/proc/dri/0/vma': Operation not permitted^M
2009-12-15 20:57:51,447 INFO : rm: cannot remove `/tmp/vmbuilderS5ELLk/root/proc/dri/0/bufs': Operation not permitted^M
2009-12-15 20:57:51,447 INFO : rm: cannot remove `/tmp/vmbuilderS5ELLk/root/proc/dri/0/queues': Operation not permitted^M
2009-12-15 20:57:51,447 INFO : rm: cannot remove `/tmp/vmbuilderS5ELLk/root/proc/dri/0/clients': Operation not permitted

and so on. A complete transcript is attached.

After removing the line the process finishes OK.

Host is:

Linux U910S64-A 2.6.31-16-server #53-Ubuntu SMP Tue Dec 8 05:08:02 UTC 2009 x86_64 GNU/Linux

Peter Matulis (petermatulis) wrote :
Peter Matulis (petermatulis) wrote :

Soory, transcript.txt is actually the shell script I used to do launch vmbuilder. The transcript is actually attached as typescript.txt (from script command).

Nick Barcet (nijaba) wrote :

Looks like we are trying to umount the volume before it has finished committing the prior operation to disk. Maybe we should sync prior to trying to umount?

Peter Matulis (petermatulis) wrote :
Download full text (4.3 KiB)

I did add a sync to the following file

/usr/lib/python2.6/dist-packages/VMBuilder/disk.py

Here

    def umount(self):
        self.vm.cancel_cleanup(self.umount)
        if (self.type != TYPE_SWAP) and not self.dummy:
            logging.debug('Syncing')
            run_cmd('sync')
            logging.debug('Unmounting %s', self.mntpath)
            run_cmd('umount', self.mntpath)

But there is a umount happening before that function is called.

I ran vmbuilder in debug mode and here are the pertinent messages:

===================
2009-12-23 09:18:43,386 DEBUG : Reading package lists...
2009-12-23 09:18:43,386 DEBUG : cleaning apt
2009-12-23 09:18:43,386 DEBUG : ['chroot', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/root', 'apt-get', 'clean']
2009-12-23 09:18:43,613 DEBUG : Unmounting volatile lrm filesystems
2009-12-23 09:18:43,614 DEBUG : Unbinding /dev and /proc filesystems
2009-12-23 09:24:43,714 DEBUG : ['umount', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/dev/pts']
2009-12-23 09:24:43,718 DEBUG : ['umount', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/dev']
2009-12-23 09:24:43,723 DEBUG : ['umount', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/proc']
2009-12-23 09:24:43,727 INFO : umount: /home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/proc: device is busy.
2009-12-23 09:24:43,728 INFO : (In some cases useful info about processes that use
2009-12-23 09:24:43,729 INFO : the device is found by lsof(8) or fuser(1))
2009-12-23 09:24:43,729 DEBUG : Oh, dear, an exception occurred
2009-12-23 09:24:43,729 INFO : Cleaning up
2009-12-23 09:24:43,729 DEBUG : ['umount', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/proc']
2009-12-23 09:24:43,733 DEBUG : umount: /home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/proc: device is busy.
2009-12-23 09:24:43,734 DEBUG : (In some cases useful info about processes that use
2009-12-23 09:24:43,734 DEBUG : the device is found by lsof(8) or fuser(1))
2009-12-23 09:24:43,734 DEBUG : ['umount', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/dev/pts']
2009-12-23 09:24:43,739 DEBUG : umount: /home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/dev/pts: not mounted
2009-12-23 09:24:43,739 DEBUG : ['umount', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/dev']
2009-12-23 09:24:43,744 DEBUG : umount: /home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/dev: not mounted
2009-12-23 09:24:43,744 DEBUG : Syncing
2009-12-23 09:24:43,744 DEBUG : ['sync']
2009-12-23 09:24:43,793 DEBUG : Unmounting /home/ubuntu/Data/tmp/vmbuilderYt3CgM/target/
2009-12-23 09:24:43,794 DEBUG : ['umount', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/target/']
2009-12-23 09:24:46,803 DEBUG : ['kpartx', '-d', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/disk0.img']
2009-12-23 09:24:46,813 DEBUG : loop deleted : /dev/loop2
2009-12-23 09:24:46,813 DEBUG : ['kpartx', '-d', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM/disk0.img']
2009-12-23 09:24:46,819 DEBUG : ['rmdir', 'kvm-test-desktop3']
2009-12-23 09:24:46,822 DEBUG : ['rm', '-rf', '/home/ubuntu/Data/tmp/vmbuilderYt3CgM']
2009-12-23 09:24:46,885 INFO : rm: cannot remove `/home/ubuntu/Data/tmp/vmbuilderYt3CgM/root/proc/dri/0/vma': Operation not permitted
2...

Read more...

Chuck Short (zulcss) on 2010-01-04
Changed in vm-builder (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Caleb Shay (caleb-webninja) wrote :

I've gotten similar problems caused by having binfmt-support installed into my VM image. Adding the following to unmount_dev_proc in /usr/lib/python2.6/dist-packages/VMBuilder/plugins/ubuntu/dapper.py fixes my problem:

run_cmd('umount', '%s/proc/sys/fs/binfmt_misc' % self.destdir)

My guess is that there are other filesystems getting mounted under /proc as well that are causing this issue.

I don't know what the package policy is, but I would think that vmbuilder is working as expected, but the packages are not, as they are apparently mounting filesystems on installation even when they are not supposed to run their postexec (at least, from what I can tell from vmbuilder).

Loïc Minier (lool) wrote :

it's likely binfmt-support for mono-handled binaries. Either it's needed to run some binaries during installation, in which case vmbuilder should handle binfmt-support specially by stopping it after installation of packages, or it's not really needed and vmbuilder can just avoid it from starting.

mono-runtime just does "update-binfmts --import cli" so I'm a bit surprized that this would actually enable the module in the kernel, it's more likely "invoke-rc.d binfmt-support" start loading them from binfmt-support.postinst, but I thought vmbuilder disabled invoke-rc.d services:
    def prevent_daemons_starting(self):
        os.chmod(self.install_from_template('/usr/sbin/policy-rc.d', 'nostart-policy-rc.d'), 0755)

Could you run vmbuilder in debug mode to see that this occurs after "Preventing daemons from starting" and before "Unpreventing daemons from starting"?

Sergey Svishchev (svs) wrote :

On karmic, policy-rc.d doesn't work (you need to divert or disable /sbin/initctl) -- see bug 392377 and bug 430224.

Loïc Minier (lool) wrote :

Ack; I remember debootstrap being adjusted for upstart; vm-builder should copy the debootstrap tricks.

But binfmt-support is not an upstart job, so I'm not sure that's the issue here.

Soren Hansen (soren) on 2010-03-30
Changed in vm-builder (Ubuntu):
milestone: none → ubuntu-10.04
Thierry Carrez (ttx) on 2010-04-09
Changed in vm-builder (Ubuntu Lucid):
milestone: ubuntu-10.04 → none
Fabián Rodríguez (magicfab) wrote :

Same problem in natty.

Zak Stone (zstone) wrote :

Following the analysis above, I found that adding --removepkg binfmt-support allows the ubuntu-desktop package to be installed successfully, just in case anyone needs a quick workaround.

neiltingey (2o-neil) wrote :

Has this been fixed anywhere ?

Still a problem for me in oneiric 11.10.

Apologies - mine seems to be a different problem - I am not using --addpkg ubuntu-desktop but I am getting a similar error message:

VMBuilder.exception.VMBuilderException: Process (['umount', '/tmp/tmpTuNycd/dev']) returned 1. stdout: , stderr: umount: /tmp/tmpTuNycd/dev: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

Apologies for the noise - I think I may be actually seeing bug #726790 https://bugs.launchpad.net/ubuntu/+source/vm-builder/+bug/726790

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers