kvm筆記總結

jasmine456發表於2024-05-07

帶記錄

windows虛擬機器(kvm)複製貼上

https://forum.suse.org.cn/t/topic/15406
https://bbs.deepin.org/zh/post/259929
https://dausruddin.com/how-to-enable-clipboard-and-folder-sharing-in-qemu-kvm-on-windows-guest/

virt-mannager打不開

https://stackoverflow.com/questions/29468421/gtk-warning-cannot-open-display-launching-background-gtk
https://segmentfault.com/a/1190000039811754

KVM Web管理平臺

1.WebVirtMgr
https://www.cnblogs.com/cnsre/p/12881921.html#3518-1530603185411
2.virt-mannager

克隆

https://cloud.tencent.com/developer/article/2017453
https://www.cnblogs.com/5201351/p/4461000.html

刪除

https://www.jianshu.com/p/6ca7910363d1

報錯總結

https://www.cnblogs.com/daisyyang/p/10953202.html

常用命令總結

參考連結:
https://cloud.tencent.com/developer/article/2115851

  1. 啟動
virsh start [name]
  1. 停止
virsh stop[name]
  1. 重啟
virsh restart [name]
  1. 檢視所有的列表
virsh list --all

批次按照windows專案總結

安裝kvm相關包:
apt install qemu-kvm virt-manager libvirt-daemon-system
sudo systemctl --now enable libvirtd
mkdir /filecoin_1/kvm/libvirt -pv
sudo mv /var/lib/libvirt /filecoin 
sudo ln -sv /filecoin_1/kvm/libvirt /var/lib/libvirt

透過xml檔案建立虛擬機器:
virsh define /etc/libvirt/qemu/win-test.xml


os-images:/filecoin_1/kvm/libvirt/person/os-images/
file:/filecoin_1/kvm/libvirt/images/win/

win10: /filecoin_1/kvm/libvirt/person/os-images/Windows10.iso
host=win1 && qemu-img create -f qcow2 $host/$host.qcow2 40G

克隆虛擬機器
host=win2 && virt-clone -o  windows10-test -n $host -f /filecoin_1/kvm/libvirt/images/win/$host/$host.qcow2

/filecoin_1/kvm/libvirt/images/win/win1/win10-1.qcow2

記憶體管理:
https://www.cnblogs.com/ygbh/p/17420868.html

virt-install --virt-type kvm --name windows10 --ram 4096 --vcpus 2 \
--cdrom=/filecoin_1/kvm/libvirt/person/os-images/Windows10.iso \
--disk path=/filecoin_1/kvm/libvirt/images/win/win-test/win-test.qcow2 --network network=default \
--graphics vnc,listen=0.0.0.0 --noautoconsole


for i in `seq 24 50`;do host=win$i && virt-clone -o  windows10-test -n $host -f /filecoin_1/kvm/libvirt/images/win/$host/$host.qcow2;done

kvm命令:
pdf
kvm克隆細節:
https://www.cnblogs.com/5201351/p/4461000.html

相關文章