PVE (Proxmox Virtual Environment) is a widely used open-source virtualization platform that provides robust features and management tools. One of its key functionalities is network interface card (NIC) passthrough, which can enhance the network performance of virtual machines. For more detailed information about the benefits of NIC passthrough, you can refer to the linked article: https://bmzhp.com/knowledge/456.
Here are the steps and precautions for setting up NIC passthrough in PVE:
-
Check Hardware Compatibility: Before starting the setup, ensure that your server hardware supports virtualization technologies such as Intel VT-d or AMD IOMMU. You can find the relevant options in the server’s BIOS settings and enable them.
-
Edit /etc/default/grub
- Open the grub configuration file:
nano /etc/default/grub
- Locate the line
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
- Modify it to:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt"
- Press
Ctrl + X
to save and exit (press Y to confirm). - If you are using an AMD CPU, it should be:
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
- Open the grub configuration file:
-
Update grub Configuration: Run the command:
update-grub
-
Modify Kernel Modules: Edit the modules file with the command:
nano /etc/modules
and add the following modules:- vfio
- vfio_iommu_type1
- vfio_pci
- vfio_virqfd
- kvmgt
-
Update initramfs: Run the command:
update-initramfs -u -k all
-
Save and Reboot: Finally, save all changes and reboot the server:
reboot
At this point, all the configuration is complete. In fact, if you are not using Ikuai or OpenWRT, there may be no need to set up NIC passthrough, as paravirtualization works quite well.