![virt-sysprep 错误 未找到域:没有具有匹配名称的域](https://linux22.com/image/947601/virt-sysprep%20%E9%94%99%E8%AF%AF%20%E6%9C%AA%E6%89%BE%E5%88%B0%E5%9F%9F%EF%BC%9A%E6%B2%A1%E6%9C%89%E5%85%B7%E6%9C%89%E5%8C%B9%E9%85%8D%E5%90%8D%E7%A7%B0%E7%9A%84%E5%9F%9F.png)
我刚刚安装了 libguestfs-tools,因此我可以使用 virt-sysprep -d
我启动它,这就是我得到的。有人能帮助我吗?我使用的是 ubuntu 22.04 服务器
root@ctest:~/ssdd/isos# virt-sysprep -v -x -d out.raw
[ 0.0] Examining the guest ...
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: trace: set_network false
libguestfs: trace: set_network = 0
libguestfs: trace: add_domain "out.raw" "readonly:false" "allowuuid:true" "readonlydisk:ignore" "discard:besteffort"
libguestfs: opening libvirt handle: URI = NULL, auth = default+wrapper, flags = 0
libguestfs: successfully opened libvirt handle: conn = 0x55daeba64030
libguestfs: trace: add_domain = -1 (error)
virt-sysprep: error: libguestfs error: no libvirt domain called
‘out.raw’: Domain not found: no domain with matching name 'out.raw'
libguestfs: trace: close
libguestfs: closing guestfs handle 0x55daeba5f8e0 (state 0)
答案1
您似乎没有之前创建的域名为 的虚拟机out.raw
。如果您想列出 virt 认为您拥有的虚拟机,请使用以下virt -list
命令:
doug@s19:~/system-info$ virsh list
Id Name State
--------------------
但是我忘了,我实际上此刻没有任何虚拟机在运行,因此要列出非活动域:
doug@s19:~/system-info$ virsh list --inactive
Id Name State
--------------------------
- desk-ff shut off
- desk-hh shut off
- desk-ii shut off
- serv-xx shut off
或者同时列出活动域和非活动域:
doug@s19:~/system-info$ virsh list --all
Id Name State
--------------------------
- desk-ff shut off
- desk-hh shut off
- desk-ii shut off
- serv-xx shut off
我的虚拟机映像是:
doug@s19:~/system-info$ ls -l ~/vm
total 87258752
-rw------- 1 root root 53695545344 Jun 8 08:43 desk-ff.img
-rw------- 1 root root 53695545344 Jun 8 08:40 desk-hh.img
-rw------- 1 root root 53695545344 Jun 17 06:58 desk-ii.img
-rw------- 1 root root 53695545344 Jun 20 2021 serv-xx.img