Xiaobai's proxmox ve (pve) creates AIO (all in boom) tossing diary (4) hardware (graphics card, hard disk, network card) direct connection

       Hardware pass-through is to pass part of the hardware of your own host to one of the virtual machines, and other virtual machines cannot use it. This can effectively improve the performance of the hardware. It doesn’t need to be done much, but it still requires a certain amount of effort to do it well. I worked on it for a long time at that time. There are many articles in my favorites, and some of them have even expired. It was a long time ago and I forgot to refer to it. I’ll post that article below:

PVE7 tutorial [Part 1] Hardware virtualization graphics card pass-through and GVT-g_NAS storage_What is worth buying (smzdm.com)

My NAS+HTPC tossing journey Chapter 17: Install win10 under PVE, achieve HDMI output through independent display_NAS storage_What is worth buying (smzdm.com)

Enable hardware graphics card pass-through function for PVE - Bilibili (bilibili.com)

PVE pass-through core display ds918 supports DSM7.0.1 Synology Photos face recognition-ZYX

Solution to the problem that Black Synology core display passthrough cannot be started after upgrading Proxmox VE (PVE) to 7.X - GXNAS Blog

PVE Black Qunhui Direct Hard Drive - Bilibili (bilibili.com)

1. Basic settings

        Let’s talk about the results first. I currently have a network card connected to openwrt, two hard drives and core graphics to Synology, and a dedicated graphics card and USB to win. Because the core display is passed through to Synology, Win cannot display the interface. I have read an article before that the core display can be virtualized into two, and then passed through to Synology and Win respectively, but I am looking for that article now. Not yet, and after I made it based on that article, I did not achieve the desired results. When Synology and Win enabled one of them, the other could not be started at the same time. I don’t know if it was a problem with my settings or a CPU problem. But if I want Synology direct graphics and can use win, I can only add a separate graphics card. Fortunately, there are some old computers in the laboratory. I dug out a piece from the inside. The model seems to be hd5700 (yes, the performance of this card is even It’s not as good as my 8300 core display, but turning on the card and turning on the phone is enough).

        First, you need to modify the boot loader kernel command line configuration file GRUB, open the terminal, and enter the command:

nano /etc/default/grub

        Of course, you can also use vi, it depends on what editor you like to use. Of course, the most convenient and easiest way is to use the software mobaxterm I recommended before. Find this file in the file column on the left

, double-click to open, and then find

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

        Modified to: (I am using an Intel CPU and need to enable core-display pass-through, so i915.enable_gvt=1 is added)

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on video=efifb:off,vesafb:off i915.enable_gvt=1 "

        If you are using AMD CPU, it should be

GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on video=efifb:off"

        Then save, exit, and update grub. The command is:

update-grub

        Then you need to modify the kernel module. The command is:

nano /etc/modules

        Then add the following sentences:

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
kvmgt

        Then update the kernel, the command is:

update-initramfs -u -k all

        In this way, the basic work is completed, but the hardware graphics card pass-through function is enabled in PVE - Bilibili (bilibili.com) This tutorial includes the operation of adding a blacklist, but I did not do it. If it fails with my settings, you can try it. one time.

        After restarting, you can enter the web page to add settings.

2. Adding hardware such as network cards and graphics cards

        The first thing to note is that these hardware additions need to be restarted after being added, or added in a shutdown state and then turned on again to take effect. The normal color is black, and orange means that the current hardware cannot be used. Hardware such as network cards and graphics cards are relatively simple. Just select [Hardware]--[Add]--[PCI Device] under the required virtual machine, and then select the hardware you need for passthrough in the device. It should be noted that do not pass the management port directly to the virtual machine, otherwise you may not be able to enter the management interface. If you add hardware devices, you must adjust the device number of the pass-through in time, because after adding the device, the previous device number may change. I will Because the graphics card was added later and the device number was changed, the management port was directly connected to openwrt, and then the management port could not be entered, and it was all in boom.

 3. Hard drive pass-through

        Hard drives require more operations than other devices, and often hard drives need to be passed through to Synology.

        First update the environment with the following command:

apt-get update

        Then install lshw:

apt-get install lshw

        Then check the information of the inserted hard disk

ls -l /dev/disk/by-id/

        There will be a display similar to the one below. The beginning of ata is the ID of your own hard disk. Select the ID of the hard disk that needs to be copied.

         Then find the ID of the virtual machine that you need to pass through the hard disk. For example, mine is 101, and there are already three hard disks. The one you are adding is sata4 (actually the number does not matter). The added hard disk ID is ata-WDC_WD10EZEX-08RKKA0_WD-WCC1S4752100, so The command executed is:

qm set 101 --sata4 ata-WDC_WD10EZEX-08RKKA0_WD-WCC1S4752100 

        After running it, I found that the hard disk has been passed through.

        This is probably what it looks like. If there are any problems, I hope the bosses will point them out.

Guess you like

Origin blog.csdn.net/m0_59885919/article/details/129308054