Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot initialize fsdev 'fsdev-fs2' (Permission denied) #6

Closed
tpimh opened this issue Nov 18, 2018 · 4 comments
Closed

cannot initialize fsdev 'fsdev-fs2' (Permission denied) #6

tpimh opened this issue Nov 18, 2018 · 4 comments

Comments

@tpimh
Copy link

tpimh commented Nov 18, 2018

Tried installing debian:sid image from docker, got the following error:

Unable to complete install: 'virt-bootstrap did not complete successfully'

Command 'virt-sandbox -c qemu:///session --name=bootstrap_5434 -m host-bind:/mnt=/home/user/.local/share/libvirt/filesystems/debian-sid -- /bin/tar xf /home/user/.cache/virt-bootstrap/docker_images/16e82e17faef9e90ceefcd8175e9899edce768aa6008cc16dd1e3fe7d3b88bb8 -C /mnt --exclude dev/* --overwrite --absolute-names' returned non-zero exit status 1.
All extracted files will be owned by the current unprivileged user.
Checking cached layers
Checking layer: /home/user/.cache/virt-bootstrap/docker_images/16e82e17faef9e90ceefcd8175e9899edce768aa6008cc16dd1e3fe7d3b88bb8
Downloading container image
Extracting container layers
Extracting layer (1/1) with size: 46.98 MiB
Untar layer: /home/user/.cache/virt-bootstrap/docker_images/16e82e17faef9e90ceefcd8175e9899edce768aa6008cc16dd1e3fe7d3b88bb8
Call command:
virt-sandbox -c qemu:///session --name=bootstrap_5434 -m host-bind:/mnt=/home/user/.local/share/libvirt/filesystems/debian-sid -- /bin/tar xf /home/user/.cache/virt-bootstrap/docker_images/16e82e17faef9e90ceefcd8175e9899edce768aa6008cc16dd1e3fe7d3b88bb8 -C /mnt --exclude dev/* --overwrite --absolute-names
Stderr:
Unable to start sandbox: Failed to create domain: internal error: qemu unexpectedly closed the monitor: 2018-11-18T14:56:44.411088Z qemu-system-x86_64: -device virtio-9p-pci,id=fs2,fsdev=fsdev-fs2,mount_tag=sandbox:mount0,bus=pci.0,addr=0x4: cannot initialize fsdev 'fsdev-fs2': failed to open '/home/user/.local/share/libvirt/filesystems/debian-sid': Permission denied

I don't know if this is a bug of virt-bootstrap, skopeo, qemu or fedora (the distribution that I'm using right now).

@tpimh
Copy link
Author

tpimh commented Mar 10, 2019

Anyone was able to reproduce it? This is how to do it on Fedora 29:

$ virt-bootstrap -d docker://alpine /home/user/.local/share/libvirt/filesystems/test
WARNING : All extracted files will be owned by the current unprivileged user.
INFO    : Checking cached layers
DEBUG   : Checking layer: /home/user/.cache/virt-bootstrap/docker_images/8e402f1a9c577ded051c1ef10e9fe4492890459522089959988a4852dee8ab2c
INFO    : Extracting container layers
INFO    : Extracting layer (1/1) with size: 2.63 MiB
DEBUG   : Untar layer: /home/user/.cache/virt-bootstrap/docker_images/8e402f1a9c577ded051c1ef10e9fe4492890459522089959988a4852dee8ab2c
DEBUG   : Call command:
virt-sandbox -c qemu:///session --name=bootstrap_2634 -m host-bind:/mnt=/home/user/.local/share/libvirt/filesystems/test -- /bin/tar xf /home/user/.cache/virt-bootstrap/docker_images/8e402f1a9c577ded051c1ef10e9fe4492890459522089959988a4852dee8ab2c -C /mnt --exclude dev/* --overwrite --absolute-names
DEBUG   : Stderr:
Unable to start sandbox: Failed to create domain: internal error: qemu unexpectedly closed the monitor: 2019-03-10T09:19:03.043848Z qemu-system-x86_64: -device virtio-9p-pci,id=fs2,fsdev=fsdev-fs2,mount_tag=sandbox:mount0,bus=pci.0,addr=0x4: cannot initialize fsdev 'fsdev-fs2': failed to open '/home/user/.local/share/libvirt/filesystems/test': Permission denied

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 qemu:///session --name=bootstrap_2634 -m host-bind:/mnt=/home/user/.local/share/libvirt/filesystems/test -- /bin/tar xf /home/user/.cache/virt-bootstrap/docker_images/8e402f1a9c577ded051c1ef10e9fe4492890459522089959988a4852dee8ab2c -C /mnt --exclude dev/* --overwrite --absolute-names' returned non-zero exit status 1.

@tpimh
Copy link
Author

tpimh commented Mar 10, 2019

I tried

# semanage fcontext -a -t virt_content_t "/home/user/.local/share/libvirt/filesystems(/.*)?"
# restorecon -R "/home/user/.local/share/libvirt/filesystems"

and the output now is the following:

WARNING : All extracted files will be owned by the current unprivileged user.
INFO    : Checking cached layers
DEBUG   : Checking layer: /home/user/.cache/virt-bootstrap/docker_images/8e402f1a9c577ded051c1ef10e9fe4492890459522089959988a4852dee8ab2c
INFO    : Extracting container layers
INFO    : Extracting layer (1/1) with size: 2.63 MiB
DEBUG   : Untar layer: /home/user/.cache/virt-bootstrap/docker_images/8e402f1a9c577ded051c1ef10e9fe4492890459522089959988a4852dee8ab2c
DEBUG   : Call command:
virt-sandbox -c qemu:///session --name=bootstrap_7575 -m host-bind:/mnt=/home/user/.local/share/libvirt/filesystems/test -- /bin/tar xf /home/user/.cache/virt-bootstrap/docker_images/8e402f1a9c577ded051c1ef10e9fe4492890459522089959988a4852dee8ab2c -C /mnt --exclude dev/* --overwrite --absolute-names
DEBUG   : Stderr:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
ERROR: error getting working directory name: no such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
libvirt-sandbox-init-qemu: mount_root: can't open /etc/libvirt-sandbox/scratch/mounts.cfg: Permission denied
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 qemu:///session --name=bootstrap_7575 -m host-bind:/mnt=/home/user/.local/share/libvirt/filesystems/test -- /bin/tar xf /home/user/.cache/virt-bootstrap/docker_images/8e402f1a9c577ded051c1ef10e9fe4492890459522089959988a4852dee8ab2c -C /mnt --exclude dev/* --overwrite --absolute-names' returned non-zero exit status 1.

@rst0git
Copy link
Collaborator

rst0git commented Mar 10, 2019

Hi @tpimh
What is the output of the following command?

$ virt-sandbox -c qemu:///session --name=bootstrap_7575 -m host-bind:/mnt=/home/user/.local/share/libvirt/filesystems/test -- /bin/tar xf /home/user/.cache/virt-bootstrap/docker_images/8e402f1a9c577ded051c1ef10e9fe4492890459522089959988a4852dee8ab2c -C /mnt --exclude dev/* --overwrite --absolute-names

@tpimh
Copy link
Author

tpimh commented Mar 10, 2019

I just solved it by disabling selinux with setenforce 0, took it from your comment here: #2 (comment).

@tpimh tpimh closed this as completed Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants