This repository contains scripts to assist with managing PCI devices in a Proxmox environment. These tools provide detailed information about PCI devices, help with resource mapping, and facilitate passthrough configurations for virtual machines.
To get started, download the script using wget
, mark it as executable, and run it:
wget https://raw.githubusercontent.com/alexpitcher/prx-pcie-tools/refs/heads/main/pcinfo.sh
chmod +x pcinfo.sh
sudo ./pcinfo.sh /l
Managing PCI devices in a virtualized environment can be complex. These scripts simplify the process by:
- Providing detailed information about PCI devices.
- Filtering devices to show only Ethernet or Network controllers.
- Assisting with PCI passthrough configurations for Proxmox virtual machines.
The pcinfo.sh
script is an enhanced PCI device information and passthrough checker. It gathers detailed information about PCI devices and displays only Ethernet or Network controllers.
- Modes:
/h
or/help
: Show help./a
or/all
: Process all network devices./s
or/slot <n>
: Process a specific PCI slot usingdmidecode
./p
or/pci <id>
: Process a specific PCI device./l
or/list
: List all PCI devices (default mode).
- Display Flags:
/m
or/mapping
: Show PCI resource mapping info./v
or/vms
: Show VM passthrough usage info./n
or/net
: Show network interface info./d
or/driver
: Show driver info./V
or/verbose
: Enable verboselspci
output.
- Output Redirection:
/o
or/output <path>
: Redirect output to a file.
- Multi-port Grouping:
- Automatically groups devices sharing the same base address (domain:bus:device).
- Prints common details once and port-specific mapping/VM info separately.
- Only devices classified as Ethernet or Network controllers (per
lspci
) are displayed. - Requires root privileges to run.
The prx-pcie-map.sh
script helps create PCI resource mappings in Proxmox. It uses dmidecode
to display slot information and lspci
to get device details.
- Fetches PCI slot information using
dmidecode
. - Displays device details for a given slot.
- Prompts the user for mapping parameters and executes the mapping command.
Run the script as root to gather PCI device information. Examples:
-
List all network devices:
sudo ./pcinfo.sh /l
-
Process all network devices:
sudo ./pcinfo.sh /a
-
Process a specific PCI slot:
sudo ./pcinfo.sh /s <slot_number>
-
Process a specific PCI device:
sudo ./pcinfo.sh /p <pci_id>
-
Redirect output to a file:
sudo ./pcinfo.sh /a /o output.txt
-
Enable verbose output for detailed
lspci
information:sudo ./pcinfo.sh /a /V
Run the script as root to create PCI resource mappings. Example workflow:
-
Start the script:
sudo ./prx-pcie-map.sh
-
Enter the slot number to map.
-
Review the slot and device details.
-
Provide mapping parameters:
- Mapping name.
- Proxmox node name.
- PCI path (e.g.,
0000:01:00.0
). - Device ID (e.g.,
0002:0001
).
-
Confirm and execute the mapping command.
- Proxmox VE: Ensure Proxmox is installed and configured.
- Root Access: Both scripts require root privileges.
- Dependencies:
lspci
(part ofpciutils
package)dmidecode
pvesh
(Proxmox CLI tool)
This project is licensed under the MIT License. See the LICENSE
file for details.