Platform Selection
There are many virtualization platforms to choose from. ESXi now requires a license in the future. Proxmox VE comes with a web interface and LXC support, but I don’t really need those features. So in the end, I chose KVM.
Debian Installation and Setup
- Use Ventoy to burn the latest Debian ISO.
- Check BIOS-related settings.
- Boot from the USB drive to start installation.
KVM Basic Environment
- Install base packages:
apt install --no-install-recommends qemu-system libvirt-clients libvirt-daemon-system virtinst
bridge-utils firewalld dnsmasq-base qemu-utils
- Check supported OS versions with virt-install –osinfo list. The defaults may lack some newer ones:
apt-get install osinfo-db-tools
wget https://releases.pagure.org/libosinfo/osinfo-db-20240701.tar.xz
osinfo-db-import --local osinfo-db-20240701.tar.xz
- cloud-image
apt-get install cloud-image-utils
- Configure user permissions:
adduser debian libvirt
virsh list --all
virsh --connect qemu:///system list --all
-
Since the device only has one network port, configure Bridge Networking so the VM and host share the same network environment and communicate directly with the outside. Refer to the Debian docs for examples: Debian KVM Networking Guide。
-
Storage pool configuration (default is /var/lib/libvirt/images). If you have multiple disks:
virsh pool-list --all
mkdir -p /data/pool
virsh pool-define-as --name default --type dir --target /data/pool/
virsh pool-start default
virsh pool-autostart default
virsh pool-info default
vm
-
cloud-image
-
create debian vm
wget https://cdimage.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2
virt-install --import --name debian\
--vcpus 4 \
--cpu host \
--memory 4096 \
--virt-type kvm \
--network bridge=br0 \
# 这里网口要和前面的网络配置对应上
--disk /data/pool/debian.qcow2 \
--os-variant debian12\
--graphics vnc,listen=0.0.0.0 --noautoconsole --autostart
- vm snapshots
virsh snapshot-create-as --domain debian --name debian --description "nothing"
virsh snapshot-list debian
Others
Configured VNC; it starts from port 5900 by default. If no specific port is set, after a reboot the port may change.
virsh vncdisplay debian
Docker Services
- Cloudflared (tunnel)
- Miniflux RSS reader (the search function is not very handy in follow)
- gitea
- Prometheus + Grafana (monitoring)
- qBittorrent + Sonarr (for following TV shows)
to do list
- terraform