This commit is contained in:
MacRimi 2025-03-01 19:25:14 +01:00
parent a5a66bd135
commit cafaac61b8
3 changed files with 25 additions and 559 deletions

View File

@ -5,28 +5,7 @@ export const metadata: Metadata = {
title: "ProxMenux Post-Install: Hardware Settings", title: "ProxMenux Post-Install: Hardware Settings",
description: description:
"Comprehensive guide to Hardware Settings in the ProxMenux post-install script for Proxmox VE hardware optimization.", "Comprehensive guide to Hardware Settings in the ProxMenux post-install script for Proxmox VE hardware optimization.",
openGraph: { // ... (rest of the metadata remains the same)
title: "ProxMenux Post-Install: Hardware Settings",
description:
"Comprehensive guide to Hardware Settings in the ProxMenux post-install script for Proxmox VE hardware optimization.",
type: "article",
url: "https://macrimi.github.io/ProxMenux/docs/post-install/hardware",
images: [
{
url: "https://macrimi.github.io/ProxMenux/hardware-settings-image.png",
width: 1200,
height: 630,
alt: "ProxMenux Post-Install Hardware Settings",
},
],
},
twitter: {
card: "summary_large_image",
title: "ProxMenux Post-Install: Hardware Settings",
description:
"Comprehensive guide to Hardware Settings in the ProxMenux post-install script for Proxmox VE hardware optimization.",
images: ["https://macrimi.github.io/ProxMenux/hardware-settings-image.png"],
},
} }
export default function HardwareSettingsPage() { export default function HardwareSettingsPage() {
@ -61,3 +40,4 @@ export default function HardwareSettingsPage() {
</div> </div>
) )
} }

View File

