When hosting high-performance databases, forensic disk imaging environments, ZFS/btrfs storage testing pools, or massive data warehouses inside virtual machines on Windows 11 Hyper-V, virtual hard disk files (such as .vhdx or .vhd) introduce minor hypervisor file system abstraction overhead. While modern VHDX containers deliver near-native sequential speeds, virtual disk abstraction limits direct access to physical storage SMART telemetry, raw partition tables, and specialised hardware commands.
To achieve bare-metal storage performance and grant a virtual machine direct control over a dedicated physical drive, Hyper-V supports Physical Disk Pass-Through (also known as raw disk mapping or direct disk attachment). By dismounting a physical drive from the Windows 11 host operating system and taking it offline, administrators can attach the physical disk directly to the virtual machine’s virtual SCSI controller via PowerShell. This guide explains the architecture and operational constraints of pass-through disks in Hyper-V and details how to prepare, attach, and verify physical storage pass-through using PowerShell.
Understanding Physical Disk Pass-Through in Hyper-V
In standard Hyper-V storage architectures, the host operating system formats a physical volume with NTFS or ReFS, and the hypervisor stores virtual machine disks as VHDX files inside that file system. When the guest VM performs I/O, requests traverse the guest driver, the hypervisor storage stack, the host file system driver, and finally the physical disk controller.
With Physical Disk Pass-Through, the host file system is completely bypassed:
- Host Offline Requirement: To prevent data corruption caused by simultaneous read/write operations from both the host OS and the guest VM, the host operating system must take the physical disk offline in the Windows disk subsystem (VDS). When offline, the host operating system releases all volume locks, drive letters, and file handles.
- Direct SCSI Controller Mapping: Hyper-V maps the raw physical disk object (e.g.
\\.\PhysicalDrive2) directly to a virtual SCSI or IDE controller channel on the guest virtual machine. - Native Partitioning & File Systems: The guest operating system treats the attached disk as a native physical drive. The guest can initialise it with GPT or MBR partition tables, format it with arbitrary file systems (e.g. ext4, XFS, NTFS, ZFS), or inspect SMART attributes.
- Feature Limitations: While pass-through disks provide maximum I/O throughput and eliminate VHDX resizing steps, they introduce specific hypervisor constraints: virtual machine checkpoints (snapshots) cannot capture pass-through disk state, and Hyper-V Replica does not replicate raw physical drives.
Prerequisites and Physical Disk Preparation
Configuring disk pass-through requires an elevated PowerShell console running as Administrator. Ensure that the dedicated physical disk (SATA SSD, NVMe drive, or external USB storage) is connected to your Windows 11 machine.
First, identify all physical disks registered on the Windows 11 host using Get-Disk:
Get-Disk | Select-Object Number, FriendlyName, OperationalStatus, HealthStatus, Size, PartitionStyle | Format-Table -AutoSize
PowerShell outputs the physical drive inventory:
Number FriendlyName OperationalStatus HealthStatus Size PartitionStyle
------ ------------ ----------------- ------------ ---- --------------
0 Samsung SSD 990 PRO 2TB Online Healthy 2000398934016 GPT
1 Crucial CT1000MX500 1TB Online Healthy 1000204886016 GPT
2 WD Red Plus 4TB Online Healthy 4000787030016 GPT
In this scenario, we will dedicate Disk 2 (the 4TB Western Digital drive) exclusively to a target virtual machine named Data-ArchiveVM.
Warning: Ensure that the physical drive you select does not contain the Windows 11 host operating system boot partition (Disk 0) or active host user data.
Taking the Physical Disk Offline on the Host
Before Hyper-V permits attaching a physical drive to a virtual machine, the disk must be placed in an Offline state in Windows. If the disk is online, Hyper-V will reject the attachment with an error stating that the drive is in use by another process.
To take Disk 2 offline and clear read-only locks, execute Set-Disk:
# Take Disk 2 offline on the host
Set-Disk -Number 2 -IsOffline $true
# Verify that the disk is offline and writable
Set-Disk -Number 2 -IsReadOnly $false
Confirm that the operational status reflects the offline state:
Get-Disk -Number 2 | Select-Object Number, FriendlyName, OperationalStatus, IsOffline
The output must confirm OperationalStatus : Offline and IsOffline : True. In Windows Disk Management (diskmgmt.msc), the drive will now appear with an “Offline” badge.
Attaching the Pass-Through Disk to the Virtual Machine
Physical pass-through disks can be attached to Generation 1 or Generation 2 Hyper-V virtual machines while the VM is powered on (hot-add via SCSI controller) or powered off.
Querying the Target Virtual Machine’s SCSI Controllers
Check the available SCSI controllers and port availability on Data-ArchiveVM using Get-VMScsiController:
Get-VMScsiController -VMName "Data-ArchiveVM"
By default, Hyper-V provides SCSI Controller 0, which supports up to 64 connected drives.
Adding the Physical Disk via Add-VMHardDiskDrive
To attach the offline physical drive to the virtual machine, run Add-VMHardDiskDrive using the -DiskNumber parameter:
Add-VMHardDiskDrive -VMName "Data-ArchiveVM" `
-ControllerType SCSI `
-ControllerNumber 0 `
-DiskNumber 2
If you encounter an error indicating the disk is unavailable, verify that no explorer window or disk management utility is attempting to access a partition on the disk, and confirm that IsOffline is $true.
Verifying Pass-Through Attachment in Hyper-V
To confirm that the physical disk is successfully bound to the virtual machine, query the VM’s hard disk drive configuration:
Get-VMHardDiskDrive -VMName "Data-ArchiveVM" | Select-Object VMName, ControllerType, ControllerNumber, ControllerLocation, DiskNumber, Path | Format-Table -AutoSize
PowerShell outputs the attached drives:
VMName ControllerType ControllerNumber ControllerLocation DiskNumber Path
------ -------------- ---------------- ------------------ ---------- ----
Data-ArchiveVM SCSI 0 0 C:\Hyper-V\Disks\OS.vhdx
Data-ArchiveVM SCSI 0 1 2
Notice that for standard virtual disks, the Path attribute references the local .vhdx file, whereas for the pass-through disk, DiskNumber explicitly displays 2 and Path is empty, indicating direct raw physical binding.
Initialising and Managing the Disk Inside the Guest OS
Log in to the guest operating system (Windows or Linux) running inside Data-ArchiveVM:
- Inside a Windows Guest: Open Disk Management or PowerShell. The newly attached physical drive will appear as an uninitialised disk (or with its existing partitions intact). You can initialise it as GPT and format it with ReFS/NTFS without any host-level interference.
- Inside a Linux Guest: The drive will appear under
/dev/sdbor/dev/sdc. Verify device detection using:lsblk sudo fdisk -l /dev/sdb
Safely Detaching the Pass-Through Disk
If you need to return the physical disk to the Windows 11 host operating system or reassign it to another virtual machine:
- Dismount or offline the volume inside the guest operating system.
- From the Hyper-V host, remove the pass-through disk attachment using
Remove-VMHardDiskDrive:# Identify controller location of the pass-through disk $drive = Get-VMHardDiskDrive -VMName "Data-ArchiveVM" | Where-Object { $_.DiskNumber -eq 2 } # Detach the drive from the virtual machine Remove-VMHardDiskDrive -VMHardDiskDrive $drive - Bring the physical disk back online for the Windows 11 host:
Set-Disk -Number 2 -IsOffline $false
The disk and its file systems will immediately mount back into the Windows 11 host operating system, completing the storage lifecycle cleanly without data loss.