Blog passthrough-physical-disk-proxmox-vms
virtualizationJULY 13, 2024

Detailed Guide to Passthrough Physical Disk to Proxmox VMs

kraaakilo's avatar

Introduction

Passing through physical disks to Proxmox VMs has greatly improved the performance and storage management of my virtual machines. In this guide, I'll walk you through the process of locating and preparing your disk, assigning it to a VM, and configuring it within Linux. Additionally, I'll cover how to unlink the disk if needed.

Detailed Guide to Passthrough Physical Disk to Proxmox VMs

Locating the Disk and Preparing for Passthrough

  1. Locate the Disk:

    • Go to the Disks tab in Proxmox and find the target disk. Note its serial number.
    • Optional: Wipe the disk if you need to clear its contents. This will delete all data on the disk.
  2. Identify Disk Path:

    • Open the Shell terminal and run:
      find /dev/disk/by-id/ -type l | xargs -I{} ls -l {} | grep -v -E '[0-9]$' | sort -k11 | cut -d' ' -f9,10,11,12
      
    • Copy the complete path of the disk (e.g., /dev/disk/by-id/{disk-serial}).
  3. Assign Disk to VM:

    • Go to the Hardware tab of the VM where you want to add the disk. Note the disk type (e.g., scsi0).
    • Run in Shell:
      qm set {vmid} -{disk-type}{number} /dev/disk/by-id/{disk-serial}
      
    • For Windows/Linux, use scsi; for macOS, use virtio.
  4. Verify and Boot:

    • Check the Hardware tab to ensure the disk is listed correctly.
    • Boot the VM.

Unlinking a Disk from a VM

  1. Remove Disk:
    • If you need to remove the disk, run in Shell:
      qm unlink {vmid} --idlist {disk-type}{number}
      
    • Replace {disk-type}{number} with the appropriate disk identifier (e.g., scsi1).

By following these steps, you can easily passthrough physical disks to your Proxmox VMs, enhancing performance and storage management.

Conclusion

Successfully passing through physical disks to Proxmox VMs can greatly enhance their performance and streamline your storage management. By following this guide, you can locate and prepare your disk, assign it to a VM and configure it. With these steps, you can maximize the capabilities of your Proxmox VMs and improve your overall system efficiency.

Let's connect

Stay in the loop with my latest projects and insights! Follow me on Twitter to catch all the updates as they happen. Don't miss out on the journey – let's connect and explore the world of tech together. Click to follow now!