基于 KVM 的开发环境搭建
创建虚拟机
首先下载 ubuntu cloud image 使用 virsh 参考这个教程创建虚拟机:
Using Cloud Images With KVM [2021-02-07].html
固定 IP
SSH
如果 sshd 启动失败,报错 sshd: no hostkeys available -- exiting
,需要执行:
1 | ssh-keygen -A |
sshd_ no hostkeys available – exiting [2021-02-07].html
克隆虚拟机
How to clone existing KVM virtual machine images on Linux - nixCraft [2021-02-07].html
virsh shutdown 无法关机
kvm虚拟化解决virsh shutdown关不掉虚拟机的问题_wcs_sdu的博客-CSDN博客 [2021-02-27].html
https://www.ilanni.com/?p=6225
1 | <features> |
1 | <on_poweroff>destroy</on_poweroff> |
1 | apt install acpid |
VM 磁盘扩容
How To extend_increase KVM Virtual Machine (VM) disk size _ ComputingForGeeks [2021-03-06].html
How To resize an ext2_3_4 and XFS root partition without LVM _ ComputingForGeeks [2021-03-06].html