基于 KVM 的开发环境搭建

创建虚拟机

首先下载 ubuntu cloud image 使用 virsh 参考这个教程创建虚拟机:

Using Cloud Images With KVM [2021-02-07].html

固定 IP

KVM libvirt assign static guest IP addresses using DHCP on the virtual machine - nixCraft [2021-02-07].html

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
2
3
4
<features>
<acpi/>
<apic/>
</features>
1
2
3
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
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

Author

whypro

Posted on

2021-02-07

Updated on

2021-03-06

Licensed under

Comments

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×