Bug 1655305

Summary: virt-bootstrap fails to create filesystem
Product: [Fedora] Fedora Reporter: verslyap
Component: virt-bootstrapAssignee: Fabiano FidĂȘncio <fidencio>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: berrange, fidencio, rstoyanov1
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-06 06:56:33 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:
Embargoed:

Description verslyap 2018-12-02 15:23:52 UTC
Description of problem:
When I run sudo virt-bootstrap docker://fedora ~/fedora after upgrading to Fedora 29 the command fails.

Version-Release number of selected component (if applicable):
virt-bootstrap.noarch 1.1.0-4.fc29

How reproducible:
It happens every time I run the virt-boostrap command

Steps to Reproduce:
1. install virt-bootstrap (sudo dnf install virt-bootstrap)
2. run virt-boostrap docker://fedora /path/to/folder/
3.

Actual results:
sudo virt-bootstrap docker://fedora /home/mitch/fedora
INFO    : Checking cached layers
INFO    : Extracting container layers
INFO    : Extracting layer (1/1) with size: 83.23 MiB
Traceback (most recent call last):
  File "/usr/bin/virt-bootstrap", line 11, in <module>
    load_entry_point('virt-bootstrap==1.1.0', 'console_scripts', 'virt-bootstrap')()
  File "/usr/lib/python3.7/site-packages/virtBootstrap/virt_bootstrap.py", line 334, in main
    progress_cb=args.status_only)
  File "/usr/lib/python3.7/site-packages/virtBootstrap/virt_bootstrap.py", line 148, in bootstrap
    progress=prog).unpack(dest)
  File "/usr/lib/python3.7/site-packages/virtBootstrap/sources/docker_source.py", line 307, in unpack
    utils.untar_layers(self.layers, dest, self.progress)
  File "/usr/lib/python3.7/site-packages/virtBootstrap/utils.py", line 344, in untar_layers
    safe_untar(tar_file, dest_dir)
  File "/usr/lib/python3.7/site-packages/virtBootstrap/utils.py", line 287, in safe_untar
    execute(virt_sandbox + params)
  File "/usr/lib/python3.7/site-packages/virtBootstrap/utils.py", line 264, in execute
    raise subprocess.CalledProcessError(proc.returncode, cmd_str)
subprocess.CalledProcessError: Command 'virt-sandbox -c lxc:/// --name=bootstrap_8383 -m host-bind:/mnt=/home/mitch/fedora -- /bin/tar xf /var/cache/virt-bootstrap/docker_images/d0483bd5a55488f5ba6383a5cc8553d5101864f03acd07eabc5df7563c3692cf -C /mnt --exclude dev/* --overwrite --absolute-names --acls --xattrs --selinux' returned non-zero exit status 1.

Expected results:
A container filesystem built in the source directory

Additional info:
When I take and run the virt-sandbox command from the virt-bootstrap error output I get
sudo  virt-sandbox -c lxc:/// --name=bootstrap_7664 -m host-bind:/mnt=/home/mitch/fedora -- /bin/tar xf /var/cache/virt-bootstrap/docker_images/d0483bd5a55488f5ba6383a5cc8553d5101864f03acd07eabc5df7563c3692cf -C /mnt --exclude dev/* --overwrite --absolute-names --acls --xattrs --selinux
2018-12-02 15:20:36.410+0000: 1: error : virCommandExec:2190 : cannot execute binary /etc/libvirt-sandbox/scratch/.libs/libvirt-sandbox-init-lxc: Permission denied
Failure in libvirt_lxc startup: cannot execute binary /etc/libvirt-sandbox/scratch/.libs/libvirt-sandbox-init-lxc: Permission denied

Comment 1 Fabiano FidĂȘncio 2018-12-02 21:02:55 UTC
Adding danpb (libvirt-sandbox maintainer) to the loop as it seems more like a libvirt-sandbox issue with SELinux than anything else.

Daniel, would you mind to take a look at this one?

Comment 2 verslyap 2018-12-02 21:55:24 UTC
So, I did just run setenforce 0 really quick and it worked.  If that's helpful or not.

Comment 3 Radostin Stoyanov 2019-07-06 06:56:33 UTC
Thank you for reporting this issue. It should be fixed in the next release.