Proxmox pci-passthrough single GPU

Info hämtad härifrån:

Reddit

Proxmox

Unraid-forum

Ändra

/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on video=efifb:off,vesafb:off"
update-grub

Lägg till moduler

/etc/modules
vfio
vfio_pci
vfio_virqfd

Hitta info om grafikkortet
lspci -v
Om kortet heter 01:00:
lspci -n -s 01:00
För att hitta vendor id

Lägg till för att "blockera" grafikkortet
echo "options vfio-pci ids=10de:1401,10de:0fba disable_vga=1"> /etc/modprobe.d/vfio.conf

update-initramfs -u

Lägg till kortet i den virtuella maskinen, all functions för att få med ljud

Hämta grafikkortets rom-file, modifiera i hex-edit

Rom-filen läggs i

/usr/share/kvm/

VM-konfig blir då:

hostpci0: 09:00,pcie=1,x-vga=1,romfile=GT960-patched.rom

Blockera consol för proxmox, kör varje reboot t.ex. vi cron @reboot (inte säkert alla tre rader behövs)

echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

Minska hdd storlek i Proxmox gäst som har lagring på zfs

Hämtat från: https://forum.proxmox.com/threads/shrink-zfs-disk.45835/#post-220907

Basic guide (may need improvments and it’s not failproof) to shrink zfs disks:

1. prepare your vm disk for shrinking and shut it down
2. in pve shell set new zfs pool size
Code:

$zfs set volsize=<new size>G rpool/data/vm-<vm id>-disk-<disk number>

3. edit vm config in /etc/pve/local/qemu-server/<vm id>.conf on line
Code:

virtio0: local-zfs:vm-<vm id>-disk-<disk number>,size=<new size>G

Obviusly the line may not be the same, just edit the disk size
4. in pve panel change the cache mode to something else and then revert back, this should update the config

Note: you may corrupt your partition table, to fix it in linux boot on a recovery live image like gparted and launch gdisk
Code:

$ gdisk /dev/vda

and then press v,x,e,w and y.
This should do the trick.