VDR als Proxmox-VM

Hardware / BIOS

BIOS:

Proxmox

Proxmox 9.0-1

Nvidia GPU pass-through to VM

## /etc/default/grub
## add amd_iommu=on to GRUB_CMDLINE_LINUX_DEFAULT
## update-grub, reboot

## /etc/modprobe.d/pve-blacklist.conf
blacklist nouveau
blacklist nvidia
blacklist nvidia_drm
blacklist nvidia_uvm
blacklist snd_hda_intel

## /etc/modules-load.d/vfio.conf
vfio
vfio_iommu_type1
vfio_pci

## /etc/modprobe.d/vfio.conf
# nvidia gpu and audio
options vfio-pci ids=10de:2d05,10de:22eb disable_vga=1

update-initramfs -u -k all
reboot

Shutdown / Wakeup Proxmox

Wenn die VDR-VM in der Lage sein soll, Proxmox herunter zu fahren, den RTC Wake Alarm zu setzen, braucht man Skripte sowohl auf Proxmox als auch in der VM.

## /usr/local/bin/proxmox-shutdown.sh
#!/bin/bash
# $1 = wake time in Unix timestamp

if [ -n "$1" ]; then
    # Clear existing alarm
    echo 0 > /sys/class/rtc/rtc0/wakealarm
    # Set new alarm
    echo "$1" > /sys/class/rtc/rtc0/wakealarm
    logger "RTC alarm set for $(date -d @$1)"
fi

# Shutdown Proxmox (shuts down ALL VMs)
/sbin/shutdown -h now

VDR VM

VM Settings

Primary GPU:

in der VM

apt install qemu-guest-agent

ssh-keygen -t ed25519
ssh-copy-id root@<proxmox-host-ip>

Edit VDR configuration (e.g., /etc/vdr/conf.d/00-vdr.conf):

--shutdown=/usr/local/bin/vdr-proxmox-shutdown.sh

## /usr/local/bin/vdr-proxmox-shutdown.sh
## chmod +x /usr/local/bin/vdr-proxmox-shutdown.sh
#!/bin/bash
# Get next timer from VDR
NEXT_TIMER=$(svdrpsend.pl NEXT abs | grep -oP '^\\d+')

if [ -n "$NEXT_TIMER" ]; then
    # Subtract 5 minutes for boot time
    WAKE_TIME=$((NEXT_TIMER - 300))
    ssh root@<proxmox-host-ip> "/usr/local/bin/vdr-host-shutdown.sh $WAKE_TIME"
else
    ssh root@<proxmox-host-ip> "/usr/local/bin/vdr-host-shutdown.sh"
fi

vdr/proxmox (zuletzt geändert am 2025-11-25 19:31:55 durch ThomasWaldmann)