我在 Debian 11 上的 libguestfs 上遇到了一个已知的“找不到父目录”问题,这导致我无法在主机上创建虚拟机。我过去已经遇到过这个问题,解决方案是运行sudo chmod a+r /boot/vmlinuz-*
.然而这一次,它这样做并没有效果。
根据libguestfs 官方文档,“此问题已在 libguestfs ≥ 1.26 中永久修复。”我正在使用 libguestfs 1.40.2:
$ libguestfs-test-tool
************************************************************
* IMPORTANT NOTICE
*
* When reporting bugs, include the COMPLETE, UNEDITED
* output below in your bug report.
*
************************************************************
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SELinux: sh: 1: getenforce: not found
guestfs_get_append: (null)
guestfs_get_autosync: 1
guestfs_get_backend: direct
guestfs_get_backend_settings: []
guestfs_get_cachedir: /var/tmp
guestfs_get_hv: /usr/bin/qemu-system-x86_64
guestfs_get_memsize: 768
guestfs_get_network: 0
guestfs_get_path: /usr/lib/x86_64-linux-gnu/guestfs
guestfs_get_pgroup: 0
guestfs_get_program: libguestfs-test-tool
guestfs_get_recovery_proc: 1
guestfs_get_smp: 1
guestfs_get_sockdir: /tmp
guestfs_get_tmpdir: /tmp
guestfs_get_trace: 0
guestfs_get_verbose: 1
host_cpu: x86_64
Launching appliance, timeout set to 600 seconds.
libguestfs: launch: program=libguestfs-test-tool
libguestfs: launch: version=1.40.2
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=direct
libguestfs: launch: tmpdir=/tmp/libguestfsUXZ0pd
libguestfs: launch: umask=0022
libguestfs: launch: euid=0
libguestfs: begin building supermin appliance
libguestfs: run supermin
libguestfs: command: run: /usr/bin/supermin
libguestfs: command: run: \ --build
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ --if-newer
libguestfs: command: run: \ --lock /var/tmp/.guestfs-0/lock
libguestfs: command: run: \ --copy-kernel
libguestfs: command: run: \ -f ext2
libguestfs: command: run: \ --host-cpu x86_64
libguestfs: command: run: \ /usr/lib/x86_64-linux-gnu/guestfs/supermin.d
libguestfs: command: run: \ -o /var/tmp/.guestfs-0/appliance.d
supermin: version: 5.1.20
supermin: package handler: debian/dpkg
supermin: acquiring lock on /var/tmp/.guestfs-0/lock
supermin: build: /usr/lib/x86_64-linux-gnu/guestfs/supermin.d
supermin: reading the supermin appliance
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/base.tar.gz type gzip base image (tar)
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/daemon.tar.gz type gzip base image (tar)
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/excludefiles type uncompressed excludefiles
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/hostfiles type uncompressed hostfiles
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/init.tar.gz type gzip base image (tar)
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/packages type uncompressed packages
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/packages-hfsplus type uncompressed packages
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/packages-reiserfs type uncompressed packages
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/packages-xfs type uncompressed packages
supermin: build: visiting /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/udev-rules.tar.gz type gzip base image (tar)
supermin: mapping package names to installed packages
supermin: resolving full list of package dependencies
supermin: build: 218 packages, including dependencies
supermin: build: 9617 files
supermin: build: 4864 files, after matching excludefiles
supermin: build: 4875 files, after adding hostfiles
supermin: build: 4875 files, after removing unreadable files
supermin: build: 4881 files, after munging
supermin: kernel: looking for kernel using environment variables ...
supermin: kernel: looking for kernels in /lib/modules/*/vmlinuz ...
supermin: kernel: looking for kernels in /boot ...
supermin: kernel: kernel version of /boot/vmlinuz-5.10.0-8-amd64 = 5.10.0-8-amd64 (from content)
supermin: kernel: picked modules path /lib/modules/5.10.0-8-amd64
supermin: kernel: kernel version of /boot/vmlinuz-4.19.0-16-amd64 = 4.19.0-16-amd64 (from content)
supermin: kernel: picked modules path /lib/modules/4.19.0-16-amd64
supermin: kernel: picked vmlinuz /boot/vmlinuz-5.10.0-8-amd64
supermin: kernel: kernel_version 5.10.0-8-amd64
supermin: kernel: modpath /lib/modules/5.10.0-8-amd64
supermin: ext2: creating empty ext2 filesystem '/var/tmp/.guestfs-0/appliance.d.yj6r81ku/root'
supermin: ext2: populating from base image
supermin: ext2: copying files from host filesystem
supermin: ext2: copying kernel modules
supermin: *** parent directory not found ***
supermin: When reporting this error:
supermin: please include ALL the debugging information below
supermin: AND tell us what system you are running this on.
src=/lib/modules/5.10.0-8-amd64
dest=/lib/modules/5.10.0-8-amd64
dirname=/lib/modules
basename=5.10.0-8-amd64
supermin: ext2fs_namei: parent directory not found: /lib/modules: File not found by ext2_lookup
supermin: failure: ext2fs_namei: parent directory not found
libguestfs: error: /usr/bin/supermin exited with error status 1, see debug messages above
libguestfs: closing guestfs handle 0x557c4c42b8b0 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfsUXZ0pd
一些来源建议运行:
sudo update-guestfs-appliance
然而我似乎没有update-guestfs-appliance
(调用它时得到“命令未找到”),我也不明白如何在 Debian 上安装它。
supermin
在详细模式下运行会给出以下结果:
$ /usr/bin/supermin --build --verbose -v -v -v --if-newer --lock /var/tmp/.guestfs-0/lock --copy-kernel -f ext2 --host-cpu x86_64 /usr/lib/x86_64-linux-gnu/guestfs/supermin.d -o /var/tmp/.guestfs-0/appliance.d
supermin: ext2: copying kernel modules
supermin: ext2: copy_file /lib -> /lib
supermin: ext2: copy_file /lib/modules -> /lib/modules
supermin: ext2: copy_file /lib/modules/5.10.0-8-amd64 -> /lib/modules/5.10.0-8-amd64
supermin: *** parent directory not found ***
我检查了目录/lib/modules/5.10.0-8-amd64
:它存在于磁盘上,并且每个人都可以(递归)读取。
一页建议运行:
sudo dpkg-statoverride --add --update root root 0644 /boot/vmlinuz-$(uname -r)
我运行了它,它似乎成功了,就好像我第二次重新运行它一样,它告诉我覆盖已经存在。
我还能尝试什么?