顯示具有 Proxmox 標籤的文章。 顯示所有文章
顯示具有 Proxmox 標籤的文章。 顯示所有文章

2026年4月16日 星期四

Proxmox VE 8.x 更新 9.x

編輯 /etc/network/interfaces 新增 
source /etc/network/interfaces.d/*

2026年4月13日 星期一

Proxmox VE 8.X安裝 CPU microcode package 'intel-microcode'

編輯  /etc/apt/sources.list 加入 non-free-firmware

sudo apt update; apt install intel-microcode

重啟系統,微代碼必須在啟動初期載入才能生效

確認指令
journalctl -k | grep microcode

2026年2月6日 星期五

Proxmox VE 選擇開機 Kernel

查看所有可用的核心版本
proxmox-boot-tool kernel list 

系統自動載入特定版本
proxmox-boot-tool kernel pin 6.5.11-8-pve

換回最新版本
proxmox-boot-tool kernel unpin

2026年1月27日 星期二

Proxmox VE 更新 網路設定異常

WARN: missing 'source /etc/network/interfaces.d/sdn' directive for SDN support!
TASK WARNINGS: 1

編輯 /etc/network/interfaces 末端加入
source /etc/network/interfaces.d/*

2026年1月6日 星期二

Debian 13 安裝 Proxmox Datacenter Manager

編輯 /etc/apt/sources.list.d/debian.sources 內容如下
Types: deb
URIs: http://deb.debian.org/debian/
Suites: trixie trixie-updates
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://security.debian.org/debian-security/
Suites: trixie-security
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

設定 Repositories
cat <<EOF >/etc/apt/sources.list.d/proxmox.sources
Types: deb
URIs: http://download.proxmox.com/debian/pdm
Suites: trixie
Components: pdm-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF

設定 簽章金鑰
wget https://enterprise.proxmox.com/debian/proxmox-archive-keyring-trixie.gpg -O /usr/share/keyrings/proxmox-archive-keyring.gpg

安裝軟體
apt update
apt install proxmox-datacenter-manager proxmox-datacenter-manager-ui

Proxmox VE 8.x 安裝時螢幕黑屏

開機選項加入  nomodeset

2025年12月8日 星期一

Proxmox VE 9.x 建立 Windows 2K VM

VM 相關設定
BIOS:    Default(SeaBIOS)
Display: Standard VGA
Machine: Default(i440fx)
SCSI Controller: Default(LSI 只C895A)
Hard Disk(ide0)
Network Devivce: Realtek RTL8139

安裝 Windows 2000 後安裝 Universal VBE Video Display Driverhttps://bearwindows.zcm.com.au/vbemp.htm

Debian 13 安裝 Proxmox backup server 4.x

 wget https://enterprise.proxmox.com/debian/proxmox-release-trixie.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-trixie.gpg

echo "deb http://download.proxmox.com/debian/pbs trixie pbs-no-subscription" | sudo tee /etc/apt/sources.list.d/proxmox-backup-server.list

sudo apt update && sudo apt install proxmox-backup-server -y

2025年12月1日 星期一

Proxmox VE 9.x 安裝 NVIDIA 官方驅動程式

apt install pve-headers-$(uname -r)  gcc make dkms

編輯 /etc/modprobe.d/blacklist-nouveau.conf 加入
blacklist nouveau
options nouveau modeset=0

update-initramfs -u

rmmod nouveau
lsmod | grep nouveau

查詢型號
lspci -k | grep -A 2 -i "NVIDIA"

下載驅動程式
https://tw.download.nvidia.com/XFree86/Linux-x86_64/580.105.08/NVIDIA-Linux-x86_64-580.105.08.run
https://tw.download.nvidia.com/XFree86/Linux-x86_64/580.119.02/NVIDIA-Linux-x86_64-580.119.02.run

安裝
chmod a+x NVIDIA-Linux-x86_64-580.105.08.run
./NVIDIA-Linux-x86_64-580.105.08.run
./NVIDIA-Linux-x86_64-580.105.08.run --dkms

LXC 安裝
apt install pciutils lshw
./NVIDIA-Linux-x86_64-*.run --no-kernel-module --no-opengl-files --no-x-check

移除
./NVIDIA-Linux-x86_64-*.run --uninstall nvidia-smi --persistence-mode=1

2025年11月10日 星期一

Proxmox VE 8.x virtiofs

Proxmox VE 設定
Datacenter - directory Mappings - Add

VM 設定
Hardware  - Add - Virtiofs

Linux虛擬機設定
mount -t virtiofs host_shared /mnt/host_shared/

2025年5月19日 星期一

Proxmox VE 備份前後執行script

 /etc/vzdump.conf 增加
script: /etc/your-custom-script.sh

編輯 /etc/your-custom-script.sh  內容如下
#!/bin/bash
# $1=post-restart $2=snapshot <backup Mode> $3=100 <lxc id>
# STOREID=local
# TARGET=/var/lib/vz/dump/vzdump-lxc-100.tar.zst
# VMTYPE=lxc

if [ "$1" == "post-restart" ]; then
  do something
fi

if [ "$1" == "job-end" ]; then
  do something else
fi
exit 0

相關狀態
job-start Called once at the beginning of the entire backup job.
backup-start Called before the backup of an individual VM/container starts.
pre-stop Called before stopping or suspending a VM/container (in stop or suspend mode).
post-restart Called after restarting a VM/container (in suspend or snapshot mode).
backup-end Called after an individual VM/container backup finishes successfully.
log-end Called when the log file is complete and available.
job-end Called once at the end of the entire backup job if successful.
job-abort Called if the job is aborted or encounters a major error.
backup-abort Called if an individual VM backup fails.

pct exec 範例

  pct exec 10050 -- bash -c "ls -la /root"

2024年10月23日 星期三

Proxmox VE hookscript 範例

#!/bin/bash
# Exmple hook script for PVE guests (hookscript config option)
# You can set this via pct/qm with
# pct set <vmid> -hookscript <volume-id>
# qm set <vmid> -hookscript <volume-id>
# where <volume-id> has to be an executable file in the snippets folder
# of any storage with directories e.g.:
# qm set 100 -hookscript local:snippets/hookscript.sh
# chmod a+x /var/lib/vz/snippets/hookscript.sh
# $1 vmid
# $2 status

[ "$2" = "pre-start"  ]&& { date +"%Y-%m-%d %H:%M:%S $1 pre-start" >>/tmp/d;exit 0; }
[ "$2" = "post-start" ]&& { date +"%Y-%m-%d %H:%M:%S $1 post-start">>/tmp/d;exit 0; }
[ "$2" = "pre-stop"   ]&& { date +"%Y-%m-%d %H:%M:%S $1 pre-stop"  >>/tmp/d;exit 0; }
[ "$2" = "post-stop"  ]&& { date +"%Y-%m-%d %H:%M:%S $1 post-stop" >>/tmp/d;exit 0; }

exit 0

Proxmox VE qm 設定 額外參數範例

qm set 200 --args "-device e1000,mac=AA:AA:AA:AA:AA:AA,netdev=net1,bus=pci.0,addr=0x13,id=net1,bootindex=100 -netdev user,id=net1,net=192.168.128.0/24,tftp=/tmp/ipxe,bootfile=/autoexec.ipxe"

解開 proxmox ve 8.x initrd

 zstd -d initrd.img -c |cpio -idm

2024年9月25日 星期三

Proxmox VE8 啟用 SNMP

 apt install libpve-apiclient-perl 

cat >/etc/snmp/cat_serial <<EOF
#!/bin/bash
/bin/cat /sys/devices/virtual/dmi/id/product_serial
EOF

wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/proxmox -O /etc/snmp/proxmox

wget -O /etc/snmp/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
chmod +x /etc/snmp/distro

chmod a+x /etc/snmp/proxmox /etc/snmp/cat_serial

編輯 /etc/snmp/snmpd.conf
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.$(date +%Y%m%d-%H%M%S)

cat >/etc/snmp/snmpd.conf <<EOF
# Change RANDOMSTRINGGOESHERE to your preferred SNMP community string
com2sec readonly  default         RANDOMSTRINGGOESHERE
group MyROGroup v2c        readonly
view all    included  .1                               80
access MyROGroup ""      any       noauth    exact  all    none   none
syslocation ROOM 110
syscontact email <email@mail>

#OS Distribution Detection
#extend distro /usr/bin/distro
#Hardware Detection

# (uncomment for x86 platforms)
extend manufacturer '/bin/cat /sys/devices/virtual/dmi/id/sys_vendor'
extend hardware '/bin/cat /sys/devices/virtual/dmi/id/product_name'
#extend serial '/bin/cat /sys/devices/virtual/dmi/id/product_serial'

# (uncomment for ARM platforms)
#extend hardware '/bin/cat /sys/firmware/devicetree/base/model'
#extend serial '/bin/cat /sys/firmware/devicetree/base/serial-number'

extend distro /etc/snmp/distro
extend proxmox  "/usr/bin/sudo /etc/snmp/proxmox"
extend serial   "/usr/bin/sudo /etc/snmp/cat_serial"
EOF

編輯 /etc/sudoers  加入
Debian-snmp     ALL=(ALL) NOPASSWD: /etc/snmp/proxmox
Debian-snmp     ALL=(ALL) NOPASSWD: /etc/snmp/cat_serial

Proxmox ve 叢集移除節點

systemctl stop pve-cluster corosync
pmxcfs -l
rm -r /etc/corosync/*
rm /etc/pve/corosync.conf
killall pmxcfs
systemctl start pve-cluster

2024年9月24日 星期二

2024年7月16日 星期二

2024年6月28日 星期五

Proxmox Kernel upgrade gets No space left on device

方法一
mkdir /tmp/myesp
cat /etc/kernel/proxmox-boot-uuids
mount  /dev/disk/by-uuid/$(cat /etc/kernel/proxmox-boot-uuids) /tmp/myesp

rm /tmp/myesp/*-pve
umount /tmp/myesp

方法二
:> 
/boot/file