{"id":13495893,"url":"https://github.com/extremeshok/xshok-proxmox","last_synced_at":"2025-05-16T15:03:58.251Z","repository":{"id":39873712,"uuid":"75236723","full_name":"extremeshok/xshok-proxmox","owner":"extremeshok","description":"proxmox (pve) post installation optimizing and helper scripts","archived":false,"fork":false,"pushed_at":"2023-05-05T12:49:35.000Z","size":425,"stargazers_count":842,"open_issues_count":12,"forks_count":239,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-04-03T11:11:29.183Z","etag":null,"topics":["debian","install","proxmox","proxmox-cluster","proxmox-ve","scripts"],"latest_commit_sha":null,"homepage":"https://eXtremeSHOK.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/extremeshok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"extremeshok","custom":["https://paypal.me/AdrianKriel","https://www.extremeshok.com"]}},"created_at":"2016-11-30T23:35:04.000Z","updated_at":"2025-03-29T16:45:58.000Z","dependencies_parsed_at":"2023-10-20T20:51:23.888Z","dependency_job_id":null,"html_url":"https://github.com/extremeshok/xshok-proxmox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremeshok%2Fxshok-proxmox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremeshok%2Fxshok-proxmox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremeshok%2Fxshok-proxmox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremeshok%2Fxshok-proxmox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extremeshok","download_url":"https://codeload.github.com/extremeshok/xshok-proxmox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248564968,"owners_count":21125412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debian","install","proxmox","proxmox-cluster","proxmox-ve","scripts"],"created_at":"2024-07-31T19:01:39.377Z","updated_at":"2025-04-12T11:50:10.035Z","avatar_url":"https://github.com/extremeshok.png","language":"Shell","funding_links":["https://github.com/sponsors/extremeshok","https://paypal.me/AdrianKriel","https://www.extremeshok.com"],"categories":["Shell","Tools","debian"],"sub_categories":[],"readme":"# xshok-proxmox :: eXtremeSHOK.com Proxmox (pve)\n\nScripts for working with and optimizing proxmox\n\n## Maintained and provided by \u003chttps://eXtremeSHOK.com\u003e\n\n### Please Submit Patches / Pull requests\n\n## Optimization / Post Install Script (install-post.sh aka postinstall.sh) *run once*\nTurns a fresh proxmox install into an optimised proxmox host\n*not required if server setup with installimage-proxmox.sh*\n\n'reboot-quick' command which uses kexec to boot the latest kernel, its a fast method of rebooting, without needing to do a hardware reboot\n\n* Disable the enterprise repo, enable the public repo, Add non-free sources\n* Fixes known bugs (public key missing, max user watches, etc)\n* Update the system\n* Detect AMD EPYC CPU and Apply Fixes\n* Force APT to use IPv4\n* Update proxmox and install various system utils\n* Customise bashrc\n* add the latest ceph provided by proxmox\n* Disable portmapper / rpcbind (security)\n* Ensure Entropy Pools are Populated, prevents slowdowns whilst waiting for entropy\n* Protect the web interface with fail2ban\n* Detect if is running in a virtual machine and install the relavant guest agent\n* Install ifupdown2 for a virtual internal network allows rebootless networking changes (not compatible with openvswitch-switch)\n* Limit the size and optimise journald\n* Install kernel source headers\n* Install kexec, allows for quick reboots into the latest updated kernel set as primary in the boot-loader.\n* Ensure ksmtuned (ksm-control-daemon) is enabled and optimise according to ram size\n* Set language, if chnaged will disable XS_NOAPTLANG\n* Increase max user watches, FD limit, FD ulimit, max key limit, ulimits\n* Optimise logrotate\n* Lynis security scan tool by Cisofy\n* Increase Max FS open files\n* Optimise Memory\n* Pretty MOTD BANNER\n* Enable Network optimising\n* Save bandwidth and skip downloading additional languages, requires XS_LANG=\"en_US.UTF-8\"\n* Disable enterprise proxmox repo\n* Remove subscription banner\n* Install openvswitch for a virtual internal network\n* Detect if this is an OVH server and install OVH Real Time Monitoring\n* Set pigz to replace gzip, 2x faster gzip compression\n* Bugfix: high swap usage with low memory usage\n* Enable TCP BBR congestion control\n* Enable TCP fastopen\n* Enable testing proxmox repo\n* Automatically Synchronize the time\n* Set Timezone, empty = set automatically by IP\n* Install common system utilities\n* Increase vzdump backup speed\n* Optimise ZFS arc size accoring to memory size\n* Install zfs-auto-snapshot\n\nhttps://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/install-post.sh\n\nreturn value is 0\n\n```\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/install-post.sh -c -O install-post.sh \u0026\u0026 bash install-post.sh \u0026\u0026 rm install-post.sh\n```\n\n##  TO SET AND USE YOUR OWN OPTIONS (using xs-post-install.env)\nUser Defined Options for (install-post.sh) post-installation script for Proxmox are set in the xs-install-post.env, see the sample : xs-install-post.env.sample\n```\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/xs-install-post.env.sample -c -O xs-install-post.env\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/install-post.sh -c -O install-post.sh\nnano xs-install-post.env\nbash install-post.sh\n```\n##  TO SET AND USE YOUR OWN OPTIONS (using ENV)\nExamnple to disable the MOTD banner\n```\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/install-post.sh -c -O install-post.sh\nexport XS_MOTD=\"no\"\nbash install-post.sh\n```\n\n## Install Proxmox Recommendations\nRecommeneded partitioning scheme:\n* Raid 1 (mirror) 40 000MB ext4 /\n* Raid 1 (mirror) 30 000MB ext4 /xshok/zfs-cache *only create if an ssd and there is 1+ unused hdd which will be made into a zfspool*\n* Raid 1 (mirror) 5 000MB ext4 /xshok/zfs-slog *only create if an ssd and there is 1+ unused hdd which will be made into a zfspool*\n* SWAP\n* * HDD less than 130gb = 16GB swap\n* * HDD more than 130GB and RAM less than 64GB = 32GB swap\n* * HDD more than 130GB and RAM more than 64GB = 64GB swap\n* Remaining for lv\txfs\t/var/lib/vz (LVM)\n\n# Hetzner Proxmox Installation Guide #\nsee *hetzner* folder\n\n# OVH Proxmox Installation Guide #\nsee *ovh* folder\n\n# ------- SCRIPTS ------\n\n## Convert from Debian 11 to Proxmox 7 (debian11-2-proxmox7.sh) *optional*\nAssumptions: Debian11 installed with a valid FQDN hostname set\n* Tested on KVM, VirtualBox and Dedicated Server\n* Will automatically detect cloud-init and disable.\n* Will automatically generate a correct /etc/hosts\n* Note: will automatically run the install-post.sh script\n```\ncurl -O https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/debian-2-proxmox/debian11-2-proxmox7.sh \u0026\u0026 chmod +x debian11-2-proxmox7.sh\n./debian11-2-proxmox7.sh\n```\n## Convert from Debian 10 to Proxmox 6 (debian10-2-proxmox6.sh) *optional*\n```\ncurl -O https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/debian-2-proxmox/debian10-2-proxmox6.sh \u0026\u0026 chmod +x debian10-2-proxmox6.sh\n./debian10-2-proxmox6.sh\n```\n## Convert from Debian 9 to Proxmox 5 (debian9-2-proxmox5.sh) *optional*\n```\ncurl -O https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/debian-2-proxmox/debian9-2-proxmox5.sh \u0026\u0026 chmod +x debian9-2-proxmox5.sh\n./debian9-2-proxmox5.sh\n```\n\n## Enable Docker support for an LXC container (pve-enable-lxc-docker.sh) *optional*\nThere can be security implications as the LXC container is running in a higher privileged mode.\n```\ncurl https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/helpers/pve-enable-lxc-docker.sh --output /usr/sbin/pve-enable-lxc-docker \u0026\u0026 chmod +x /usr/sbin/pve-enable-lxc-docker\npve-enable-lxc-docker container_id\n```\n\n## Convert from LVM to ZFS (lvm-2-zfs.sh) *run once*\nConverts the a MDADM BASED LVM into a ZFS raid 1 (mirror)\n* Defaults to mount point: /var/lib/vz\n* Optional: specify the LVM_MOUNT_POINT ( ./lvm-2-zfs.sh LVM_MOUNT_POINT )\n* Creates the following storage/rpools\n* zfsbackup (rpool/backup)\n* zfsvmdata (rpool/vmdata)\n* /var/lib/vz/tmp_backup (rpool/tmp_backup)\n*\n* Will automatically detect the required raid level and optimise.\n* 1 Drive = zfs\n* 2 Drives = mirror\n* 3-5 Drives = raidz-1\n* 6-11 Drives = raidz-2\n* 11+ Drives = raidz-3\n\n**NOTE: WILL  DESTROY ALL DATA ON LVM_MOUNT_POINT**\n```\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/zfs/lvm-2-zfs.sh -c -O lvm-2-zfs.sh \u0026\u0026 chmod +x lvm-2-zfs.sh\n./lvm-2-zfs.sh\n```\n\n## Create ZFS from devices (createzfs.sh) *optional*\nCreates a zfs pool from specified devices\n* Will automatically detect the required raid level and optimise\n* 1 Drive = zfs (single)\n* 2 Drives = mirror (raid1)\n* 3-5 Drives = raidz-1 (raid5)\n* 6-11 Drives = raidz-2 (raid6)\n* 11+ Drives = raidz-3 (raid7)\n\n**NOTE: WILL  DESTROY ALL DATA ON SPECIFIED DEVICES**\n```\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/zfs/createzfs.sh -c -O createzfs.sh \u0026\u0026 chmod +x createzfs.sh\n./createzfs.sh poolname /dev/device1 /dev/device2\n```\n\n## Create ZFS cache and slog from /xshok/zfs-cache and /xshok/zfs-slog partitions and adds them to a zpool (xshok_slog_cache-2-zfs.sh) *optional*\nCreates a zfs pool from specified devices\n* Will automatically mirror the slog and stripe the cache if there are multiple drives\n\n**NOTE: WILL  DESTROY ALL DATA ON SPECIFIED PARTITIONS**\n```\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/zfs/xshok_slog_cache-2-zfs.sh -c -O xshok_slog_cache-2-zfs.sh \u0026\u0026 chmod +x xshok_slog_cache-2-zfs.sh\n./xshok_slog_cache-2-zfs.sh poolname\n```\n\n## CREATES A ROUTED vmbr0 AND NAT vmbr1 NETWORK CONFIGURATION FOR PROXMOX (network-configure.sh) **run once**\nAutodetects the correct settings (interface, gatewat, netmask, etc)\nSupports IPv4 and IPv6, Private Network uses 10.10.10.1/24\nAlso installs and properly configures the isc-dhcp-server to allow for DHCP on the vmbr1 (NAT)\nROUTED (vmbr0):\n   All traffic is routed via the main IP address and uses the MAC address of the physical interface.\n   VM's can have multiple IP addresses and they do NOT require a MAC to be set for the IP via service provider\n\n NAT (vmbr1):\n   Allows a VM to have internet connectivity without requiring its own IP address\n   Assignes 10.10.10.100 - 10.10.10.200 via DHCP\n\n Public IP's can be assigned via DHCP, adding a host define to the /etc/dhcp/hosts.public file\n\n Tested on OVH and Hetzner based servers\n\nALSO CREATES A NAT Private Network as vmbr1\n\n NOTE: WILL OVERWRITE /etc/network/interfaces\n A backup will be created as /etc/network/interfaces.timestamp\n```\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/networking/network-configure.sh -c -O network-configure.sh \u0026\u0026 chmod +x network-configure.sh\n./network-configure.sh \u0026\u0026 rm network-configure.sh\n```\n\n##  Creates default routes to allow for extra ip ranges to be used (network-addiprange.sh) *optional*\nIf no interface is specified the default gateway interface will be detected and used.\n```\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/networking/network-addiprange.sh -c -O network-addiprange.sh \u0026\u0026 chmod +x network-addiprange.sh\n./network-addiprange.sh ip.xx.xx.xx/cidr interface_optional\n```\n\n## Create Private mesh vpn/network (tincvpn.sh)\ntinc private mesh vpn/network which supports multicast, ideal for private cluster communication\n```\nwget https://raw.githubusercontent.com/extremeshok/xshok-proxmox/master/networking/tincvpn.sh -c -O tincvpn.sh \u0026\u0026 chmod +x tincvpn.sh\n./tincvpn.sh -h\n```\n### Example for 3 node Cluster\n# cat /etc/hosts\n# global ips for tinc servers\n# 11.11.11.11 host1\n# 22.22.22.22 host2\n# 33.33.33.33 host3\n#### First Host (hostname: host1)\n```\nbash tincvpn.sh -i 1 -c host2\n```\n#### Second Host (hostname: host2)\n```\nbash tincvpn.sh -i 2 -c host3\n```\n#### Third Host (hostname: host3)\n```\nbash tincvpn.sh -i 3 -c host1\n```\n\n# NOTES\n\n## Alpine Linux KVM / Qemu Agent Client Fix\nRun the following on the guest alpine linux\n```\napk update \u0026\u0026 apk add qemu-guest-agent acpi\necho 'GA_PATH=\"/dev/vport2p1\"' \u003e\u003e /etc/conf.d/qemu-guest-agent\nrc-update add qemu-guest-agent default\nrc-update add acpid default\n/etc/init.d/qemu-guest-agent restart\n```\n\n## Proxmox ACME / Letsencrypt\nRun the following on the proxmox server, ensure you have a valid DNS for the server which resolves\n```\npvenode acme account register default mail@example.invalid\npvenode config set --acme domains=example.invalid\npvenode acme cert order\n```\n\n## ZFS Snapshot Usage\n```\n# list all snapshots\nzfs list -t snapshot\n# create a pre-rollback snapshot\nzfs-auto-snapshot --verbose --label=prerollback -r //\n# rollback to a specific snapshot\nzfs rollback \u003csnapshotname\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextremeshok%2Fxshok-proxmox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextremeshok%2Fxshok-proxmox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextremeshok%2Fxshok-proxmox/lists"}