β

解决 libguestfs: error: /usr/libexec/qemu-kvm exited

nosa.me 246 阅读

我在使用 guestfish 命令的时候遇到了这个错误。

# guestfish add /dev/vm_storage_pool_vg/vm01_data : run : mount /dev/datavg/home / : find /
libguestfs: error: /usr/libexec/qemu-kvm exited with error status 1.
To see full error messages you may need to enable debugging.
See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs

但是很奇怪的是,敲两次 run 就好了:

# guestfish -a /dev/vm_storage_pool_vg/vm01_data

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: ‘help’ for help on commands
‘man’ to read the manual
‘quit’ to quit the shell

><fs> run
libguestfs: error: /usr/libexec/qemu-kvm exited with error status 1.
To see full error messages you may need to enable debugging.
See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
><fs> run
><fs> mount /dev/datavg/home /

debug 一下:

# LIBGUESTFS_DEBUG=1 time guestfish -a /dev/null run
libguestfs: create: flags = 0, handle = 0x17f64a0
libguestfs: launch: attach-method=appliance
libguestfs: launch: tmpdir=/tmp/libguestfs1ssRuO
libguestfs: launch: umask=0022
libguestfs: launch: euid=0
libguestfs: command: run: febootstrap-supermin-helper
libguestfs: command: run: \ –verbose
libguestfs: command: run: \ -f checksum
libguestfs: command: run: \ /usr/lib64/guestfs/supermin.d
libguestfs: command: run: \ x86_64
supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel = (null), initrd = (null), appliance = (null)
supermin helper [00000ms] inputs[0] = /usr/lib64/guestfs/supermin.d
checking modpath /lib/modules/2.6.32-279.el6.x86_64 is a directory
picked vmlinuz-2.6.32-279.el6.x86_64 because modpath /lib/modules/2.6.32-279.el6.x86_64 exists
supermin helper [00000ms] finished creating kernel
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/base.img
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
supermin helper [00016ms] visiting /usr/lib64/guestfs/supermin.d/init.img
supermin helper [00016ms] visiting /usr/lib64/guestfs/supermin.d/udev-rules.img
supermin helper [00016ms] adding kernel modules
supermin helper [00041ms] finished creating appliance
libguestfs: checksum of existing appliance: 60ae12cd12306a513e0caec33c626dd574c942d10774918ace4779651ba62663
libguestfs: [00048ms] begin testing qemu features
libguestfs: command: run: /usr/libexec/qemu-kvm
libguestfs: command: run: \ -nographic
libguestfs: command: run: \ -help
libguestfs: command: run: /usr/libexec/qemu-kvm
libguestfs: command: run: \ -nographic
libguestfs: command: run: \ -version
libguestfs: qemu version 0.12
libguestfs: command: run: /usr/libexec/qemu-kvm
libguestfs: command: run: \ -nographic
libguestfs: command: run: \ -machine accel=kvm:tcg
libguestfs: command: run: \ -device ?
libguestfs: error: /usr/libexec/qemu-kvm exited with error status 1, see debug messages above
libguestfs: closing guestfs handle 0x17f64a0 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfs1ssRuO
0.03user 0.06system 0:00.09elapsed 101%CPU (0avgtext+0avgdata 23072maxresident)k
0inputs+0outputs (0major+7951minor)pagefaults 0swaps

手动敲一下报错的命令:

# /usr/libexec/qemu-kvm -nographic -machine accel=kvm:tcg -device \?
qemu-kvm: -machine: invalid option

看一下 qemu-kvm 的版本:

# /usr/libexec/qemu-kvm -version
QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard

可能是版本低的问题,先升级 qemu-kvm:

yum -y install qemu-kvm

再看一下版本:

# /usr/libexec/qemu-kvm -version
QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2-2.479.el6), Copyright (c) 2003-2008 Fabrice Bellard

此时 /usr/libexec/qemu-kvm -nographic -machine accel=kvm:tcg -device \? 已经可以正常运行了,问题解决。

Related posts:

  1. 安装 nbd 模块 和 qemu-nbd 工具
  2. 用 guestfish 修改虚拟机镜像里的文件
  3. 把 raw 格式的虚拟机 转换成 qcow2 格式的虚拟机
  4. 从镜像中 exclude 文件或目录, 缩减镜像大小
作者:nosa.me
未来不会有sa
原文地址:解决 libguestfs: error: /usr/libexec/qemu-kvm exited, 感谢原作者分享。

发表评论