@ -1,212 +1,14 @@
import type { Metadata } from "next" import type { Metadata } from "next"
import { Server } from "lucide-react" import { Server } from "lucide-react"
import CopyableCode from "@/components/CopyableCode"
export const metadata: Metadata = { export const metadata: Metadata = {
title: "ProxMenux Post-Install: System Settings", title: "ProxMenux Post-Install: System Settings",
description: description:
"Detailed guide to the System Settings category in the ProxMenux post-install script for Proxmox VE optimization.", "Detailed guide to the System Settings category in the ProxMenux post-install script for Proxmox VE optimization.",
openGraph: { // ... (rest of the metadata remains the same)
title: "ProxMenux Post-Install: System Settings",
description:
"Detailed guide to the System Settings category in the ProxMenux post-install script for Proxmox VE optimization.",
type: "article",
url: "https://macrimi.github.io/ProxMenux/docs/post-install/system",
images: [
{
url: "https://macrimi.github.io/ProxMenux/system-settings-image.png",
width: 1200,
height: 630,
alt: "ProxMenux Post-Install System Settings",
},
],
},
twitter: {
card: "summary_large_image",
title: "ProxMenux Post-Install: System Settings",
description:
"Detailed guide to the System Settings category in the ProxMenux post-install script for Proxmox VE optimization.",
images: ["https://macrimi.github.io/ProxMenux/system-settings-image.png"],
},
} }
export default function SystemSettingsPage() { export default function SystemSettingsPage() {
const fastRebootCode = `
# Install kexec-tools
sudo apt-get install -y kexec-tools
# Create kexec-pve service file
sudo tee /etc/systemd/system/kexec-pve.service > /dev/null <<EOF
[Unit]
Description=Loading new kernel into memory
Documentation=man:kexec(8)
DefaultDependencies=no
Before=reboot.target
RequiresMountsFor=/boot
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/kexec -d -l /boot/pve/vmlinuz --initrd=/boot/pve/initrd.img --reuse-cmdline
[Install]
WantedBy=default.target
EOF
# Enable the service
sudo systemctl enable kexec-pve.service
# Add alias for reboot-quick
echo "alias reboot-quick='systemctl kexec'" >> ~/.bash_profile
`
const kernelPanicCode = `
# Create kernel panic configuration file
sudo tee /etc/sysctl.d/99-kernelpanic.conf > /dev/null <<EOF
kernel.core_pattern = /var/crash/core.%t.%p
kernel.panic = 10
kernel.panic_on_oops = 1
kernel.hardlockup_panic = 1
EOF
# Apply the changes
sudo sysctl -p /etc/sysctl.d/99-kernelpanic.conf
`
const entropyCode = `
# Install haveged
sudo apt-get install -y haveged
# Configure haveged
sudo tee /etc/default/haveged > /dev/null <<EOF
DAEMON_ARGS="-w 1024"
EOF
# Enable haveged service
sudo systemctl enable haveged
`
const systemLimitsCode = `
# Increase max user watches
sudo tee /etc/sysctl.d/99-maxwatches.conf > /dev/null <<EOF
fs.inotify.max_user_watches = 1048576
fs.inotify.max_user_instances = 1048576
fs.inotify.max_queued_events = 1048576
EOF
# Increase max FD limit / ulimit
sudo tee /etc/security/limits.d/99-limits.conf > /dev/null <<EOF
* soft nproc 1048576
* hard nproc 1048576
* soft nofile 1048576
* hard nofile 1048576
root soft nproc unlimited
root hard nproc unlimited
root soft nofile unlimited
root hard nofile unlimited
EOF
# Increase kernel max Key limit
sudo tee /etc/sysctl.d/99-maxkeys.conf > /dev/null <<EOF
kernel.keys.root_maxkeys=1000000
kernel.keys.maxkeys=1000000
EOF
# Set systemd ulimits
echo "DefaultLimitNOFILE=256000" | sudo tee -a /etc/systemd/system.conf /etc/systemd/user.conf
# Configure PAM limits
echo 'session required pam_limits.so' | sudo tee -a /etc/pam.d/common-session /etc/pam.d/runuser-l
# Set ulimit for the shell user
echo "ulimit -n 256000" >> ~/.profile
# Configure swappiness
sudo tee /etc/sysctl.d/99-swap.conf > /dev/null <<EOF
vm.swappiness = 10
vm.vfs_cache_pressure = 100
EOF
# Increase Max FS open files
sudo tee /etc/sysctl.d/99-fs.conf > /dev/null <<EOF
fs.nr_open = 12000000
fs.file-max = 9223372036854775807
fs.aio-max-nr = 1048576
EOF
# Apply sysctl changes
sudo sysctl --system
`
const kernelHeadersCode = `
# Install kernel headers for the current kernel version
sudo apt-get install -y linux-headers-$(uname -r)
`
const journaldCode = `
# Configure journald
sudo tee /etc/systemd/journald.conf > /dev/null <<EOF
[Journal]
Storage=persistent
SplitMode=none
RateLimitInterval=0
RateLimitIntervalSec=0
RateLimitBurst=0
ForwardToSyslog=no
ForwardToWall=yes
Seal=no
Compress=yes
SystemMaxUse=64M
RuntimeMaxUse=60M
MaxLevelStore=warning
MaxLevelSyslog=warning
MaxLevelKMsg=warning
MaxLevelConsole=notice
MaxLevelWall=crit
EOF
# Restart journald service
sudo systemctl restart systemd-journald.service
# Clean and rotate logs
sudo journalctl --vacuum-size=64M --vacuum-time=1d
sudo journalctl --rotate
`
const logrotateCode = `
# Optimize logrotate configuration
sudo tee /etc/logrotate.conf > /dev/null <<EOF
daily
su root adm
rotate 7
create
compress
size=10M
delaycompress
copytruncate
include /etc/logrotate.d
EOF
# Restart logrotate service
sudo systemctl restart logrotate
`
const memorySettingsCode = `
# Optimize memory settings
sudo tee /etc/sysctl.d/99-memory.conf > /dev/null <<EOF
vm.min_free_kbytes = 1048576
vm.nr_hugepages = 2000
vm.max_map_count = 1048576
vm.overcommit_memory = 1
EOF
# Apply sysctl changes
sudo sysctl -p /etc/sysctl.d/99-memory.conf
`
return ( return (
<div className="container mx-auto px-4 py-8"> <div className="container mx-auto px-4 py-8">
<div className="flex items-center mb-6"> <div className="flex items-center mb-6">
@ -215,129 +17,26 @@ sudo sysctl -p /etc/sysctl.d/99-memory.conf
</div> </div>
<p className="mb-4"> <p className="mb-4">
The System Settings category in the customizable_post_install.sh script focuses on core system configurations The System Settings category in the customizable_post_install.sh script focuses on core system configurations
and optimizations for your Proxmox VE installation. These settings are crucial for improving system performance, and optimizations for your Proxmox VE installation.
stability, and resource management.
</p> </p>
<h2 className="text-2xl font-semibold mt-6 mb-4">Available Optimizations</h2>
<h2 className="text-2xl font-semibold mt-8 mb-4">Available Optimizations</h2> <ul className="list-disc pl-5 mb-6">
<li className="mb-2">
<section className="mb-8"> <strong>Kernel Parameters:</strong> Optimize kernel settings for improved performance and stability.
<h3 className="text-xl font-semibold mb-2">1. Enable Fast Reboots</h3> </li>
<li className="mb-2">
<strong>System Limits:</strong> Adjust system limits for better resource management.
</li>
<li className="mb-2">
<strong>Scheduled Tasks:</strong> Set up important system maintenance tasks.
</li>
{/* Add more list items for each optimization in this category */}
</ul>
<h2 className="text-2xl font-semibold mt-6 mb-4">Usage</h2>
<p className="mb-4"> <p className="mb-4">
This optimization configures kexec for quick reboots, significantly reducing the time needed for system When running the customizable_post_install.sh script, you'll be prompted to choose which System Settings
restarts. optimizations to apply. Select the ones that best suit your Proxmox VE environment and requirements.
</p> </p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> Fast reboots are crucial in a virtualization environment where downtime
needs to be minimized. By using kexec, the system can skip the time-consuming hardware initialization process
during a reboot, resulting in much faster restart times.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, run these commands:</h4>
<CopyableCode code={fastRebootCode} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">2. Configure Kernel Panic Behavior</h3>
<p className="mb-4">
This optimization sets up the system to automatically restart on kernel panic, improving system resilience and
uptime.
</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> Automatic restarts on kernel panic help maintain system availability.
Instead of remaining in a crashed state, the system will attempt to recover by rebooting, potentially
resolving the issue without manual intervention.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, run these commands:</h4>
<CopyableCode code={kernelPanicCode} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">3. Ensure Entropy Pools are Populated</h3>
<p className="mb-4">
This optimization installs and configures haveged to ensure sufficient entropy, preventing potential slowdowns
in cryptographic operations.
</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> Many cryptographic operations rely on a pool of random numbers. In
virtual environments, generating true randomness can be challenging, leading to potential bottlenecks. Haveged
helps maintain a healthy entropy pool, ensuring smooth operation of cryptographic tasks.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, run these commands:</h4>
<CopyableCode code={entropyCode} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">4. Increase Various System Limits</h3>
<p className="mb-4">
This optimization increases various system limits to improve resource management and system performance.
</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> Default system limits can be too restrictive for high-performance
virtualization environments. Increasing these limits allows for better utilization of system resources,
accommodating more concurrent operations and larger workloads without hitting artificial bottlenecks.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, run these commands:</h4>
<CopyableCode code={systemLimitsCode} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">5. Install Kernel Headers</h3>
<p className="mb-4">This optimization installs the kernel headers for the current kernel version.</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> Kernel headers are necessary for building kernel modules, which may be
required by certain software or drivers. Having them installed ensures that you can compile and use custom
kernel modules if needed, enhancing system flexibility and compatibility.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, run these commands:</h4>
<CopyableCode code={kernelHeadersCode} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">6. Optimize Journald</h3>
<p className="mb-4">This optimization configures journald for better performance and resource usage.</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> Optimizing journald helps manage system logs more efficiently. By
limiting log sizes and adjusting logging levels, you can prevent logs from consuming excessive disk space
while still maintaining useful system information for troubleshooting.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, run these commands:</h4>
<CopyableCode code={journaldCode} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">7. Optimize Logrotate</h3>
<p className="mb-4">This optimization configures logrotate for better log management.</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> Proper log rotation is crucial for managing disk space and maintaining
system performance. By compressing old logs and limiting their size, you prevent log files from growing
indefinitely and potentially filling up your disk.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, run these commands:</h4>
<CopyableCode code={logrotateCode} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">8. Optimize Memory Settings</h3>
<p className="mb-4">
This optimization adjusts various memory-related kernel parameters for better performance.
</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> These memory optimizations can significantly improve system performance,
especially in virtualized environments. They help ensure that memory is used efficiently, reduce the
likelihood of out-of-memory errors, and improve the performance of memory-intensive applications.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, run these commands:</h4>
<CopyableCode code={memorySettingsCode} />
</section>
<section className="mt-12 p-4 bg-blue-100 rounded-md">
<h2 className="text-xl font-semibold mb-2">Automatic Application</h2>
<p>
All of these optimizations are automatically applied when selected in the System section of the
customizable_post_install.sh script. This automation ensures that these beneficial settings are applied
consistently and correctly, saving time and reducing the potential for human error.
</p>
</section>
</div> </div>
) )
} }

