proxmox

all about proxmox installation and configuration

Index

  1. prerequisites
    0.1 BIOS options
  2. installation
  3. configuration (console)
    2.1 first steps
    2.2 install usefull tools
    2.3 setup ntp server
    2.4 setup dns server
    2.5 remove subscription notice
    2.6 install kernel-headers
    2.7 change kernel boot version
    2.8 enable iommu for pcie passthrough
  4. usage
    3.1 browse
  5. errors
    4.1 network won't start after reboot
    4.2 bluetooth errors
    4.3 sound errors
    4.4 zfs errors
    4.5 kvm: exiting hardware virtualization
    4.6 no network after update
    4.100 (LXC) slow boot times
  6. update pve
  7. resize container
  8. port mirror

# Find Me
# License

1. installation

see official documentation on pve.proxmox.com

2. configuration

login via ssh (port 22) or do the steps nativ with a keyboard

2.1 first steps

install pve-no-subscription repository skip this step if you have an enterprise subscription

rm -f /etc/apt/sources.list.d/pve-enterprise.list
wget https://raw.githubusercontent.com/3x3cut0r/vps/main/apt/sources.list.d/pve-no-subscription.list -O /etc/apt/sources.list.d/pve-no-subscription.list

update packages

apt update && apt upgrade -y

2.2 install usefull tools

install pve-no-subscription repository

apt install htop iperf iperf3 ncdu ntpdate rfkill

2.3 setup ntp server

change /etc/chrony/chrony.conf

...
# Use Debian vendor zone.
# pool 2.debian.pool.ntp.org iburst
server 0.de.pool.ntp.org iburst
server 1.de.pool.ntp.org iburst
server 2.de.pool.ntp.org iburst
...

restart chrony

systemctl restart chronyd

2.4 setup dns server

change /etc/resolv.conf

search local.net
nameserver 1.1.1.1
nameserver 1.0.0.1
nameserver 2606:4700:4700::1111

2.5 remove subscription notice

need to be done after every update from pve!

remove the notice and restart the proxmox service

cp /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.bak
sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service

revert the changes if something went wrong

cp /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.bak /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
systemctl restart pveproxy.service

2.6 install kernel-headers

the kernel-headers should match with your kernel version!!!

apt install pve-headers-5.15 pve-headers-5.15.35-2-pve

2.7 change kernel boot version

change which kernel should boot

proxmox-boot-tool kernel list
proxmox-boot-tool kernel add 5.15.35-2-pve
# proxmox-boot-tool kernel remove <old-kernel-version>-pve
proxmox-boot-tool refresh

2.8 enable iommu for pcie passthrough

follow instructions on proxmox.com/wiki and thomas-krenn.com

3. usage

3.1 browse

Backend
https://proxmox.ip:8006/

4. errors

4.1 network won't start after reboot

systemctl mask ifupdown-pre.service
systemctl mask ifupdown2-pre.service
systemctl mask systemd-udev-settle.service

4.2 bluetooth errors

dmesg error on boot

...
[    3.080602] bluetooth hci0: Direct firmware load for mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin failed with error -2
[    3.081688] Bluetooth: hci0: Failed to load firmware file (-2)
...
[   13.102071] Bluetooth: hci0: Execution of wmt command timed out
[   13.102128] Bluetooth: hci0: Failed to send wmt func ctrl (-110)
[   15.917971] usb 5-4: Failed to suspend device, error -110
...

disable bluetooth

echo "blacklist btusb" > /etc/modprobe.d/bluetooth.conf
echo "blacklist btrtl" >> /etc/modprobe.d/bluetooth.conf
echo "blacklist btbcm" >> /etc/modprobe.d/bluetooth.conf
echo "blacklist btintel" >> /etc/modprobe.d/bluetooth.conf
echo "blacklist bluetooth" >> /etc/modprobe.d/bluetooth.conf

4.3 sound errors

dmesg error on boot

...
[    3.082545] snd_hda_intel 0000:06:00.6: no codecs found!
...

