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

Unable to get SELinux context of user: Invalid argument #12

Open
lindevel opened this issue Feb 26, 2023 · 1 comment
Open

Unable to get SELinux context of user: Invalid argument #12

lindevel opened this issue Feb 26, 2023 · 1 comment

Comments

@lindevel
Copy link

lindevel commented Feb 26, 2023

When creating an LXC container in Virtual Machine Manager I get an error:

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

Command 'virt-sandbox --security=inherit -c qemu:///session --name=bootstrap_1191442 -m host-bind:/mnt=/home/user/.local/share/libvirt/filesystems/container1 -- /bin/tar xf /home/user/Завантажене/rootfs.tar.xz -C /mnt --exclude dev/* --exclude */.wh.* --overwrite --absolute-names' returned non-zero exit status 1.
All extracted files will be owned by the current unprivileged user.
Passing the root_password directly via command line is deprecated and using the 'file:' selector is the recommended way to use this option.
Extracting files into destination directory
Extracting layer (1/1) with size: 98.17 MiB
Untar layer: /home/user/Завантажене/rootfs.tar.xz
Call command:
virt-sandbox --security=inherit -c qemu:///session --name=bootstrap_1191442 -m host-bind:/mnt=/home/user/.local/share/libvirt/filesystems/container1 -- /bin/tar xf /home/user/Завантажене/rootfs.tar.xz -C /mnt --exclude dev/* --exclude */.wh.* --overwrite --absolute-names
Stderr:
Не вдалося обробити запис захисту: Unable to get SELinux context of user: Некоректний аргумент

I studied the libvirt-sandbox source code, this error is caused by the --security=inherit option (this option requires SELinux to be enabled)
https://github.com/libvirt/libvirt-sandbox/blob/04ea9686819a78886a6aee16c49c7d8886434dfa/libvirt-sandbox/libvirt-sandbox-config.c#L1895
My distro: Arch Linux
Installing LXC rootfs: Alma Linux 9 from http://uk.lxd.images.canonical.com/images/almalinux/9/amd64/default/20230225_23:08/rootfs.tar.xz

@morenathan
Copy link

I suppose YMMV but removing that option does not solve the issue. Found in /usr/lib/python3.11/site-packages/virtBootstrap/utils.py if using the virt-bootstrap-git package on Archlinux. I'm also using the same.

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