在 Red Hat Linux 7 (RHEL7) 虚拟机上更新 VirtualBox 客户机添加项时,我们收到以下有关缺少 SELinux 目标策略文件的错误。
我们检查了虚拟机:
yum install selinux-policy-targeted
我们尝试了以下命令这个帖子,但该包已经安装。- 警报文件存在;但其大小为零。
- 我们很久以前就禁用了这台虚拟机上的 SELinux。
因此,我们想知道该错误是否会影响客人的添加,以及我们是否可以解决该错误。我们很感激您的提示和建议。
部分终端输出:
... omitting ...
[root@hostname ~]# yum install selinux-policy-targeted
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Package selinux-policy-targeted-3.13.1-268.el7_9.2.noarch already installed and latest version
Nothing to do
[root@hostname ~]#
... omitting ...
[root@hostname ~]# ll //etc/selinux/targeted/policy/policy.31
-rw-r--r-- 1 root root 0 Jun 6 13:33 //etc/selinux/targeted/policy/policy.31
... omitting ...
[root@hostname ~]# sh /media/cdrom/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.34 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.1.34 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules. This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel
3.10.0-1160.80.1.el7.x86_64.
ERROR: Can't map '//etc/selinux/targeted/policy/policy.31': Invalid argument
ERROR: Unable to open policy //etc/selinux/targeted/policy/policy.31.
libsemanage.semanage_read_policydb: Error while reading kernel policy from /etc/selinux/targeted/active/policy.kern. (No such file or directory).
OSError: No such file or directory
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted
[root@hostname ~]# reboot now
Connection to hostname closed by remote host.
Connection to hostname closed.
答案1
尝试重新安装 selinux-policy-targeted:
sudo yum remove selinux-policy-targeted
sudo yum install selinux-policy-targeted
重新运行来宾添加:
sudo /media/cdrom/VBoxLinuxAdditions.run
最后,重新启动系统以替换内核模块。