Proxmox VE - xxooxxooxx/xxooxxooxx.github.io GitHub Wiki

OpenWrt x86

qemu-img convert -f raw openwrt-18.06.1-x86-64-combined-ext4.img -O qcow2 vm-102-disk.qcow2
qemu-img check vm-102-disk.qcow2
qm importdisk 102 vm-102-disk.qcow2 local-lvm
parted /dev/sdX
unit s 
print free
resizepart 2 End
quit
e2fsck -f /dev/sdXX -y
resize2fs /dev/sdXX

Remove Notice

  • 6.3+
sed -i_orig "s/data.status === 'Active'/true/g" /usr/share/pve-manager/js/pvemanagerlib.js
sed -i_orig "s/if (res === null || res === undefined || \!res || res/if(/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
sed -i_orig "s/.data.status.toLowerCase() !== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
systemctl restart pveproxy

Physical_disk_to_kvm

Physical disk to kvm

Proxmox/KVM GPU Passthrough

  • /etc/default/grub (AMD amd_iommu=on or amd_iommu=pt)
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=pt video=efifb:off,vesafb:off"
or
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on video=efifb:off,vesafb:off"
update-grub
  • /etc/modules
echo vfio >> /etc/modules
echo vfio_iommu_type1 >> /etc/modules
echo vfio_pci >> /etc/modules
echo vfio_virqfd >> /etc/modules
lspci -nnk
.
00:02.0 VGA compatible controller [0300]: Intel Corporation 8th Gen Core Processor Gaussian Mixture Model [8086:3e91]
        Subsystem: ASRock Incorporation 8th Gen Core Processor Gaussian Mixture Model [1849:3e91]
        Kernel driver in use: vfio-pci
        Kernel modules: i915
.
00:1f.3 Audio device [0403]: Intel Corporation Cannon Lake PCH cAVS [8086:a348] (rev 10)
        Subsystem: ASRock Incorporation Cannon Lake PCH cAVS [1849:288a]
        Kernel driver in use: vfio-pci
        Kernel modules: snd_hda_intel, snd_soc_skl
.
lspci -nks 00:02.0
00:02.0 0300: 8086:3e91
        Subsystem: 1849:3e91
        Kernel driver in use: vfio-pci
        Kernel modules: i915

  • /etc/modprobe.d/blacklist.conf
echo "blacklist snd_soc_skl" >> /etc/modprobe.d/blacklist.conf
echo "blacklist snd_hda_intel" >> /etc/modprobe.d/blacklist.conf
echo "blacklist snd_hda_codec_hdmi" >> /etc/modprobe.d/blacklist.conf
echo "blacklist i915" >> /etc/modprobe.d/blacklist.conf
update-initramfs -k all -u
  • /etc/modprobe.d/vfio.conf
echo "options vfio-pci ids=8086:3e91,8086:a348 disable_vga=1" > /etc/modprobe.d/vfio.conf
  • /etc/pve/qemu-server/104.conf (UPT mode)
.
args: -device vfio-pci,host=00:02.0,x-igd-opregion=on
vga: std
hostpci0: 00:1f.3
.

https://pve.proxmox.com/wiki/Pci_passthrough
https://github.com/qemu/qemu/blob/master/docs/igd-assign.txt
https://vfio.blogspot.com/2014/08/does-my-graphics-card-rom-support-efi.html
https://github.com/awilliam/rom-parser
https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)

  • /etc/pve/qemu-server/101.conf (Legacy mode)
    qm start 101
.
args: -device vfio-pci,host=00:02.0,addr=0x18,romfile=image.bin
vga: none
hostpci0: 00:1f.3
.
  • nvidia code 43 fix
    qm set <VM_ID> -machine pc-q35-3.1
    /etc/pve/qemu-server/<VM_ID>.conf
    hostpci0: 01:00,pcie=1
    cpu: host,hidden=1,flags=+pcid,hv-vendor-id=proxmox

Clone

  • source
lvs --units b | grep vm-110
vm-110-disk-0         pve Vwi-aotz-- 214748364800B data                       50.26 
  • destination
lvcreate -V 214748364800b -T pve/data -n vm-110-disk-0
  • source
scp /etc/pve/qemu-server/110.conf [email protected]:/etc/pve/qemu-server/
dd if=/dev/pve/vm-110-disk-0 |ssh 192.168.0.222 -p 22 dd of=/dev/pve/vm-110-disk-0

BIOS/GPT boot

BIOS/GPT boot

fdisk -l
Disk /dev/sda: 32 GiB, 34359738368 bytes, 67108864 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 73705A89-B939-1D47-B90F-C3A60C4B0F67

Device        Start      End  Sectors  Size Type
/dev/sda1      2048     4095     2048    1M BIOS boot
/dev/sda2      4096  1052671  1048576  512M EFI System
/dev/sda3   1052672 62914559 61861888 29.5G Linux filesystem
/dev/sda4  62914560 67108830  4194271    2G Linux swap
cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda3 during installation
UUID=e8357846-ece3-47ee-a24f-dfabb9348b7e /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=1F67-AA6B  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda4 during installation
UUID=6e4de408-d0eb-44c8-82bd-c7122128539d none            swap    sw              0       0

install grub i386(BIOS)

apt-get install grub-pc-bin
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

reinstall grub systemrescuecd5.3.0

mount /dev/sda3 /mnt
mount /dev/sda2 /mnt/boot/efi
for i in /sys /proc /run /dev; do  mount --bind "$i" "/mnt$i"; done
chroot /mnt /bin/bash

grub-install --target=x86_64-efi --efi-directory=/boot/efi
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

exit
poweroff

Nested_Virtualization

Nested_Virtualization

Upgrade

Upgrade

中文文档

⚠️ **GitHub.com Fallback** ⚠️