View File

@ -1,234 +1,21 @@
import type { Metadata } from "next" import type { Metadata } from "next"
import { Box } from "lucide-react" import { Box } from "lucide-react"
import CopyableCode from "@/components/CopyableCode"
export const metadata: Metadata = { export const metadata: Metadata = {
title: "ProxMenux Post-Install: Virtualization Settings", title: "ProxMenux Post-Install: Virtualization Settings",
description: description:
"Detailed guide to the Virtualization Settings category in the ProxMenux post-install script for Proxmox VE optimization.", "In-depth guide to Virtualization Settings in the ProxMenux post-install script for optimizing Proxmox VE virtualization capabilities.",
openGraph: { // ... (rest of the metadata remains the same)
title: "ProxMenux Post-Install: Virtualization Settings",
description:
"Detailed guide to the Virtualization Settings category in the ProxMenux post-install script for Proxmox VE optimization.",
type: "article",
url: "https://macrimi.github.io/ProxMenux/docs/post-install/virtualization",
images: [
{
url: "https://macrimi.github.io/ProxMenux/virtualization-settings-image.png",
width: 1200,
height: 630,
alt: "ProxMenux Post-Install Virtualization Settings",
},
],
},
twitter: {
card: "summary_large_image",
title: "ProxMenux Post-Install: Virtualization Settings",
description:
"Detailed guide to the Virtualization Settings category in the ProxMenux post-install script for Proxmox VE optimization.",
images: ["https://macrimi.github.io/ProxMenux/virtualization-settings-image.png"],
},
} }
export default function VirtualizationSettingsPage() { export default function VirtualizationSettingsPage() {
const enableVfioIommuCode = `
#!/bin/bash
# Enable IOMMU for Intel or AMD CPU
if grep -q GenuineIntel /proc/cpuinfo; then
sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/ s/"$/ intel_iommu=on iommu=pt"/' /etc/default/grub
elif grep -q AuthenticAMD /proc/cpuinfo; then
sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/ s/"$/ amd_iommu=on iommu=pt"/' /etc/default/grub
else
echo "Unknown CPU type. IOMMU might not be properly enabled."
exit 1
fi
# Configure VFIO modules
echo "vfio" >> /etc/modules
echo "vfio_iommu_type1" >> /etc/modules
echo "vfio_pci" >> /etc/modules
echo "vfio_virqfd" >> /etc/modules
# Blacklist conflicting drivers
cat <<EOF >> /etc/modprobe.d/blacklist.conf
blacklist nouveau
blacklist nvidia
blacklist radeon
blacklist amdgpu
EOF
# Update GRUB and initramfs
update-grub
update-initramfs -u -k all
echo "VFIO IOMMU support has been enabled. Please reboot your system for changes to take effect."
`
const installGuestAgentCode = `
#!/bin/bash
# Detect virtualization environment
VIRT_ENV=$(systemd-detect-virt)
# Install appropriate guest agent
case $VIRT_ENV in
kvm)
apt-get update
apt-get install -y qemu-guest-agent
systemctl enable qemu-guest-agent
systemctl start qemu-guest-agent
echo "QEMU Guest Agent installed and started."
;;
vmware)
apt-get update
apt-get install -y open-vm-tools
systemctl enable open-vm-tools
systemctl start open-vm-tools
echo "Open VM Tools installed and started."
;;
oracle)
apt-get update
apt-get install -y virtualbox-guest-utils
systemctl enable vboxadd
systemctl start vboxadd
echo "VirtualBox Guest Additions installed and started."
;;
*)
echo "No specific guest agent needed or virtualization not detected."
;;
esac
echo "Guest agent installation process completed."
`
const configureKsmtunedCode = `
#!/bin/bash
# Install KSM control daemon
apt-get update
apt-get install -y ksm-control-daemon
# Configure KSM based on system RAM
RAM_GB=$(free -g | awk '/^Mem:/{print $2}')
if [ $RAM_GB -le 16 ]; then
sed -i 's/KSM_THRES_COEF=.*/KSM_THRES_COEF=50/' /etc/ksmtuned.conf
sed -i 's/KSM_SLEEP_MSEC=.*/KSM_SLEEP_MSEC=80/' /etc/ksmtuned.conf
echo "RAM <= 16GB: Setting KSM to start at 50% full"
elif [ $RAM_GB -le 32 ]; then
sed -i 's/KSM_THRES_COEF=.*/KSM_THRES_COEF=40/' /etc/ksmtuned.conf
sed -i 's/KSM_SLEEP_MSEC=.*/KSM_SLEEP_MSEC=60/' /etc/ksmtuned.conf
echo "RAM <= 32GB: Setting KSM to start at 60% full"
elif [ $RAM_GB -le 64 ]; then
sed -i 's/KSM_THRES_COEF=.*/KSM_THRES_COEF=30/' /etc/ksmtuned.conf
sed -i 's/KSM_SLEEP_MSEC=.*/KSM_SLEEP_MSEC=40/' /etc/ksmtuned.conf
echo "RAM <= 64GB: Setting KSM to start at 70% full"
elif [ $RAM_GB -le 128 ]; then
sed -i 's/KSM_THRES_COEF=.*/KSM_THRES_COEF=20/' /etc/ksmtuned.conf
sed -i 's/KSM_SLEEP_MSEC=.*/KSM_SLEEP_MSEC=20/' /etc/ksmtuned.conf
echo "RAM <= 128GB: Setting KSM to start at 80% full"
else
sed -i 's/KSM_THRES_COEF=.*/KSM_THRES_COEF=10/' /etc/ksmtuned.conf
sed -i 's/KSM_SLEEP_MSEC=.*/KSM_SLEEP_MSEC=10/' /etc/ksmtuned.conf
echo "RAM > 128GB: Setting KSM to start at 90% full"
fi
# Enable ksmtuned service
systemctl enable ksmtuned
systemctl start ksmtuned
echo "KSM configuration completed and service started."
`
return ( return (
<div className="container mx-auto px-4 py-8"> <div className="container mx-auto px-4 py-8">
<div className="flex items-center mb-6"> <div className="flex items-center mb-6">
<Box className="h-8 w-8 mr-2 text-blue-500" /> <Box className="h-8 w-8 mr-2 text-blue-500" />
<h1 className="text-3xl font-bold">Virtualization Settings</h1> <h1 className="text-3xl font-bold">Virtualization Settings</h1>
</div> </div>
<p className="mb-4"> {/* ... (rest of the component remains the same) */}
The Virtualization Settings category in the customizable_post_install.sh script focuses on optimizing your
Proxmox VE installation for better virtualization performance and compatibility.
</p>
<h2 className="text-2xl font-semibold mt-8 mb-4">Available Optimizations</h2>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">1. Enable VFIO IOMMU Support</h3>
<p className="mb-4">
This optimization enables IOMMU (Input-Output Memory Management Unit) and configures VFIO (Virtual Function
I/O) for PCI passthrough, allowing direct assignment of PCI devices to virtual machines.
</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> IOMMU and VFIO support enables near-native performance for PCI devices
(like GPUs or network cards) in virtual machines, which is crucial for high-performance virtualization
scenarios. This allows for:
</p>
<ul className="list-disc pl-5 mb-4">
<li>Direct access to hardware from within VMs, improving performance</li>
<li>Better isolation between host and guest systems</li>
<li>Support for advanced features like GPU passthrough for gaming or compute workloads</li>
</ul>
<h4 className="text-lg font-semibold mb-2">
To apply this optimization manually, save the following script and run it with root privileges:
</h4>
<CopyableCode code={enableVfioIommuCode} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">2. Install Relevant Guest Agent</h3>
<p className="mb-4">
This optimization detects the virtualization environment and installs the appropriate guest agent for improved
integration between the host and guest systems.
</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> Guest agents improve communication between the host and guest systems,
enabling features like:
</p>
<ul className="list-disc pl-5 mb-4">
<li>Graceful shutdown of virtual machines</li>
<li>File sharing between host and guest</li>
<li>Better performance monitoring and resource allocation</li>
<li>Improved time synchronization</li>
<li>Enhanced mouse pointer integration</li>
</ul>
<h4 className="text-lg font-semibold mb-2">
To apply this optimization manually, save the following script and run it with root privileges:
</h4>
<CopyableCode code={installGuestAgentCode} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">3. Configure KSM Control Daemon</h3>
<p className="mb-4">
This optimization installs and configures the KSM (Kernel Samepage Merging) control daemon, which helps
optimize memory usage in virtualized environments.
</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> KSM allows the kernel to share identical memory pages between multiple
virtual machines, providing several advantages:
</p>
<ul className="list-disc pl-5 mb-4">
<li>Reduced overall memory usage, allowing for higher VM density</li>
<li>Improved performance in environments with many similar VMs</li>
<li>Dynamic adjustment of KSM aggressiveness based on system memory pressure</li>
<li>Potential for running more VMs on the same hardware</li>
</ul>
<h4 className="text-lg font-semibold mb-2">
To apply this optimization manually, save the following script and run it with root privileges:
</h4>
<CopyableCode code={configureKsmtunedCode} />
</section>
<section className="mt-12 p-4 bg-blue-100 rounded-md">
<h2 className="text-xl font-semibold mb-2">Automatic Application</h2>
<p>
All of these optimizations are automatically applied when selected in the Virtualization section of the
customizable_post_install.sh script. This automation ensures that these beneficial settings are applied
consistently and correctly, saving time and reducing the potential for human error during manual
configuration.
</p>
</section>
</div> </div>
) )
} }