curl -L https://gist.github.com/reitermarkus/937117c4c9105c01a85a78f1d85b42e9/raw/proxmox-setup.sh | bash
Last active
April 6, 2025 12:27
-
-
Save reitermarkus/937117c4c9105c01a85a78f1d85b42e9 to your computer and use it in GitHub Desktop.
Proxmox Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tee /etc/network/interfaces <<EOF | |
| auto lo | |
| iface lo inet loopback | |
| auto enp10s0 | |
| allow-hotplug enp10s0 | |
| iface enp10s0 inet manual | |
| auto enp7s0 | |
| allow-hotplug enp7s0 | |
| iface enp7s0 inet manual | |
| auto bond0 | |
| iface bond0 inet manual | |
| bond-slaves enp10s0 enp7s0 | |
| bond-miimon 100 | |
| bond-mode active-backup | |
| bond-primary enp10s0 | |
| bond-downdelay 200 | |
| bond-updelay 200 | |
| post-up ifconfig enp10s0 mtu 9000 | |
| auto vmbr0 | |
| iface vmbr0 inet dhcp | |
| bridge-ports bond0 | |
| bridge-stp off | |
| bridge-fd 0 | |
| hwaddress ether 40:b0:76:57:ef:72 | |
| EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tee /etc/network/interfaces <<EOF | |
| auto lo | |
| iface lo inet loopback | |
| auto eno1 | |
| allow-hotplug eno1 | |
| iface eno1 inet manual | |
| auto eno2 | |
| allow-hotplug eno2 | |
| iface eno2 inet manual | |
| auto eno3 | |
| allow-hotplug eno3 | |
| iface eno3 inet manual | |
| auto eno4 | |
| allow-hotplug eno4 | |
| iface eno4 inet manual | |
| auto bond0 | |
| iface bond0 inet manual | |
| bond-slaves eno1 eno2 | |
| bond-miimon 100 | |
| bond-mode active-backup | |
| bond-primary eno1 | |
| bond-downdelay 200 | |
| bond-updelay 200 | |
| post-up ifconfig eno1 mtu 9000 | |
| auto vmbr0 | |
| iface vmbr0 inet dhcp | |
| bridge-ports bond0 | |
| bridge-stp off | |
| bridge-fd 0 | |
| hwaddress ether 0c:c4:7a:5e:c3:78 | |
| EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set -euo pipefail | |
| rm -f /etc/apt/sources.list.d/pve-enterprise.list | |
| echo 'deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription' > /etc/apt/sources.list.d/pve-no-subscription.list | |
| sed -i.bak -E "s/(data\.status\.toLowerCase\(\) !== 'active')\)/\1 \&\& false)/" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js | |
| systemctl restart pveproxy.service | |
| # Reduce backup IO. | |
| sed -i -E 's/^\s*#?\s*(ionice:).*/\1 7/' /etc/vzdump.conf | |
| sed -i -E 's/^\s*#?\s*(bwlimit:).*/\1 32768/' /etc/vzdump.conf | |
| # Import ZFS pool disks by ID. | |
| sed -i -E 's/^\s*#\s*(ZPOOL_IMPORT_PATH=.*)/\1/' /etc/default/zfs | |
| update-initramfs -u | |
| apt-get update | |
| apt-get upgrade -y | |
| apt-get install -y curl | |
| # Install XG-C100F Driver | |
| apt-get install -y ethtool git unzip pve-headers build-essential | |
| pushd /tmp | |
| rm -rf AQtion | |
| git clone https://github.com/Aquantia/AQtion | |
| pushd AQtion | |
| make | |
| bash build-deb.sh | |
| apt-get install -y ./atlantic_*.deb | |
| popd | |
| rm -r AQtion | |
| popd | |
| echo 'zram' > /etc/modules-load.d/zram.conf | |
| memory_size=$(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE))) | |
| swap_size=$((memory_size / 2)) | |
| zramctl --size "${swap_size}" /dev/zram0 | |
| echo "KERNEL==\"zram0\", ATTR{disksize}=\"${swap_size}\" RUN=\"/sbin/mkswap /dev/zram0\", TAG+=\"systemd\"' > /etc/udev/rules.d/99-zram.rules | |
| tee /etc/sysctl.d/swap.conf <<EOF | |
| vm.swappiness=0 | |
| EOF | |
| tee /etc/sysctl.d/reboot-on-panic.conf <<EOF | |
| kernel.panic = 30 | |
| EOF | |
| tee /etc/sysctl.d/net.conf <<EOF | |
| kernel.pid_max = 4194303 | |
| net.netfilter.nf_conntrack_max = 1048576 | |
| net.core.rmem_max = 16777216 | |
| net.core.wmem_max = 16777216 | |
| net.core.wmem_default = 262144 | |
| net.core.rmem_default = 262144 | |
| net.ipv4.tcp_rmem = 8192 87380 16777216 | |
| net.ipv4.tcp_wmem = 4096 65536 16777216 | |
| net.core.netdev_max_backlog = 30000 | |
| net.ipv4.tcp_congestion_control = htcp | |
| net.ipv4.conf.all.rp_filter = 2 | |
| net.ipv4.ip_forward=1 | |
| EOF | |
| sed -i -E 's/^\s*#?\s*(net.bridge.bridge-nf-call-iptables)\s*=.*/\1 = 1/' /etc/sysctl.d/pve.conf | |
| sed -i -E 's/^\s*#?\s*(net.bridge.bridge-nf-call-ip6tables)\s*=.*/\1 = 1/' /etc/sysctl.d/pve.conf | |
| sysctl --system | |
| apt-get install -y autofs | |
| tee /etc/fstab <<EOF | |
| # <file system> <mount point> <type> <options> <dump> <pass> | |
| /dev/pve/root / ext4 errors=remount-ro 0 1 | |
| UUID=6A67-3481 /boot/efi vfat defaults 0 1 | |
| /dev/pve/swap none swap sw 0 0 | |
| proc /proc proc defaults 0 0 | |
| /dev/disk/by-id/nvme-SAMSUNG_MZVLB512HBJQ-00000_S4GENF1N252160 /media/data xfs defaults 0 1 | |
| /dev/disk/by-id/ata-TOSHIBA_MG08ACA16TE_Z960A0ZKFVGG /media/media-1 xfs defaults 0 1 | |
| /media/media-1 /media/media fuse.mergerfs allow_other,minfreespace=16G,use_ino,dropcacheonclose=true,category.create=mfs 0 1 | |
| EOF | |
| tee /etc/cron.hourly/xfs_fsr <<EOF | |
| #!/bin/sh | |
| xfs_fsr -t 600 | |
| EOF | |
| chmod 755 /etc/cron.hourly/xfs_fsr | |
| systemctl enable fstrim.timer | |
| systemctl restart fstrim.timer | |
| apt-get install -y nfs-common nfs-kernel-server | |
| service nfs-common restart | |
| service nfs-kernel-server restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment