Force Quit VM

rm /var/lock/qemu-server/lock-1001.conf
qm unlock 1001
# then stop the vm

perl: warning: Falling back to a fallback locale ("en_US.UTF-8").

cat << EOF >> ~/.bashrc
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
EOF

Power Consomption

# 下载编译
sudo apt install git
sudo apt install libpci-dev cmake gcc g++
git clone https://github.com/FlyGoat/RyzenAdj
cd RyzenAdj
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

# 查询功耗
sudo ./ryzenadj -i

Cloud Init

# On host
# sudo apt update -y && sudo apt install libguestfs-tools -y
virt-customize -a debian-11-genericcloud-amd64.qcow2 --install qemu-guest-agent
 
# virt-customize -a debian-11-genericcloud-amd64.qcow2 --install qemu-guest-agent --append-line '/etc/apt/apt.conf.d/proxy:Acquire::http::Proxy "http://192.168.2.22:3142";'
qm create 9000 --name debian12-cloudinit --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-single --machine q35
qm set 9000 --scsi0 local-lvm:0,discard=on,ssd=1,iothread=1,format=qcow2,import-from=/root/debian-12-generic-amd64.qcow2
qm disk resize 9000 scsi0 20G
qm set 9000 --boot order=scsi0
qm set 9000 --cpu host --cores 2 --memory 4096
qm set 9000 --bios ovmf --efidisk0 local-lvm:1,format=raw,efitype=4m,pre-enrolled-keys=1
qm set 9000 --ide2 local-lvm:cloudinit

LXC

  • resize CT’s volume
# pct resize <vmid> <disk> <size> [OPTIONS]
pct resize 1002 rootfs 108G

QEMU

  • Resize vm disk
# qm resize <vmid> <disk> <size>
qm resize 1001 virtio0 +25G

NFS

Cache

Gnome

apt install gnome-core
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target