disable sound

echo "blacklist btusb" > /etc/modprobe.d/bluetooth.conf

4.4 zfs errors

dmesg error on boot

...
[DEPEND] Dependency failed for Import ZFS pools by cache file
[DEPEND] Dependency failed for Import ZFS pools by device scanning.
...

disable service

systemctl disable zfs-import-cache.service
systemctl disable zfs-import-scan

4.5 kvm: exiting hardware virtualization

install latest kernel + kernel-headers

apt install pve-kernel-5.15 pve-kernel-5.15.35-2-pve pve-headers-5.15.35-2-pve pve-headrs-5.15

4.6 no network after update

you probably updated your kernel but forgot to install kernel-headers

apt install pve-kernel-5.15.12-1-pve

4.99 prevent /etc/network/interfaces inside VM/LXC from overwrite

if your /etc/network/interfaces inside a VM/LXC gets overwritten by proxmox, do inside your VM/LXC:

touch /etc/network/.pve-ignore.interfaces

4.100 (LXC) slow boot times

if your LXC Container boots only in about 4-5 mins -> switch IPv6 from DHCP to SLAAC

5. update pve

DO NOT just simple apt update && apt upgrade -y
you will run into error 4.6! if the kernel will be updated!
you need to install the new pve-headers before updating your kernel!

apt update && apt upgrade
# abort here with CTRL-C
# check if the kernel will be updated
# remember the new kernel version
# apt install pve-headers-<enter new kernel version here>-pve
apt install pve-headers-5.15.35-2-pve
apt update && apt upgrade -y
# now you need to change the kernel boot version (see 2.7)
proxmox-boot-tool kernel list
# check which kernel is listet under Manually selected kernels:
proxmox-boot-tool kernel add <new-kernel-version>-pve
# for example:
#  proxmox-boot-tool kernel add 5.15.35-2-pve
proxmox-boot-tool kernel remove <old-kernel-version>-pve
# for example:
#  proxmox-boot-tool kernel remove 5.15.35-1-pve
proxmox-boot-tool refresh

6. resize container

VMID: 110
size: 1T

# get VMID from your container (e.g.: 110):
pct list

# stop the vm
pct stop 110

# resize vm
# pct resize <VMID> <disk> <size>
pct resize 110 rootfs 1T

# DONE!
# -----

# To do it by hand:

# get the path of the container disk (e.g.: /dev/pve/vm-110-disk-0):
lvdisplay | grep "LV Path\|LV Size"

# check the disk first
# e2fsck -f <disk>
e2fsck -f /dev/pve/vm-210-disk-0

# resize the disk
# resize2fs <disk> <size>
resize2fs /dev/pve/vm-210-disk-0 1T

# extend/reduce the LV size
# lvreduce -L <size> <path>
# lvextend -L <size> <path>
lvextend -L 1T /dev/pve/vm-210-disk-0

# check if the size has changed in the container config file:
vi /etc/pve/lxc/110.conf
# rootfs: local-lvm:vm-110-disk-0,size=1T

# start the vm
pct start 110

7. port mirror

see codingpackets.com/blog/proxmox-vm-bridge-port-mirror

7.1 install openvswitch-switch

apt install openvswitch-switch wget

7.2 create /opt/scripts/network/mirror_ports.sh script

mkdir -p /var/lib/vz/snippets/
wget https://raw.githubusercontent.com/3x3cut0r/vps/main/var/lib/vz/snippets/port-mirror.sh -O /var/lib/vz/snippets/port-mirror.sh
chmod +x /var/lib/vz/snippets/port-mirror.sh

7.3 apply script to vm/lxc container

# for lxc container id 100
pct set 100 --hookscript local:snippets/port-mirror.sh

# for vm id 100
qm set 100 --hookscript local:snippets/port-mirror.sh

Find Me

E-Mail

License

License: GPL v3 - This project is licensed under the GNU General Public License - see the gpl-3.0 for details.