Skip to content

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

@lindevel

Description

@lindevel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions