大网数据广告活动
服务器运维问答

Virsh can't detect my new vm

· 52CE 我爱测

I have a *.qcow2 image from my old OS, it contains Windows 10. Then I copied it to the new OS and tried to install it. I followed the method written here " How to create a new domain from an existing base image in virsh ". But my…

问题原文

原帖链接 · Ita Subagja · CC BY-SA 4.0

I have a *.qcow2 image from my old OS, it contains Windows 10. Then I copied it to the new OS and tried to install it. I followed the method written here "How to create a new domain from an existing base image in virsh".

But my VM does not appear from virsh? (virsh list --all) Then how do I get virsh to detect my new VM? Or how do I run my VM from the command line if virsh can't detect?

Here are some commands that I run in the terminal window:

$ sudo virt-sysprep -a /home/vm-images/win10.qcow2 
[sudo] password for ita: 
[   0.0] Examining the guest ...
[   4.9] Performing "abrt-data" ...
[   4.9] Performing "backup-files" ...
[  27.3] Performing "bash-history" ...
[  27.3] Performing "blkid-tab" ...
[  27.3] Performing "crash-data" ...
[  27.3] Performing "cron-spool" ...
[  27.3] Performing "dhcp-client-state" ...
[  27.4] Performing "dhcp-server-state" ...
[  27.4] Performing "dovecot-data" ...
[  27.4] Performing "logfiles" ...
[  27.4] Performing "machine-id" ...
[  27.4] Performing "mail-spool" ...
[  27.4] Performing "net-hostname" ...
[  27.5] Performing "net-hwaddr" ...
[  27.5] Performing "pacct-log" ...
[  27.5] Performing "package-manager-cache" ...
[  27.6] Performing "pam-data" ...
[  27.6] Performing "passwd-backups" ...
[  27.6] Performing "puppet-data-log" ...
[  27.6] Performing "rh-subscription-manager" ...
[  27.7] Performing "rhn-systemid" ...
[  27.7] Performing "rpm-db" ...
[  27.7] Performing "samba-db-log" ...
[  27.7] Performing "script" ...
[  27.7] Performing "smolt-uuid" ...
[  27.7] Performing "ssh-hostkeys" ...
[  27.8] Performing "ssh-userdir" ...
[  27.8] Performing "sssd-db-log" ...
[  27.8] Performing "tmp-files" ...
[  27.8] Performing "udev-persistent-net" ...
[  27.9] Performing "utmp" ...
[  27.9] Performing "yum-uuid" ...
[  27.9] Performing "customize" ...
[  27.9] Setting a random seed
virt-sysprep: warning: random seed could not be set for this type of guest
[  28.2] Performing "lvm-uuids" ...
$ virt-install -n windows-10 --connect=qemu:///system --description "Windows 10" --os-type=win10 --ram=2048 --vcpus=1 --disk path=/home/vm-images/win10.qcow2,bus=virtio,size=12 --network default --boot hd

Starting install...
Domain creation completed.
You can restart your domain by running:
  virsh --connect qemu:///system start windows-10
$ virsh list --all
 Id   Name   State
--------------------

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

You forgot the virsh command line option --connect qemu:///system.

Because you aren't running virsh as root, it defaults to qemu:///session, which shows only VMs running under your user account.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-09-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。