<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Archiwa Proxmox - soban</title>
	<atom:link href="https://soban.pl/category/proxmox/feed/" rel="self" type="application/rss+xml" />
	<link>https://soban.pl/category/proxmox/</link>
	<description>IT, Linux, Servers, Security</description>
	<lastBuildDate>Tue, 24 Feb 2026 11:10:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Debian 13 (Trixie) → Proxmox VE 9 – Simplified Installation on Pure Debian</title>
		<link>https://soban.pl/install-proxmox-ve-9-on-debian-13-trixie/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Mon, 23 Feb 2026 16:18:39 +0000</pubDate>
				<category><![CDATA[Proxmox]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=726</guid>

					<description><![CDATA[<p>Proxmox VE 9 is based on Debian 13 (Trixie) and introduces a newer kernel, updated LXC, QEMU and improved virtualization stack. This guide presents a simplified and automated method to install Proxmox VE 9 on a clean Debian 13 system using two installation scripts. The method follows the same approach as my previous Proxmox 8 [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/install-proxmox-ve-9-on-debian-13-trixie/">Debian 13 (Trixie) → Proxmox VE 9 – Simplified Installation on Pure Debian</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large is-resized"><img fetchpriority="high" decoding="async" width="1024" height="680" src="https://soban.pl/wp-content/uploads/2026/02/image-2-1024x680.png" alt="" class="wp-image-727" style="width:593px;height:auto" srcset="https://soban.pl/wp-content/uploads/2026/02/image-2-1024x680.png 1024w, https://soban.pl/wp-content/uploads/2026/02/image-2-300x199.png 300w, https://soban.pl/wp-content/uploads/2026/02/image-2-768x510.png 768w, https://soban.pl/wp-content/uploads/2026/02/image-2.png 1118w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Proxmox VE 9 is based on Debian 13 (Trixie) and introduces a newer kernel, updated LXC, QEMU and improved virtualization stack. This guide presents a simplified and automated method to install Proxmox VE 9 on a clean Debian 13 system using two installation scripts.</p>



<p>The method follows the same approach as my previous Proxmox 8 on Debian 12 guide, but adapted for Debian 13 and Proxmox VE 9.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<ul class="wp-block-list">
<li>Fresh Debian 13 (Trixie) installation</li>



<li>Root access</li>



<li>Internet connectivity</li>
</ul>



<p>All commands must be executed as root.</p>



<h2 class="wp-block-heading">Part 1 – System Preparation &amp; Proxmox Kernel Installation</h2>



<p>Download the first script:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">wget http://soban.pl/bash/install-proxmox9-part1.sh
chmod +x install-proxmox9-part1.sh
./install-proxmox9-part1.sh</pre></div>



<p>This script:</p>



<ul class="wp-block-list">
<li>Sets hostname and updates /etc/hosts</li>



<li>Installs Proxmox archive keyring (verified via SHA512)</li>



<li>Adds Proxmox VE 9 repository for Debian 13</li>



<li>Performs full system upgrade</li>



<li>Installs proxmox-default-kernel</li>



<li>Reboots the system</li>
</ul>



<h3 class="wp-block-heading">Content of install-proxmox9-part1.sh</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#!/usr/bin/env bash
set -euo pipefail

# Part 1/2: Debian 13 (Trixie) -&gt; Proxmox VE 9
# - sets /etc/hosts
# - adds PVE repo + installs Proxmox archive keyring (verified by SHA512)
# - full-upgrade
# - installs proxmox-default-kernel
# - reboots

log() { echo "[$(date '+%F %T')] $*"; }
die() { echo "ERROR: $*" &gt;&amp;2; exit 1; }

if [[ "$(id -u)" -ne 0 ]]; then
  die "Run as root."
fi

log "=== Proxmox VE 9 install (part 1/2) on Debian 13 Trixie ==="

if ! grep -qi 'trixie' /etc/os-release; then
  log "WARNING: This does not look like Debian 13 (Trixie). Continue at your own risk."
fi

log "Network interfaces (for reference):"
ip -br -c a || true

CURRENT_HOSTNAME="$(hostname)"
CURRENT_IP="$(hostname -I | awk '{print $1}')"

read -r -p "Hostname for this node [${CURRENT_HOSTNAME}]: " HOSTNAME
HOSTNAME="${HOSTNAME:-$CURRENT_HOSTNAME}"

read -r -p "Primary IP for /etc/hosts [${CURRENT_IP}]: " IPADDR
IPADDR="${IPADDR:-$CURRENT_IP}"

if [[ -z "${HOSTNAME}" || -z "${IPADDR}" ]]; then
  die "Hostname/IP cannot be empty."
fi

log "Setting hostname to: ${HOSTNAME}"
hostnamectl set-hostname "${HOSTNAME}"

log "Backing up /etc/hosts -&gt; /etc/hosts.backup"
cp -a /etc/hosts /etc/hosts.backup

log "Writing /etc/hosts (makes hostname resolvable locally)"
cat &gt; /etc/hosts &lt;&lt;EOT
127.0.0.1       localhost
${IPADDR}       ${HOSTNAME}

# IPv6
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOT

log "Installing prerequisites"
apt update
apt install -y wget ca-certificates gnupg

log "Installing Proxmox archive keyring to /usr/share/keyrings/proxmox-archive-keyring.gpg"
KEYRING="/usr/share/keyrings/proxmox-archive-keyring.gpg"
wget -q https://enterprise.proxmox.com/debian/proxmox-release-trixie.gpg -O "${KEYRING}"

log "Verifying SHA512 of keyring"
EXPECTED_SHA512="8678f2327c49276615288d7ca11e7d296bc8a2b96946fe565a9c81e533f9b15a5dbbad210a0ad5cd46d361ff1d3c4bac55844bc296beefa4f88b86e44e69fa51"
ACTUAL_SHA512="$(sha512sum "${KEYRING}" | awk '{print $1}')"

if [[ "${ACTUAL_SHA512}" != "${EXPECTED_SHA512}" ]]; then
  die "Keyring SHA512 mismatch!
Expected: ${EXPECTED_SHA512}
Actual:   ${ACTUAL_SHA512}"
fi

log "Adding Proxmox VE 9 no-subscription repo (Trixie)"
cat &gt; /etc/apt/sources.list.d/pve-install-repo.list &lt;&lt;EOT
deb [arch=amd64 signed-by=/usr/share/keyrings/proxmox-archive-keyring.gpg] http://download.proxmox.com/debian/pve trixie pve-no-subscription
EOT

log "Updating + full-upgrade"
apt update
apt full-upgrade -y

log "Installing Proxmox kernel meta-package: proxmox-default-kernel"
apt install -y proxmox-default-kernel

log "Part 1 done. Rebooting now. After reboot run: ./install-proxmox9-part2.sh"
reboot</pre></div>



<h2 class="wp-block-heading">Part 2 – Proxmox VE 9 Installation</h2>



<p>After reboot, download and execute:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">wget http://soban.pl/bash/install-proxmox9-part2.sh
chmod +x install-proxmox9-part2.sh
./install-proxmox9-part2.sh</pre></div>



<h3 class="wp-block-heading">Content of install-proxmox9-part2.sh</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#!/usr/bin/env bash
set -euo pipefail

# Part 2/2: Debian 13 (Trixie) -&gt; Proxmox VE 9
# - verifies running PVE kernel (unless FORCE=1)
# - installs proxmox-ve + required packages
# - removes Debian kernel packages (keeps pve)
# - updates grub
# - removes os-prober
# - prints URL to GUI

log() { echo "[$(date '+%F %T')] $*"; }
die() { echo "ERROR: $*" &gt;&amp;2; exit 1; }

FORCE="${FORCE:-0}"

if [[ "$(id -u)" -ne 0 ]]; then
  die "Run as root."
fi

log "=== Proxmox VE 9 install (part 2/2) ==="

KERNEL="$(uname -r || true)"
if ! echo "${KERNEL}" | grep -qi 'pve'; then
  if [[ "${FORCE}" != "1" ]]; then
    die "You are NOT running a PVE kernel (uname -r: ${KERNEL}).
Reboot and select the Proxmox kernel first.
If you really want to continue anyway: FORCE=1 ./install-proxmox9-part2.sh"
  else
    log "WARNING: Continuing despite not running PVE kernel because FORCE=1"
  fi
else
  log "OK: running PVE kernel: ${KERNEL}"
fi

log "Update package lists"
apt update

log "Install Proxmox VE packages"
# postfix is optional but commonly installed by docs; choose config during prompts
DEBIAN_FRONTEND=readline apt install -y proxmox-ve postfix open-iscsi chrony

log "Upgrade remaining packages"
apt full-upgrade -y

log "Removing Debian kernel meta-package and non-PVE kernels (best-effort)"
# Remove Debian meta kernel (keeps proxmox kernel)
apt remove -y linux-image-amd64 || true

# Purge any installed linux-image-* that is NOT a pve kernel
mapfile -t KPKGS &lt; &lt;(dpkg -l | awk '/^ii  linux-image-/{print $2}' | grep -vE 'pve|proxmox' || true)
if (( ${#KPKGS[@]} &gt; 0 )); then
  log "Purging non-PVE kernel packages: ${KPKGS[*]}"
  apt purge -y "${KPKGS[@]}" || true
fi

log "Update grub"
update-grub || true

log "Remove os-prober (recommended for servers; avoids odd grub side effects)"
apt remove -y os-prober || true

log "Done. Proxmox UI should be available at:"
IP="$(hostname -I | awk '{print $1}')"
echo "https://${IP}:8006"

log "Login: root + your root password"</pre></div>



<h2 class="wp-block-heading">Accessing the Web Interface</h2>



<p>After completing the second script, open:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">https://YOUR_SERVER_IP:8006</pre></div>



<p>Login with the <strong>root</strong> user and your root password. You may see a certificate warning — this is normal for fresh installations.</p>




<h2 class="wp-block-heading">Troubleshooting – 401 Unauthorized (pve-enterprise repository)</h2>



<p>If after installation or during <code>apt update</code> you encounter the following error:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">Err:8 https://enterprise.proxmox.com/debian/pve trixie InRelease
  401  Unauthorized [IP: 2001:41d0:b00:5900::34 443]
Error: Failed to fetch https://enterprise.proxmox.com/debian/pve/dists/trixie/InRelease  401  Unauthorized
Error: The repository 'https://enterprise.proxmox.com/debian/pve trixie InRelease' is not signed.
Notice: Updating from such a repository can't be done securely, and is therefore disabled by default.</pre></div>



<p>This means the <strong>enterprise repository</strong> is enabled but your system does not have a valid Proxmox subscription.  
If you are using the <em>no-subscription</em> repository (as shown in this guide), you should disable the enterprise repository.</p>



<p>Fix it by running:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">mv /etc/apt/sources.list.d/pve-enterprise.sources \
   /etc/apt/sources.list.d/pve-enterprise.sources.disabled

apt update</pre></div>



<p>After this, the update should complete successfully:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">apt update && apt dist-upgrade -y && apt autoremove -y</pre></div>



<p>If everything is correct, you should see:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">All packages are up to date.</pre></div>


<h2 class="wp-block-heading">Conclusion</h2>



<p>This method provides a clean and controlled way to deploy Proxmox VE 9 directly on Debian 13 without using the ISO installer. It is especially useful for automated environments, labs, and custom infrastructure setups.</p>
<p>Artykuł <a href="https://soban.pl/install-proxmox-ve-9-on-debian-13-trixie/">Debian 13 (Trixie) → Proxmox VE 9 – Simplified Installation on Pure Debian</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Proxmox VM Auto-Upgrade Script (qm + vzdump) with Network Tests and Auto-Restore</title>
		<link>https://soban.pl/proxmox-vm-auto-upgrade-script/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Fri, 23 Jan 2026 15:56:05 +0000</pubDate>
				<category><![CDATA[Patching]]></category>
		<category><![CDATA[Proxmox]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=680</guid>

					<description><![CDATA[<p>Proxmox VM Auto-Upgrade Script (qm + vzdump) with Network Tests and Auto-Restore This article describes a simple (but effective) automation script for Proxmox VE that: Where to download the script You can download the script directly from my website: soban.pl/bash/upgrade_proxmox_qm.sh Required folders Before you run anything, create two folders for scripts and logs: Install the [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/proxmox-vm-auto-upgrade-script/">Proxmox VM Auto-Upgrade Script (qm + vzdump) with Network Tests and Auto-Restore</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full is-resized"><img decoding="async" width="498" height="745" src="https://soban.pl/wp-content/uploads/2026/01/image-1.png" alt="" class="wp-image-681" style="width:452px;height:auto" srcset="https://soban.pl/wp-content/uploads/2026/01/image-1.png 498w, https://soban.pl/wp-content/uploads/2026/01/image-1-201x300.png 201w" sizes="(max-width: 498px) 100vw, 498px" /></figure>



<p>Proxmox VM Auto-Upgrade Script (qm + vzdump) with Network Tests and Auto-Restore</p>



<p>This article describes a simple (but effective) automation script for Proxmox VE that:</p>



<ul class="wp-block-list">
<li>creates a backup of a VM (optional),</li>



<li>starts the VM if it was originally stopped,</li>



<li>runs apt upgrade + reboot inside the VM,</li>



<li>performs network tests before and after the update,</li>



<li>restores from backup automatically if tests fail (optional),</li>



<li>shuts down the VM again if it was originally stopped.</li>
</ul>



<h3 class="wp-block-heading">Where to download the script</h3>



<p>You can download the script directly from my website:</p>



<p><strong>soban.pl/bash/upgrade_proxmox_qm.sh</strong></p>



<h3 class="wp-block-heading">Required folders</h3>



<p>Before you run anything, create two folders for scripts and logs:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">mkdir -p /root/automate_scripts /root/logs</pre></div>



<h3 class="wp-block-heading">Install the script</h3>



<p>Download the file into <code>/root/automate_scripts/</code> and make it executable:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">cd /root/automate_scripts
curl -fsSL -o upgrade_proxmox_qm.sh "https://soban.pl/bash/upgrade_proxmox_qm.sh"
chmod +x /root/automate_scripts/upgrade_proxmox_qm.sh</pre></div>



<h3 class="wp-block-heading">How it works (high level)</h3>



<ul class="wp-block-list">
<li><strong>Backup</strong> (vzdump snapshot + zstd) is executed first (if enabled).</li>



<li>If the VM was <strong>stopped</strong>, the script starts it and waits <strong>WAIT_TIME</strong> seconds.</li>



<li>Runs <strong>network tests BEFORE update</strong>:
		<ul>
			
			
			
			
		</ul>
	





</li>



<li>Executes apt update/upgrade/dist-upgrade/autoremove/clean and finally <strong>reboots</strong> the VM.</li>



<li>Waits again (<strong>WAIT_TIME</strong>) and runs the same tests <strong>AFTER update</strong>.</li>



<li>If tests fail and a backup exists, it performs <strong>qmrestore</strong> automatically.</li>



<li>If the VM was originally stopped, it shuts down the VM at the end.</li>
</ul>



<h3 class="wp-block-heading">Usage</h3>



<p>The script expects exactly two arguments:</p>



<ul class="wp-block-list">
<li><code>VMID</code> &#8211; the Proxmox VM ID</li>



<li><code>TIME_SEC</code> &#8211; how long to wait after start/reboot (in seconds)</li>
</ul>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">/root/automate_scripts/upgrade_proxmox_qm.sh 901 500</pre></div>



<p><strong>Tip:</strong> choose a WAIT_TIME that matches your VM boot time and apt upgrade duration. Typical values are <code>300</code> to <code>1000</code> seconds depending on the VM.</p>



<h3 class="wp-block-heading">Full script (for reference)</h3>



<p>If you prefer to keep everything in one place, below is the full script exactly as used in this setup:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash

WAIT_TIME=$2  # wait time for VM start/restart (in seconds)
DO_BACKUP="y" # 'y' - create backup, 'n' - skip backup
DO_UPDATE="y" # 'y' - run system update, 'n' - skip update

echo "---------------START---------------"
date
echo "-----------------------------------"

# Argument check
if [ "$#" -ne 2 ]; then
    echo "Usage: $0 &lt;VMID&gt; &lt;TIME_SEC&gt;"
    exit 1
fi

VMID="$1"
TARGET_HOSTNAME=$(/usr/sbin/qm list | grep -w "$VMID" | awk '{print $2}')
VM_STATUS=$(/usr/sbin/qm status "$VMID" | awk '{print $2}')
HOST_MACHINE=$(hostname)
WAS_STOPPED=0

if [ "$VM_STATUS" = "stopped" ]; then
    WAS_STOPPED=1
else
    WAS_STOPPED=0
fi

# Create backup if DO_BACKUP is set to 'y'
backup_result="Backup not attempted"
if [ "$DO_BACKUP" = "y" ]; then
    echo "Creating backup for VM $VMID..."
    BACKUP_OUTPUT=$(/usr/bin/vzdump "$VMID" --storage local --mode snapshot --compress zstd)
    BACKUP_FILE=$(echo "$BACKUP_OUTPUT" | grep -oP 'vzdump-qemu-[^\s]+' | tr -d "'")

    if [ -z "$BACKUP_FILE" ]; then
        echo "Backup failed: No backup file created."
        backup_result="Backup created: NOK"
        exit 1
    else
        echo "Backup created successfully: $BACKUP_FILE"
        backup_result="Backup created: OK"
    fi
else
    echo "Backup not attempted (backup is disabled)."
fi

# Start VM if it was originally stopped
if [ "$WAS_STOPPED" -eq 1 ]; then
    echo "Starting VM $VMID for update..."
    /usr/sbin/qm start "$VMID"
    echo "Waiting $WAIT_TIME seconds for VM to start..."
    sleep "$WAIT_TIME"
fi

# Test functions
perform_ping_test() {
    source="$1"
    target="$2"
    if ssh root@"$source" "ping -c 3 -W 2 $target" &gt;/dev/null 2&gt;&amp;1; then
        echo "Ping from $source to $target: OK"
        return 0
    else
        echo "Ping from $source to $target: NOK"
        return 1
    fi
}

test_curl() {
    source="$1"
    target="$2"
    if ssh root@"$source" "curl -s --head --connect-timeout 5 $target" &gt;/dev/null 2&gt;&amp;1; then
        echo "Curl from $source to $target: OK"
        return 0
    else
        echo "Curl from $source to $target: NOK"
        return 1
    fi
}

perform_local_ping_test() {
    source="$1"
    target="$2"
    if ping -c 3 -W 2 "$target" &gt;/dev/null 2&gt;&amp;1; then
        echo "Ping from $source to $target: OK"
        return 0
    else
        echo "Ping from $source to $target: NOK"
        return 1
    fi
}

DEFAULT_GW=$(/sbin/ip route | grep default | awk '{print $3}')

perform_tests() {
    status=0
    perform_local_ping_test "$HOST_MACHINE" "$TARGET_HOSTNAME" || status=1
    perform_ping_test "$TARGET_HOSTNAME" "8.8.8.8" || status=1
    perform_ping_test "$TARGET_HOSTNAME" "$DEFAULT_GW" || status=1
    test_curl "$TARGET_HOSTNAME" "http://google.com" || status=1
    return ${status:-0}
}

# General tests before update
echo "--- General tests BEFORE update ---"
if perform_tests; then
    echo "All network tests before update: OK"
    echo "$backup_result"

    if [ "$backup_result" == "Backup created: OK" ] || [ "$backup_result" == "Backup not attempted" ]; then
        echo "BEFORE status: OK"
    else
        echo "BEFORE status: NOK"
    fi
else
    echo "Some network tests before update: NOK"
    echo "$backup_result"
    echo "BEFORE status: NOK"
    [ "$WAS_STOPPED" -eq 1 ] &amp;&amp; /usr/sbin/qm shutdown "$VMID"
    exit 1
fi
echo "-----------------------------------"

# System update and reboot
update_result="Upgrade system: NOK"
if [ "$DO_UPDATE" = "y" ]; then
    echo "--- Updating VM $VMID ---"
    if ssh root@"$TARGET_HOSTNAME" "/usr/bin/apt update &amp;&amp; \
                          /usr/bin/apt upgrade -y &amp;&amp; \
                          /usr/bin/apt dist-upgrade -y &amp;&amp; \
                          /usr/bin/apt autoremove -y &amp;&amp; \
                          /usr/bin/apt autoclean &amp;&amp; \
                          /usr/bin/apt clean &amp;&amp; \
                          /usr/bin/apt --purge autoremove &amp;&amp; \
                          /sbin/reboot"; then
        echo "---END Updating VM $VMID ---"
        echo "Upgrade system: OK"
        update_result="Upgrade system: OK"
    else
        echo "Upgrade system: NOK"
        update_result="Upgrade system: NOK"
        [ "$WAS_STOPPED" -eq 1 ] &amp;&amp; /usr/sbin/qm shutdown "$VMID"
        echo "Update failed. Exiting."
        exit 1
    fi
fi

# Wait for VM reboot if update was performed
if [ "$DO_UPDATE" = "y" ]; then
    echo "Waiting $WAIT_TIME seconds for VM to reboot..."
    sleep "$WAIT_TIME"
fi

# Tests after reboot if update was performed
if [ "$DO_UPDATE" = "y" ]; then
    echo "--- Network tests AFTER update ---"
    if perform_tests; then
        echo "All network tests after update: OK"
        echo "$update_result"
        echo "AFTER status: OK"
    else
        echo "Some network tests after update: NOK"
        echo "$update_result"
        echo "Attempting to restore from backup..."

        if [ "$DO_BACKUP" = "y" ]; then
            /usr/sbin/qm stop "$VMID"
            /usr/sbin/qmrestore "/var/lib/vz/dump/$BACKUP_FILE" "$VMID" --force

            if [ "$WAS_STOPPED" -eq 1 ]; then
                /usr/sbin/qm shutdown "$VMID"
            fi

            echo "Restore attempt finished. Please check VM status."
            echo "AFTER status: NOK"
        else
            echo "No backup available for restoration. The VM might not function properly after failed update."
            echo "AFTER status: NOK"
        fi
    fi
    echo "-----------------------------------"
fi

# Shut down VM if it was originally stopped
if [ "$WAS_STOPPED" -eq 1 ]; then
    echo "Shutting down VM $VMID (originally stopped)."
    /usr/sbin/qm shutdown "$VMID"
fi

echo "---------------END---------------"
date
echo "-----------------------------------"</pre></div>



<h3 class="wp-block-heading">Cron jobs (weekly schedule + per-VM logs)</h3>



<p>Below is an example crontab that runs upgrades once a week (different VM each weekday) and writes separate logs to <code>/root/logs/</code>.</p>



<p>Edit root crontab:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">crontab -e</pre></div>



<p>Paste rules like these (comments in English):</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">15 0 * * 1 /root/automate_scripts/upgrade_proxmox_qm.sh 901 500 &gt; /root/logs/kali.log 2&gt;&amp;1                 # Monday: upgrade Kali Linux (VMID 901)
15 0 * * 2 /root/automate_scripts/upgrade_proxmox_qm.sh 903 500 &gt; /root/logs/proxmox-test-01.log 2&gt;&amp;1      # Tuesday: upgrade proxmox-test-01 (VMID 903)
15 0 * * 3 /root/automate_scripts/upgrade_proxmox_qm.sh 904 500 &gt; /root/logs/ubuntu-lte.log 2&gt;&amp;1           # Wednesday: upgrade ubuntu-lte (VMID 904)
15 0 * * 4 /root/automate_scripts/upgrade_proxmox_qm.sh 905 1000 &gt; /root/logs/backup-machine.log 2&gt;&amp;1      # Thursday: upgrade backup-machine (VMID 905)</pre></div>



<h3 class="wp-block-heading">Quick checks / troubleshooting</h3>



<ul class="wp-block-list">
<li>Make sure root can SSH into the VM by hostname (the script uses <code>ssh root@&lt;vm-hostname&gt;</code>).</li>



<li>Make sure DNS (or /etc/hosts) resolves the VM hostname correctly from the Proxmox host.</li>



<li>If apt needs user interaction, ensure your VMs are set up for non-interactive upgrades (or pin/hold packages that prompt).</li>
</ul>



<p>That’s it. Drop the script into <code>/root/automate_scripts/</code>, send logs into <code>/root/logs/</code>, and your weekly VM maintenance becomes mostly fire-and-forget.</p>
<p>Artykuł <a href="https://soban.pl/proxmox-vm-auto-upgrade-script/">Proxmox VM Auto-Upgrade Script (qm + vzdump) with Network Tests and Auto-Restore</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Upgrade Proxmox VE 8.x to 9.0 (Debian 12 to Debian 13) – Step-by-Step with Script</title>
		<link>https://soban.pl/how-to-upgrade-proxmox-ve-8-x-to-9-0-debian-12-to-debian-13-step-by-step-with-script/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Mon, 11 Aug 2025 11:51:58 +0000</pubDate>
				<category><![CDATA[Proxmox]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=644</guid>

					<description><![CDATA[<p>Introduction Proxmox VE 9.0 (based on Debian 13 &#8220;Trixie&#8221;) has been released, and it brings updated packages, a new kernel, and improved stability. This guide will walk you through the in-place upgrade from Proxmox VE 8.4.x (Debian 12 &#8220;Bookworm&#8221;) to Proxmox VE 9.0. The process will be automated using a ready-made upgrade script that: Download [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/how-to-upgrade-proxmox-ve-8-x-to-9-0-debian-12-to-debian-13-step-by-step-with-script/">How to Upgrade Proxmox VE 8.x to 9.0 (Debian 12 to Debian 13) – Step-by-Step with Script</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full is-resized"><img decoding="async" width="1024" height="1024" src="https://soban.pl/wp-content/uploads/2025/08/image.png" alt="" class="wp-image-648" style="width:416px;height:auto" srcset="https://soban.pl/wp-content/uploads/2025/08/image.png 1024w, https://soban.pl/wp-content/uploads/2025/08/image-300x300.png 300w, https://soban.pl/wp-content/uploads/2025/08/image-150x150.png 150w, https://soban.pl/wp-content/uploads/2025/08/image-768x768.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Introduction</h2>



<p>Proxmox VE 9.0 (based on Debian 13 &#8220;Trixie&#8221;) has been released, and it brings updated packages, a new kernel, and improved stability. This guide will walk you through the <strong>in-place upgrade</strong> from Proxmox VE 8.4.x (Debian 12 &#8220;Bookworm&#8221;) to Proxmox VE 9.0.</p>



<p>The process will be automated using a ready-made upgrade script that:</p>



<ul class="wp-block-list">
<li>Checks your current version</li>



<li>Runs the <code>pve8to9</code> pre-upgrade check</li>



<li>Backs up your current APT sources</li>



<li>Updates repositories from Bookworm to Trixie</li>



<li>Performs a full dist-upgrade</li>



<li>Logs all changes before and after the upgrade</li>
</ul>



<h2 class="wp-block-heading">Download and run the upgrade script</h2>



<p>You can download the ready upgrade script directly from our server, make it executable, and run it:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">wget https://soban.pl/bash/upgrade-pve8-to-9.sh -O /root/upgrade-pve8-to-9.sh
chmod +x /root/upgrade-pve8-to-9.sh
LOGF="/root/pve8to9.$(date +%F-%H%M%S).nohup.log"; nohup env NO_REBOOT=0 SKIP_PRECHECK=0 /root/upgrade-pve8-to-9.sh &gt; "$LOGF" 2&gt;&amp;1 &amp; echo $! &gt;/run/pve8to9.pid
tail -f "$LOGF"</pre></div>



<p>If you lose connection (which can happen during a Proxmox upgrade), you can follow the logs with:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">tail -f /root/pve-upgrade-latest.log</pre></div>



<p>Be patient and wait for the script to finish — it may take some time.</p>



<h2 class="wp-block-heading">Full script source</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash
# Proxmox VE 8 -&gt; 9 in-place upgrade (Debian 12 "bookworm" -&gt; Debian 13 "trixie")
# Hardened: nuke/lock Enterprise repo, move backups OUT of APT dir, ensure single no-sub,
# robust pve8to9 detection/installation, switch to trixie, non-interactive upgrade, post-boot check.
set -euo pipefail

LOG="/root/pve-upgrade-$(date +%Y%m%d-%H%M%S).log"
SINK="/etc/apt/disabled-sources"        # OUTSIDE of APT scan path
APT_BACKUP_DIR="/root/apt-sources-backup-$(date +%Y%m%d-%H%M%S)"
NO_REBOOT="${NO_REBOOT:-0}"
FORCE_UPGRADE="${FORCE_UPGRADE:-0}"
SKIP_PRECHECK="${SKIP_PRECHECK:-0}"

# Ensure sane PATH for non-interactive shells
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${PATH:-}"
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
export UCF_FORCE_CONFFOLD=1

shopt -s nullglob

msg() { echo "$*" | tee -a "$LOG"; }
die() { echo "ERROR: $*" | tee -a "$LOG"; exit 1; }
ts()  { date +%F-%H%M%S; }

sink() { # move file out of sources.list.d safely
  local f="$1" base
  [[ -e "$f" ]] || return 0
  base="$(basename "$f")"
  mkdir -p "$SINK"
  mv -f "$f" "$SINK/$base.bak.$(ts)"
}

divert_add() {
  local p="$1"
  if ! dpkg-divert --list | grep -Fq "diversion of $p"; then
    dpkg-divert --quiet --local --rename --add "$p" || true
  fi
  rm -f "$p" || true
}

cleanup_nonlist_sources() {
  mkdir -p "$SINK"
  find /etc/apt/sources.list.d -maxdepth 1 -type f \
    ! -name '*.list' ! -name '*.sources' \
    -exec mv -f {} "$SINK"/ \; || true
}

# STRICT verify: only fail on ACTIVE enterprise refs
verify_no_enterprise() {
  local bad=0
  # 1) Active lines in *.list (not commented)
  if grep -RIsn '^[[:space:]]*deb[[:space:]].*enterprise\.proxmox\.com' /etc/apt/sources.list /etc/apt/sources.list.d 2&gt;/dev/null; then
    bad=1
  fi
  # 2) Deb822 .sources that mention enterprise AND are effectively enabled
  while IFS= read -r -d '' f; do
    if grep -qi 'enterprise\.proxmox\.com' "$f"; then
      # treat missing Enabled as enabled, only "Enabled: no" is safe
      if ! grep -qi '^[[:space:]]*Enabled:[[:space:]]*no[[:space:]]*$' "$f"; then
        echo "[VERIFY] Enabled enterprise in: $f" | tee -a "$LOG"
        bad=1
      fi
    fi
  done &lt; &lt;(find /etc/apt/sources.list.d -maxdepth 1 -type f -name '*.sources' -print0 2&gt;/dev/null)
  (( bad == 0 )) || die "Enterprise repo still detected. Clean failed."
}

# Disabled deb822 stub WITHOUT enterprise domain (so greps never trip)
write_disabled_enterprise_sources() {
  cat &gt; /etc/apt/sources.list.d/pve-enterprise.sources &lt;&lt;'EOF'
Types: deb
URIs: https://example.invalid/proxmox           # placeholder to avoid enterprise domain
Suites: trixie
Components: pve-enterprise
Enabled: no
EOF
  chmod 0644 /etc/apt/sources.list.d/pve-enterprise.sources
}

# --------- FIXED: robust locator for pve8to9 + debug ----------
locate_pve8to9() {
  hash -r 2&gt;/dev/null || true
  local tool=""
  tool="$(type -P pve8to9 2&gt;/dev/null || true)"
  [[ -z "$tool" ]] &amp;&amp; tool="$(command -v pve8to9 2&gt;/dev/null || true)"
  [[ -z "$tool" &amp;&amp; -x /usr/bin/pve8to9 ]] &amp;&amp; tool="/usr/bin/pve8to9"
  [[ -z "$tool" &amp;&amp; -x /usr/sbin/pve8to9 ]] &amp;&amp; tool="/usr/sbin/pve8to9"
  [[ -z "$tool" ]] &amp;&amp; tool="$(/usr/bin/which pve8to9 2&gt;/dev/null || true)"
  if [[ -z "$tool" ]] &amp;&amp; command -v dpkg &gt;/dev/null 2&gt;&amp;1; then
    local cand
    cand="$(dpkg -L pve-manager 2&gt;/dev/null | grep -E '/pve8to9$' || true)"
    [[ -n "$cand" &amp;&amp; -x "$cand" ]] &amp;&amp; tool="$cand"
  fi
  echo "$tool"
}

run_pve8to9_precheck() {
  [[ "$SKIP_PRECHECK" == "1" ]] &amp;&amp; { msg "SKIP_PRECHECK=1 set — skipping pve8to9."; return 0; }

  msg "Running pve8to9 --full precheck..."
  msg "PATH=$PATH"
  type -a pve8to9 2&gt;&amp;1 | sed 's/^/[type] /' | tee -a "$LOG" || true
  [[ -e /usr/bin/pve8to9 ]] &amp;&amp; ls -l /usr/bin/pve8to9 | sed 's/^/[ls] /' | tee -a "$LOG" || true

  local tool; tool="$(locate_pve8to9)"

  if [[ -z "$tool" ]]; then
    msg "pve8to9 not found — attempting to ensure 'pve-manager' is installed..."
    apt-get update -y &gt;&gt; "$LOG" 2&gt;&amp;1 || true
    apt-get install -y pve-manager &gt;&gt; "$LOG" 2&gt;&amp;1 || true
    cleanup_nonlist_sources; verify_no_enterprise
    hash -r 2&gt;/dev/null || true
    tool="$(locate_pve8to9)"
  fi

  if [[ -z "$tool" ]]; then
    msg "pve8to9 still not available on this system. Continuing without precheck."
    return 0
  fi

  msg "pve8to9 found at: $tool"
  local tmp rc
  tmp="$(mktemp)"
  set +e
  "$tool" --full | tee -a "$LOG" | tee "$tmp" &gt;/dev/null
  rc=${PIPESTATUS[0]}
  set -e
  if grep -qE 'FAILURES:\s*[1-9]+' "$tmp"; then
    rm -f "$tmp"
    die "pve8to9 reported FAILURES. Check log above."
  fi
  rm -f "$tmp"
  msg "pve8to9 executed (rc=$rc). No FAILURES."
}
# ---------------------------------------------------------------

# ----- header / live log hint -----
echo "== Proxmox VE 8 -&gt; 9 upgrade started: $(date) ==" | tee -a "$LOG"
echo "$$" &gt; /run/pve8to9.pid
ln -sfn "$LOG" /root/pve-upgrade-latest.log
echo "Live log: tail -f /root/pve-upgrade-latest.log" | tee -a "$LOG"
echo "If started via nohup, also watch its file (example: /root/pve8to9.&lt;ts&gt;.nohup.log)" | tee -a "$LOG"

# 0) PRE-NUKE ENTERPRISE + move backups OUT of APT dir
msg "[PRE-NUKE] Backup APT lists and clean directory..."
mkdir -p "$APT_BACKUP_DIR"
cp -a /etc/apt/sources.list "$APT_BACKUP_DIR"/ 2&gt;/dev/null || true
cp -a /etc/apt/sources.list.d "$APT_BACKUP_DIR"/ 2&gt;/dev/null || true
cleanup_nonlist_sources

# Remove any *.sources referencing Enterprise
for s in /etc/apt/sources.list.d/*.sources; do
  [[ -f "$s" ]] || continue
  grep -qi 'enterprise\.proxmox\.com' "$s" &amp;&amp; { msg " -&gt; removing: $s"; sink "$s"; }
done
# Remove typical filenames
sink /etc/apt/sources.list.d/pve-enterprise.sources
sink /etc/apt/sources.list.d/pve-enterprise.list

# For *.list with Enterprise: comment lines or remove if Enterprise-only
for l in /etc/apt/sources.list.d/*.list; do
  [[ -f "$l" ]] || continue
  if grep -qi 'enterprise\.proxmox\.com' "$l"; then
    if awk 'BEGIN{IGNORECASE=1} /^[[:space:]]*deb/ &amp;&amp; $0 !~ /enterprise\.proxmox\.com/ {ok=1} END{exit ok?0:1}' "$l"; then
      msg " -&gt; commenting Enterprise lines in: $l"
      sed -ri 's|^\s*deb\s+https?://enterprise\.proxmox\.com|#DISABLED-BY-SCRIPT &amp;|I' "$l"
    else
      msg " -&gt; removing Enterprise-only list: $l"
      sink "$l"
    fi
  fi
done

# Comment Enterprise in main sources.list
[[ -f /etc/apt/sources.list ]] &amp;&amp; sed -ri 's|^\s*deb\s+https?://enterprise\.proxmox\.com|#DISABLED-BY-SCRIPT &amp;|I' /etc/apt/sources.list || true

# Diversions + disabled deb822 file (with example.invalid), then re-clean any .distrib/.bak
divert_add /etc/apt/sources.list.d/pve-enterprise.list
divert_add /etc/apt/sources.list.d/pve-enterprise.sources
write_disabled_enterprise_sources
cleanup_nonlist_sources
verify_no_enterprise

# 1) Sanity checks
if [[ $EUID -ne 0 ]]; then die "Run as root."; fi
if ! command -v pveversion &gt;/dev/null 2&gt;&amp;1; then die "Not a Proxmox VE host."; fi
CUR_VER_RAW="$(pveversion || true)"; msg "Current pveversion: $CUR_VER_RAW"
if ! echo "$CUR_VER_RAW" | grep -qE 'pve-manager/8\.'; then
  msg "Expected Proxmox 8.x. Detected: $CUR_VER_RAW"
  [[ "$FORCE_UPGRADE" == "1" ]] || die "Set FORCE_UPGRADE=1 to override."
fi

# BEFORE snapshot
{
  echo; echo "===== BEFORE UPGRADE ====="; date
  echo "# uname -a"; uname -a || true
  echo; echo "# pveversion"; pveversion || true
  echo; echo "# qm list"; qm list || true
  echo; echo "# pct list"; pct list || true
} &gt;&gt; "$LOG" 2&gt;&amp;1

# 2) pve8to9 precheck (robust)
run_pve8to9_precheck

# 3) Keyring + initial apt refresh
apt-get update -y &gt;&gt; "$LOG" 2&gt;&amp;1 || true
apt-get install -y proxmox-archive-keyring &gt;&gt; "$LOG" 2&gt;&amp;1 || true
verify_no_enterprise
cleanup_nonlist_sources

# 4) Switch bookworm -&gt; trixie
msg "Switching Debian repositories: bookworm -&gt; trixie ..."
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list || true
find /etc/apt/sources.list.d -maxdepth 1 -type f -exec sed -i 's/bookworm/trixie/g' {} \; || true

# 5) Ensure single no-subscription entry
sed -ri '/download\.proxmox\.com\/debian\/pve.*pve-no-subscription/s/^/#DUPLICATE-BY-SCRIPT /' /etc/apt/sources.list || true
for l in /etc/apt/sources.list.d/*.list; do
  [[ -f "$l" ]] || continue
  [[ "$l" == "/etc/apt/sources.list.d/pve-no-subscription.list" ]] &amp;&amp; continue
  sed -ri '/download\.proxmox\.com\/debian\/pve.*pve-no-subscription/s/^/#DUPLICATE-BY-SCRIPT /' "$l" || true
done
cat &gt; /etc/apt/sources.list.d/pve-no-subscription.list &lt;&lt;'EOF'
deb http://download.proxmox.com/debian/pve trixie pve-no-subscription
EOF
chmod 0644 /etc/apt/sources.list.d/pve-no-subscription.list

verify_no_enterprise
cleanup_nonlist_sources

# 6) Full non-interactive upgrade
msg "Running apt-get update + non-interactive upgrade/dist-upgrade..."
TMPU="$(mktemp)"
apt-get update 2&gt;&amp;1 | tee -a "$LOG" | tee "$TMPU" &gt;/dev/null
if grep -q 'enterprise\.proxmox\.com' "$TMPU"; then rm -f "$TMPU"; die "APT tried to reach Enterprise during update."; fi
rm -f "$TMPU"

apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade -y | tee -a "$LOG"
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade -y | tee -a "$LOG"

# Second cleanup pass
cleanup_nonlist_sources

apt-get autoremove -y | tee -a "$LOG" || true
apt-get update -y &gt;&gt; "$LOG" 2&gt;&amp;1 || true

# 7) One-shot post-boot verification
POST_SH="/root/pve-postcheck.sh"
POST_SVC="/etc/systemd/system/pve-upgrade-postcheck.service"
cat &gt; "$POST_SH" &lt;&lt;'EOS'
#!/bin/bash
set -euo pipefail
LOG_FILE="/root/pve-upgrade-post-$(date +%Y%m%d-%H%M%S).log"
{
  echo "===== AFTER UPGRADE (first boot) ====="; date
  echo "# uname -a"; uname -a || true
  echo; echo "# pveversion"; pveversion || true
  echo; echo "# apt policy (trixie check)"; apt-cache policy | sed -n '1,120p' || true
} &gt;&gt; "$LOG_FILE" 2&gt;&amp;1
systemctl disable --now pve-upgrade-postcheck.service &gt;/dev/null 2&gt;&amp;1 || true
rm -f /root/pve-postcheck.sh
EOS
chmod +x "$POST_SH"
cat &gt; "$POST_SVC" &lt;&lt;'EOS'
[Unit]
Description=Proxmox upgrade post-check (one-shot)
After=multi-user.target pvedaemon.service pve-cluster.service
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/bin/bash /root/pve-postcheck.sh
[Install]
WantedBy=multi-user.target
EOS
systemctl daemon-reload
systemctl enable pve-upgrade-postcheck.service &gt;&gt; "$LOG" 2&gt;&amp;1 || true

# 8) Pre-reboot snapshot
{
  echo; echo "===== PRE-REBOOT SNAPSHOT ====="; date
  echo "# Installed pve kernels:"; dpkg -l | grep -E '^ii\s+pve-kernel' | sort -V || true
} &gt;&gt; "$LOG" 2&gt;&amp;1

msg "Upgrade phase completed. Log: $LOG"
if [[ "$NO_REBOOT" == "1" ]]; then
  msg "NO_REBOOT=1 set — skipping reboot. Please reboot manually."
else
  msg "Rebooting now to complete the upgrade..."
  sleep 3
  reboot
fi</pre></div>



<p>Below is the full content of the script for reference. It is recommended to download the latest version from the link above to ensure you have the most up-to-date fixes.</p>



<h2 class="wp-block-heading">Post-upgrade verification</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">pveversion</pre></div>


<p>Expected output should look like:</p>
<p>pve-manager/9.x.x/xxxxxxxx (running kernel: 6.x.x-x-pve)<br />Check the running kernel version:</p>


<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">uname -a</pre></div>


<p>Review the upgrade log to confirm no errors occurred:</p>


<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">less /root/pve-upgrade-*.log</pre></div>


<p>If you used the post-check service created by the script, you can view its results:</p>


<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">less /root/pve-upgrade-post-*.log</pre></div>
<p>Artykuł <a href="https://soban.pl/how-to-upgrade-proxmox-ve-8-x-to-9-0-debian-12-to-debian-13-step-by-step-with-script/">How to Upgrade Proxmox VE 8.x to 9.0 (Debian 12 to Debian 13) – Step-by-Step with Script</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Enhancing Virtual Machine Management with QEMU Guest Agent on Proxmox</title>
		<link>https://soban.pl/enhancing-virtual-machine-management-with-qemu-guest-agent-on-proxmox/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Tue, 11 Feb 2025 14:43:42 +0000</pubDate>
				<category><![CDATA[Proxmox]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=599</guid>

					<description><![CDATA[<p>Ever wondered how to streamline the management and monitoring of virtual machines in your Proxmox environment? QEMU Guest Agent is a game-changer, offering tools that significantly enhance the way you interact with virtual systems. Let’s dive into how this tool can transform your setup. What Makes QEMU Guest Agent Indispensable? Setting Up QEMU Guest Agent [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/enhancing-virtual-machine-management-with-qemu-guest-agent-on-proxmox/">Enhancing Virtual Machine Management with QEMU Guest Agent on Proxmox</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="502" height="504" src="https://soban.pl/wp-content/uploads/2025/02/image-1.png" alt="" class="wp-image-602" srcset="https://soban.pl/wp-content/uploads/2025/02/image-1.png 502w, https://soban.pl/wp-content/uploads/2025/02/image-1-300x300.png 300w, https://soban.pl/wp-content/uploads/2025/02/image-1-150x150.png 150w" sizes="auto, (max-width: 502px) 100vw, 502px" /></figure>



<p><br>Ever wondered how to streamline the management and monitoring of virtual machines in your Proxmox environment? QEMU Guest Agent is a game-changer, offering tools that significantly enhance the way you interact with virtual systems. Let’s dive into how this tool can transform your setup.</p>



<h3 class="wp-block-heading">What Makes QEMU Guest Agent Indispensable?</h3>



<ul class="wp-block-list">
<li><strong>Time Synchronization:</strong> Keeping time consistent across your virtual machines and the host can be tricky, but QEMU Guest Agent automates this, ensuring that time-sensitive operations run smoothly.</li>



<li><strong>Power Management:</strong> Imagine being able to shut down or reboot your virtual machines right from the Proxmox panel — no need to log in to each VM. It&#8217;s not only convenient but also a time saver.</li>



<li><strong>System Monitoring:</strong> Get detailed insights into file systems, network activities, and other operational parameters directly from your host. This level of monitoring allows for timely diagnostics and adjustments.</li>



<li><strong>Disk Management:</strong> Handling disk operations without having to intervene directly on the VM makes backing up and restoring data more straightforward than ever.</li>
</ul>



<h3 class="wp-block-heading">Setting Up QEMU Guest Agent on Your Proxmox Server</h3>



<p>Getting started with QEMU Guest Agent involves a few simple steps:</p>



<ul class="wp-block-list">
<li><strong>Enable the Agent:</strong> Log in to your Proxmox panel, go to the &#8216;Options&#8217; section of your desired VM, and make sure the &#8216;QEMU Guest Agent&#8217; option is checked.</li>
</ul>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="685" height="500" src="https://soban.pl/wp-content/uploads/2025/02/image-2.png" alt="" class="wp-image-603" style="width:734px;height:auto" srcset="https://soban.pl/wp-content/uploads/2025/02/image-2.png 685w, https://soban.pl/wp-content/uploads/2025/02/image-2-300x219.png 300w" sizes="auto, (max-width: 685px) 100vw, 685px" /></figure>



<p>Next up, installing it on an Ubuntu VM:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">sudo apt-get install qemu-guest-agent
sudo systemctl start qemu-guest-agent
sudo systemctl enable qemu-guest-agent</pre></div>


<p>To check whether the qeumu-guest-agent that can make the change is working properly:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">systemctl status qemu-guest-agent</pre></div>


<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="757" height="194" src="https://soban.pl/wp-content/uploads/2025/02/image-3.png" alt="" class="wp-image-610" srcset="https://soban.pl/wp-content/uploads/2025/02/image-3.png 757w, https://soban.pl/wp-content/uploads/2025/02/image-3-300x77.png 300w" sizes="auto, (max-width: 757px) 100vw, 757px" /></figure>


<p>The QEMU Guest Agent doesn’t just make life easier by automating the mundane tasks — it also enhances the security and efficiency of your virtual environment. Whether you’re managing a single VM or a whole fleet, it’s an invaluable addition to your toolkit.</p>
<p>Artykuł <a href="https://soban.pl/enhancing-virtual-machine-management-with-qemu-guest-agent-on-proxmox/">Enhancing Virtual Machine Management with QEMU Guest Agent on Proxmox</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Troubleshooting Proxmox clusters and restoring the LXC container</title>
		<link>https://soban.pl/troubleshooting-proxmox-clusters-and-restoring-the-lxc-container/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Wed, 13 Nov 2024 10:57:41 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Proxmox]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=519</guid>

					<description><![CDATA[<p>Managing Proxmox clusters can sometimes present technical difficulties, such as inconsistencies in cluster configuration or issues with restoring LXC containers. Finding and resolving these issues is crucial for maintaining the stability and performance of the virtualization environment. In this article, I present a detailed guide on how to diagnose and resolve an issue with an [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/troubleshooting-proxmox-clusters-and-restoring-the-lxc-container/">Troubleshooting Proxmox clusters and restoring the LXC container</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="774" height="782" src="https://soban.pl/wp-content/uploads/2024/11/image.png" alt="" class="wp-image-520" style="width:485px;height:auto" srcset="https://soban.pl/wp-content/uploads/2024/11/image.png 774w, https://soban.pl/wp-content/uploads/2024/11/image-297x300.png 297w, https://soban.pl/wp-content/uploads/2024/11/image-768x776.png 768w" sizes="auto, (max-width: 774px) 100vw, 774px" /></figure>



<p>Managing Proxmox clusters can sometimes present technical difficulties, such as inconsistencies in cluster configuration or issues with restoring LXC containers. Finding and resolving these issues is crucial for maintaining the stability and performance of the virtualization environment. In this article, I present a detailed guide on how to diagnose and resolve an issue with an unreachable node and how to successfully restore an LXC container.</p>



<p>Before you begin any actions, make sure you have a current backup of the system.</p>



<h3 class="wp-block-heading">Diagnosing the State of the Proxmox Cluster<br></h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">pvecm delnode up-page-02
Node/IP: up-page-02 is not a known host of the cluster.</pre></div>



<p>and:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">pct restore 107 vzdump-lxc-107-2024_11_12-03_00_01.tar.zst --storage local
CT 107 already exists on node 'up-page-02'</pre></div>



<p>To understand the state of the cluster, execute the following command on the <code>node-up-page-04</code> node:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">pvecm nodes</pre></div>



<p>Expected output:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">Membership information
----------------------
    Nodeid      Votes Name
         1          1 node-up-page-01
         2          1 node-up-page-04 (local)</pre></div>



<p>Then check the detailed cluster information with the following command:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">pvecm status</pre></div>



<p>Expected output:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">Cluster information
-------------------
Name:             soban-proxmox
Config Version:   4
Transport:        knet
Secure auth:      on

Quorum information
------------------
Date:             Wed Nov 13 10:40:12 2024
Quorum provider:  corosync_votequorum
Nodes:            2
Node ID:          0x00000002
Ring ID:          1.e6
Quorate:          Yes

Votequorum information
----------------------
Expected votes:   2
Highest expected: 2
Total votes:      2
Quorum:           2
Flags:            Quorate

Membership information
----------------------
    Nodeid      Votes Name
0x00000001          1 &lt;masked IP&gt;
0x00000002          1 &lt;masked IP&gt; (local)</pre></div>



<h3 class="wp-block-heading">Removing the Container Configuration File and Cleaning Data</h3>



<p>I discovered that the configuration file for container 107 still exists on the cluster&#8217;s file system at the path:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">ls -ltr /etc/pve/nodes/node-up-page-02/lxc/107.conf</pre></div>



<p>Output:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">-rw-r----- 1 root www-data 235 Nov 12 21:35 /etc/pve/nodes/node-up-page-02/lxc/107.conf</pre></div>



<p>To remove this file and any remaining data associated with the detached node, execute:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">rm -rf /etc/pve/nodes/node-up-page-02/</pre></div>



<h3 class="wp-block-heading">Restoring the Container</h3>



<p>After removing the configuration file, I restored the LXC container on the <code>node-up-page-04</code> node using the command:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">pct restore 107 /root/vzdump-lxc-107-2024_11_12-03_00_01.tar.zst --storage local</pre></div>



<p>Output:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">recovering backed-up configuration from '/root/vzdump-lxc-107-2024_11_12-03_00_01.tar.zst'
Formatting '/var/lib/vz/images/107/vm-107-disk-0.raw', fmt=raw size=59055800320 preallocation=off
Creating filesystem with 14417920 4k blocks and 3604480 inodes
Filesystem UUID: 8b707e55-5e14-4b20-8585-6cb09e0fa520
Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424
restoring '/root/vzdump-lxc-107-2024_11_12-03_00_01.tar.zst' now..
extracting archive '/root/vzdump-lxc-107-2024_11_12-03_00_01.tar.zst'</pre></div>



<p>The restoration process was successful, and the container was ready for use. This case illustrates the importance of thorough diagnostics and configuration file management in Proxmox when working with clusters. Regular reviews of configurations are advisable to avoid inconsistencies and operational issues in the future.</p>
<p>Artykuł <a href="https://soban.pl/troubleshooting-proxmox-clusters-and-restoring-the-lxc-container/">Troubleshooting Proxmox clusters and restoring the LXC container</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Extending SWAP space on Proxmox using lvreduce</title>
		<link>https://soban.pl/extending-swap-space-on-proxmox-using-lvreduce/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Thu, 18 Apr 2024 10:55:30 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Proxmox]]></category>
		<category><![CDATA[SWAP]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=470</guid>

					<description><![CDATA[<p>Introduction Managing SWAP memory is a key element in administering Linux operating systems, especially in virtualization environments like Proxmox. SWAP acts as &#8220;virtual memory&#8221; that can be used when the system&#8217;s physical RAM is full. In this article, we will show how to increase SWAP space on a Proxmox server, using the lvresize tool to [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/extending-swap-space-on-proxmox-using-lvreduce/">Extending SWAP space on Proxmox using lvreduce</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="844" height="846" src="https://soban.pl/wp-content/uploads/2024/04/swap.png" alt="" class="wp-image-467" style="width:427px;height:auto" srcset="https://soban.pl/wp-content/uploads/2024/04/swap.png 844w, https://soban.pl/wp-content/uploads/2024/04/swap-300x300.png 300w, https://soban.pl/wp-content/uploads/2024/04/swap-150x150.png 150w, https://soban.pl/wp-content/uploads/2024/04/swap-768x770.png 768w" sizes="auto, (max-width: 844px) 100vw, 844px" /></figure>



<p><strong>Introduction</strong></p>



<p>Managing SWAP memory is a key element in administering Linux operating systems, especially in virtualization environments like Proxmox. SWAP acts as &#8220;virtual memory&#8221; that can be used when the system&#8217;s physical RAM is full. In this article, we will show how to increase SWAP space on a Proxmox server, using the lvresize tool to free up disk space that can then be allocated to SWAP.</p>



<h3 class="wp-block-heading">Problem Overview</h3>



<p>A user wants to increase SWAP space from 8 GB to 16 GB, but encounters the problem of lacking available space in the LVM volume group, which is required to increase SWAP.</p>



<h3 class="wp-block-heading">Step 1: Checking Available Space</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">vgs</pre></div>



<p>The command <code>vgs</code> displays the volume groups along with their sizes and available space.</p>



<h3 class="wp-block-heading">Step 2: Reducing the Volume</h3>



<p>Suppose there is a <code>root</code> volume of 457.26 GB, which can be reduced to free up an additional 8 GB for SWAP. Before reducing the volume, it is necessary to reduce the file system on this volume.</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">resize2fs /dev/pve/root 449.26G</pre></div>



<p>However, in the case of the XFS file system, reduction must occur offline or from a live CD.</p>



<h3 class="wp-block-heading">Step 3: Using lvreduce</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">lvreduce -L -8G /dev/pve/root</pre></div>



<p>This command reduces the <code>root</code> volume by 8 GB, which is confirmed by a message about the volume size change.</p>



<h3 class="wp-block-heading">Step 4: Deactivating SWAP</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">swapoff -a</pre></div>



<p>Before starting changes in SWAP size, SWAP must first be turned off using the above command.</p>



<h3 class="wp-block-heading">Step 5: Expanding SWAP</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">lvresize -L +8G /dev/pve/swap
mkswap /dev/pve/swap
swapon /dev/pve/swap</pre></div>



<p>The above commands first increase the SWAP space, then format it and reactivate it.</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">swapon --show</pre></div>



<p>Finally, we verify the active SWAP areas using the above command to ensure everything is configured correctly.</p>



<p>This process shows how you can flexibly manage disk space on Proxmox servers, adjusting the size of SWAP depending on needs. Using <code>lvreduce</code> requires caution, as any operation on partitions and volumes carries the risk of data loss, therefore it is always recommended to make backups before proceeding with changes.</p>
<p>Artykuł <a href="https://soban.pl/extending-swap-space-on-proxmox-using-lvreduce/">Extending SWAP space on Proxmox using lvreduce</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Automating the Backup Process in Proxmox: Practical Crontab Script and Configuration</title>
		<link>https://soban.pl/proxmox-backup-automation-etc/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Tue, 16 Apr 2024 11:54:48 +0000</pubDate>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Proxmox]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=439</guid>

					<description><![CDATA[<p>In today&#8217;s world, where data is becoming increasingly valuable, proper backup management is crucial for the security of information systems. In this article, I present an effective way to automate the backup of key configuration files in Proxmox-based systems using a simple bash script and Crontab configuration. Bash Script for Backup of the /etc Directory [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/proxmox-backup-automation-etc/">Automating the Backup Process in Proxmox: Practical Crontab Script and Configuration</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1024" height="1024" src="https://soban.pl/wp-content/uploads/2024/04/image.png" alt="" class="wp-image-437" style="width:412px;height:auto" srcset="https://soban.pl/wp-content/uploads/2024/04/image.png 1024w, https://soban.pl/wp-content/uploads/2024/04/image-300x300.png 300w, https://soban.pl/wp-content/uploads/2024/04/image-150x150.png 150w, https://soban.pl/wp-content/uploads/2024/04/image-768x768.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>In today&#8217;s world, where data is becoming increasingly valuable, proper backup management is crucial for the security of information systems. In this article, I present an effective way to automate the backup of key configuration files in Proxmox-based systems using a simple bash script and Crontab configuration.</p>



<h4 class="wp-block-heading">Bash Script for Backup of the <code>/etc</code> Directory</h4>



<p>The <code>/etc</code> file contains critical system configuration files that are essential for the proper functioning of the operating system and various applications. Loss or damage to these files can lead to serious problems. Below, I present an effective script, <code>backup-etc.sh</code>, that allows for the automated backup of this directory:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash
date_now=$(date +%Y_%m_%d-%H_%M_%S)
tar --use-compress-program zstd -cf /var/lib/vz/dump/vz-etc-$(hostname)-$date_now.tar.zst /etc/
find /var/lib/vz/dump/ -name vzup1-etc-* -type f -mtime +100 | xargs rm -f</pre></div>



<p>This script performs the following operations:</p>



<ol class="wp-block-list">
<li>Generates the current date and time, which are added to the name of the archive to easily identify individual copies.</li>



<li>Uses the <code>tar</code> program with <code>zstd</code> compression to create an archived and compressed copy of the <code>/etc</code> directory.</li>



<li>Removes archives older than 100 days from the <code>/var/lib/vz/dump/</code> location, thus ensuring optimal disk space management.</li>
</ol>



<h4 class="wp-block-heading">Adding Script to Crontab</h4>



<p>To automate the backup process, the script should be added to crontab. Below is a sample configuration that runs the script daily at 2:40 AM:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># crontab -e
40 2 * * * /root/backup-etc.sh &gt; /dev/null 2&gt;&amp;1</pre></div>



<p>Redirecting output to <code>/dev/null</code> ensures that operations are performed quietly without generating additional output to standard output.</p>



<h4 class="wp-block-heading">Download the Script from soban.pl</h4>



<p>The <code>backup-etc.sh</code> script is also available for download from the soban.pl website. You can download it using the following <code>wget</code> command and immediately save it as <code>/root/backup-etc.sh</code>:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># wget -O /root/backup-etc.sh https://soban.pl/bash/backup-etc.sh &amp;&amp; chmod +x /root/backup-etc.sh</pre></div>



<p>With this simple command, the script is downloaded from the server and granted appropriate executable permissions.</p>



<h4 class="wp-block-heading">Benefits and Modifications</h4>



<p>The <code>backup-etc.sh</code> script is flexible and can be easily modified to suit different systems. It is default placed in the <code>/var/lib/vz/dump/</code> folder, which is a standard backup storage location in Proxmox environments. This simplifies backup management and can be easily integrated with existing backup solutions.</p>



<p>By keeping backups for 100 days, we ensure a balance between availability and disk space management. Old copies are automatically deleted, minimizing the risk of disk overflow and reducing data storage costs.</p>



<h4 class="wp-block-heading">Summary</h4>



<p>Automating backups using a bash script and Crontab is an effective method to secure critical system data. The <code>backup-etc.sh</code> script provides simplicity, flexibility, and efficiency, making it an excellent solution for Proxmox system administrators. I encourage you to adapt and modify this script according to your own needs to provide even better protection for your IT environment.</p>
<p>Artykuł <a href="https://soban.pl/proxmox-backup-automation-etc/">Automating the Backup Process in Proxmox: Practical Crontab Script and Configuration</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Simplified Proxmox VE 8 Installation on Debian 12 Bookworm</title>
		<link>https://soban.pl/simplified-proxmox-ve-8-installation-on-debian-12-bookworm/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Fri, 09 Feb 2024 11:36:05 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Proxmox]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=356</guid>

					<description><![CDATA[<p>Proxmox VE is a comprehensive, open-source server management platform that seamlessly integrates KVM hypervisor and LXC containers. Today, we present a streamlined process for installing Proxmox VE 8 on Debian 12 Bookworm, based on the official guidance from the Proxmox VE Installation Guide. Prerequisites Installation Scripts We&#8217;ve divided the installation into two scripts. The first [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/simplified-proxmox-ve-8-installation-on-debian-12-bookworm/">Simplified Proxmox VE 8 Installation on Debian 12 Bookworm</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><strong>Proxmox VE</strong> is a comprehensive, open-source server management platform that seamlessly integrates KVM hypervisor and LXC containers. Today, we present a streamlined process for installing Proxmox VE 8 on Debian 12 Bookworm, based on the official guidance from the <a href="https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm">Proxmox VE Installation Guide</a>.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">Prerequisites</h2>



<ul class="wp-block-list">
<li>A fresh <strong>Debian 12 Bookworm</strong> installation.</li>



<li>A user with sudo privileges.</li>



<li>Internet connectivity.</li>
</ul>



<h2 class="wp-block-heading">Installation Scripts</h2>



<p>We&#8217;ve divided the installation into two scripts. The first script prepares your system and installs the <strong>Proxmox VE</strong> kernel. The second script continues the process after a system reboot, installing the remaining <strong>Proxmox VE</strong> packages.</p>



<p>Remember, all these commands need to be executed from the root user level, so:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># sudo su -</pre></div>



<h3 class="wp-block-heading">First Part: System Preparation and Kernel Installation</h3>



<p>Start by downloading the first script which prepares your system and installs the <strong>Proxmox VE</strong> kernel:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># wget https://soban.pl/bash/install-proxmox-part1.sh
# chmod +x install-proxmox-part1.sh</pre></div>



<p>Run the script with the following command:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># ./install-proxmox-part1.sh</pre></div>



<p>Here is the content of the script:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash
# The script is an integral part of the article available at (part 1/2)
# https://soban.pl/simplified-proxmox-ve-8-installation-on-debian-12-bookworm/

# Introduction message
echo "Starting the setup for Proxmox VE installation on Debian Bookworm..."

# Display available network interfaces and their IP addresses
echo "Available network interfaces and IP addresses:"
ip -br -c a

# Retrieve the current hostname
CURRENT_HOSTNAME=$(hostname)

# Retrieve the current IP address
CURRENT_IP_ADDRESS=$(hostname -I | awk '{print $1}')

# Set up hostname
echo "Please enter the hostname for your Proxmox server (Press Enter to keep current: $CURRENT_HOSTNAME):"
read HOSTNAME
if [ -z "$HOSTNAME" ]; then
    HOSTNAME=$CURRENT_HOSTNAME
fi

# Set up IP address
echo "Based on the list above, please enter the IP address for your Proxmox server (Press Enter to keep current: $CURRENT_IP_ADDRESS):"
read IPADDRESS
if [ -z "$IPADDRESS" ]; then
    IPADDRESS=$CURRENT_IP_ADDRESS
fi

hostnamectl set-hostname "$HOSTNAME"

# Backup and configure /etc/hosts
cp /etc/hosts /etc/hosts.backup
cat &lt;&lt;EOF &gt; /etc/hosts
127.0.0.1       localhost
$IPADDRESS      $HOSTNAME

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF

# Backup existing sources.list and prepare Proxmox VE repository
cp /etc/apt/sources.list /etc/apt/sources.list.backup
echo "deb [arch=amd64] http://download.proxmox.com/debian/pve bookworm pve-no-subscription" &gt; /etc/apt/sources.list.d/pve-install-repo.list

# Add the Proxmox VE repository key
wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg
echo "Verifying the GPG key..."
sha512sum /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg | grep '7da6fe34168adc6e479327ba517796d4702fa2f8b4f0a9833f5ea6e6b48f6507a6da403a274fe201595edc86a84463d50383d07f64bdde2e3658108db7d6dc87'
if [ $? -ne 0 ]; then
    echo "GPG key verification failed. Aborting."
    exit 1
fi

# Update and upgrade the system
apt update &amp;&amp; apt full-upgrade -y

# Install the Proxmox VE kernel
apt install proxmox-default-kernel -y

# Install Proxmox VE and other necessary packages
apt install proxmox-ve postfix open-iscsi chrony -y

echo "Kernel installation completed. The system will now reboot. After rebooting, continue with the second part of the script."
reboot</pre></div>



<p>After running the first script, your system will reboot. At this stage, you may encounter a few dialogs from the system, which are part of the normal package configuration steps. For this simplified installation, you can accept the default options by pressing Enter.</p>



<h3 class="wp-block-heading">Screenshots during Installation</h3>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="221" src="https://soban.pl/wp-content/uploads/2024/02/grub-proxmox_installation-2-1024x221.png" alt="The selection of GRUB installation configuration." class="wp-image-374" srcset="https://soban.pl/wp-content/uploads/2024/02/grub-proxmox_installation-2-1024x221.png 1024w, https://soban.pl/wp-content/uploads/2024/02/grub-proxmox_installation-2-300x65.png 300w, https://soban.pl/wp-content/uploads/2024/02/grub-proxmox_installation-2-768x166.png 768w, https://soban.pl/wp-content/uploads/2024/02/grub-proxmox_installation-2.png 1353w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>GRUB Configuration</strong> &#8211; A new version of the <strong>GRUB bootloader</strong> configuration file is available. It&#8217;s recommended to keep the local version currently installed unless you are aware of the changes. As with the previous dialogs, pressing Enter will select the default action.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="678" height="490" src="https://soban.pl/wp-content/uploads/2024/02/postfix-proxmox_installation.png" alt="The selection of postfix installation configuration." class="wp-image-357" srcset="https://soban.pl/wp-content/uploads/2024/02/postfix-proxmox_installation.png 678w, https://soban.pl/wp-content/uploads/2024/02/postfix-proxmox_installation-300x217.png 300w" sizes="auto, (max-width: 678px) 100vw, 678px" /></figure>



<p><strong>Postfix Configuration</strong> &#8211; This dialog appears when installing the postfix package, which is a mail transport agent. The default option &#8220;Internet Site&#8221; is suitable for most cases. Pressing Enter accepts this configuration.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="642" height="344" src="https://soban.pl/wp-content/uploads/2024/02/system_FQND-proxmox_installation.png" alt="Setting the system mail name." class="wp-image-358" srcset="https://soban.pl/wp-content/uploads/2024/02/system_FQND-proxmox_installation.png 642w, https://soban.pl/wp-content/uploads/2024/02/system_FQND-proxmox_installation-300x161.png 300w" sizes="auto, (max-width: 642px) 100vw, 642px" /></figure>



<p><strong>System Mail Name</strong> &#8211; Here you specify the FQDN (Fully Qualified Domain Name) for the system mail. The default value is usually adequate unless you have a specific domain name for your server. Again, pressing Enter will continue with the default configuration.</p>



<p>There might be issues encountered towards the end of the first script installation, such as:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">Errors were encountered while processing:
 ifupdown2
 pve-manager
 proxmox-ve
E: Sub-process /usr/bin/dpkg returned an error code (1)</pre></div>



<p>However, the second part of the script, executed after the reboot, addresses these problems.<br>After a successful reboot of the machine, log into the system and proceed to the second script.</p>



<h3 class="wp-block-heading">Second Part: Completing Proxmox VE Installation</h3>



<p>After your system has rebooted, proceed with downloading the second script:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># wget https://soban.pl/bash/install-proxmox-part2.sh
# chmod +x install-proxmox-part2.sh</pre></div>



<p>Execute the second part of the installation with the command:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># ./install-proxmox-part2.sh</pre></div>



<p>This is the content of the second script:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash
# The script is an integral part of the article available at (part 2/2)
# https://soban.pl/simplified-proxmox-ve-8-installation-on-debian-12-bookworm/

# Introduction message
echo "Continuing Proxmox VE installation after reboot..."

# Install upgrade
apt upgrade -y

# Optional: Remove the Debian default kernel
apt remove linux-image-amd64 'linux-image-6.1*' -y
update-grub

# Optionally remove the os-prober package
apt remove os-prober -y

# Clean up installation repository entry
rm /etc/apt/sources.list.d/pve-install-repo.list

# Retrieve the server's IP address for the Proxmox web interface link
IP_ADDRESS=$(hostname -I | awk '{print $1}')
echo "Proxmox VE installation completed."
echo "You can now connect to the Proxmox VE web interface using:"
echo "https://$IP_ADDRESS:8006"
echo "Please log in using the 'root' username and your root password."</pre></div>



<p>Once the second script completes, you will be able to access the Proxmox VE web interface using the URL displayed at the script&#8217;s conclusion. Log in with the &#8216;root&#8217; username and your root password.</p>



<p>Upon loading the page, you may encounter a certificate trust error &#8211; this is normal at this stage, and you can safely accept that it is unsafe and proceed to access the page for managing Proxmox. If you don&#8217;t know the root password, you can reset it by executing &#8216;<code><strong>passwd</strong></code>&#8216; as root. Good luck!</p>
<p>Artykuł <a href="https://soban.pl/simplified-proxmox-ve-8-installation-on-debian-12-bookworm/">Simplified Proxmox VE 8 Installation on Debian 12 Bookworm</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Checking the disk for errors and bad sectors</title>
		<link>https://soban.pl/checking-the-disk-for-errors-and-bad-sectors/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Tue, 12 Oct 2021 16:31:11 +0000</pubDate>
				<category><![CDATA[Bad sectors]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Proxmox]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=108</guid>

					<description><![CDATA[<p>This script helps to notify me by e-mail about the condition of the disk. Remember to indicate the disk accordingly &#8211; in this case it is &#8220;/dev/sda&#8221; and change the e-mail address from &#8220;soban@soban.pl&#8221; to your own. Save the script in &#8220;/root/checkbadsector.sh&#8220;: You can also download it from https://soban.pl/bash/checkbadsector.sh: Remember to grant permission to perform [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/checking-the-disk-for-errors-and-bad-sectors/">Checking the disk for errors and bad sectors</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This script helps to notify me by e-mail about the condition of the disk. Remember to indicate the disk accordingly &#8211; in this case it is &#8220;<strong>/dev/sda</strong>&#8221; and change the e-mail address from &#8220;<strong>soban@soban.pl</strong>&#8221; to your own. Save the script in &#8220;<strong>/root/checkbadsector.sh</strong>&#8220;:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash
date &gt; /root/badsectortest.txt
badblocks /dev/sda -v &amp;&gt;&gt; /root/badsectortest.txt
hoursworkhdd=`smartctl --all /dev/sda | grep Power_On_Hours | awk '{print $10}'`
dayworkhdd=`expr $hoursworkhdd / 24`
yesworkhdd=`expr $dayworkhdd / 366`
echo -e "Hours working hdd:" &gt;&gt; /root/badsectortest.txt
echo -e $hoursworkhdd &gt;&gt; /root/badsectortest.txt
echo -e "Days working hdd:" &gt;&gt; /root/badsectortest.txt
echo -e $dayworkhdd &gt;&gt; /root/badsectortest.txt
echo -e "Years working hdd:" &gt;&gt; /root/badsectortest.txt
echo -e $yesworkhdd &gt;&gt; /root/badsectortest.txt
date &gt;&gt; /root/badsectortest.txt
cat /root/badsectortest.txt | /usr/bin/mail -s "badsector - `date`" soban@soban.pl</pre></div>



<p>You can also download it from <a href="https://soban.pl/bash/checkbadsector.sh" target="_blank" rel="noreferrer noopener">https://soban.pl/bash/checkbadsector.sh</a>:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># cd
# wget https://soban.pl/bash/checkbadsector.sh</pre></div>



<p>Remember to grant permission to perform it:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># chmod +x /root/checkbadsector.sh</pre></div>



<p>On my server I added it once a month so that it would be performed periodically in the crontab:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># crontab -l | grep checkbadsector
30 17 20 * * /root/checkbadsector.sh &gt; /dev/null 2&gt;&amp;1</pre></div>



<p>You should receive an email similar to the one below:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="751" height="443" src="https://soban.pl/wp-content/uploads/2021/10/image-24.png" alt="" class="wp-image-111" srcset="https://soban.pl/wp-content/uploads/2021/10/image-24.png 751w, https://soban.pl/wp-content/uploads/2021/10/image-24-300x177.png 300w" sizes="auto, (max-width: 751px) 100vw, 751px" /></figure>



<p>Good luck and I wish you no errors!</p>
<p>Artykuł <a href="https://soban.pl/checking-the-disk-for-errors-and-bad-sectors/">Checking the disk for errors and bad sectors</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>E-mail notification about new updates Proxmox</title>
		<link>https://soban.pl/e-mail-notification-about-new-updates/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Fri, 08 Oct 2021 09:48:01 +0000</pubDate>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Patching]]></category>
		<category><![CDATA[Proxmox]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=72</guid>

					<description><![CDATA[<p>This script send you e-mail notification about new updates: You can download the script from: You should set the correct e-mail address in the script, for now it is soban@soban.plNotification it&#8217;s looks something like that: Should the script be executed: Also added to the crontab, every day to extend a new update: Remember don&#8217;t to [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/e-mail-notification-about-new-updates/">E-mail notification about new updates Proxmox</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p> This script send you e-mail notification about new updates: </p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># cat /root/check_update.sh
#!/bin/bash
email=soban@soban.pl
hostnam=`hostname`
apt-get update
# sometimes change number of lines (for example proxmox 4.4 - 4; proxmox 5 - 5)
if [ `apt-get --just-print upgrade | wc -l` != 5 ]
then
        apt-get --just-print upgrade |  mail -s "Update checker $hostnam" $email
fi</pre></div>



<p>You can download the script from:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">$ cd /root/
$ wget https://soban.pl/bash/check_update.sh</pre></div>



<p>You should set the correct e-mail address in the script, for now it is soban@soban.pl<br>Notification it&#8217;s looks something like that:<br></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="726" height="343" src="https://soban.pl/wp-content/uploads/2021/10/image-12.png" alt="" class="wp-image-73" srcset="https://soban.pl/wp-content/uploads/2021/10/image-12.png 726w, https://soban.pl/wp-content/uploads/2021/10/image-12-300x142.png 300w" sizes="auto, (max-width: 726px) 100vw, 726px" /></figure>



<p>Should the script be executed:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># chmod +x /root/check_update.sh</pre></div>



<p>Also added to the crontab, every day to extend a new update:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">00 06 * * * /root/check_update.sh &gt; /dev/null 2&gt;&amp;1</pre></div>



<p>Remember don&#8217;t to upgrade your system on Friday! Good luck!</p>
<p>Artykuł <a href="https://soban.pl/e-mail-notification-about-new-updates/">E-mail notification about new updates Proxmox</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
