Bug 1026814

Summary: libvirt-lxc leaks /.oldroot directory in container FS
Product: [Fedora] Fedora Reporter: Josh Poimboeuf <jpoimboe>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 19CC: berrange, clalancette, dallan, error, itamar, jforbes, laine, libvirt-maint, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-09 09:14:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Josh Poimboeuf 2013-11-05 13:39:51 UTC
Description of problem:
libvirt-lxc creates an /.oldroot directory in the container filesystem and never removes it before executing the container application.

Version-Release number of selected component (if applicable):
libvirt-daemon-1.0.5.6-3.fc19.x86_64

How reproducible:
Start a container

Steps to Reproduce:
$ virt-sandbox -c lxc:/// /bin/bash
bash: /root/.bashrc: Permission denied
bash-4.2# ls -ald /.oldroot
drwxr-xr-x. 2 root root 4096 Aug 13 13:56 /.oldroot

Actual results:
The /.oldroot directory exists.

Expected results:
The /.oldroot directory should not exist.

Additional info:

Comment 1 Michael Hampton 2014-06-08 00:51:51 UTC
I was able to reproduce this on Fedora 20. Containers are getting a directory /.oldroot created when being started from virt-manager or virsh start.

libvirt-daemon-1.1.3.5-2.fc20.x86_64

Comment 2 Daniel Berrangé 2014-06-09 09:14:09 UTC
The .oldroot directory is required during the pivot_root to setup the isolated filesystems. We can't remove it in a race free manner because there can be multiple containers starting in parallel using the same root filesystem. Merely having this directory exist should not cause any functional problems.