Do you want your Virtual Machine to have direct, raw access to your SATA hard drives? Sometimes, letting the hypervisor handle disk I/O adds unnecessary overhead. By using PCI passthrough, you can give a VM direct control over the onboard SATA controller. This can improve performance and allow the guest OS to manage the hardware directly.

Here is a step-by-step guide on how to do it using XCP-ng.

As a little piece of addtional information, the machine used here is a Intel Core Ultra 7 265k with a AsRock Z890M Riptide motherboard. This pass through the onboard SATA controller for direct guest VM control.

All the commands bellow should be done on XCP-NG console (the host, also called Dom0).

Step 1: Identify your SATA Controller

Before you can pass a device through, you need to know exactly where it lives on your PCI bus. Open your terminal and run the following command:

lspci | grep -i sata

This command searches your hardware list for anything labeled “SATA.” You are looking for a line that looks like this: 80:17.0 SATA controller: Intel Corporation Device 7f62 (rev 10)

In this example, the address is 80:17.0. Write this down, as you will need it for every following step.

Step 2: Hide the Controller from the Host (Dom0)

By default, XCP-ng (the Dom0) will try to use the SATA controller itself. If the host is using it, the VM cannot. We need to tell the Xen kernel to “hide” this device so it becomes available for passthrough.

Run this command, replacing the address with your specific controller address:

/opt/xensource/libexec/xen-cmdline --set-dom0 "xen-pciback.hide=(0000:80:17.0)"

Note: This change modifies the boot configuration. You must reboot your host for this to take effect.

Step 3: Verify the Device is Available

Once your host has rebooted, check if the device is now sitting in the “assignable” list. This confirms that Dom0 has successfully let go of the controller.

xl pci-assignable-list

If you see your address (e.g., 0000:80:17.0) in the output, you are ready to move forward.

Step 4: Assign the Controller to your VM

Now it is time to hand the keys over to your Virtual Machine. You will use the xe command to update the VM’s configuration. You will need two pieces of information:

  1. The PCI address (formatted for XCP-ng).
  2. The UUID of your target VM.

The command looks like this:

xe vm-param-set other-config:pci=0/0000:80:17.0 uuid=<YOUR_VM_UUID>
  • 0/0000:80:17.0: This tells XCP-ng to assign the device from domain 0 to the target.
  • uuid=...: This is the unique identifier for your specific VM.

Step 5: Final Polish (Optional)

In some complex setups—especially if you are passing through multiple integrated components like GPUs or complex chipsets—the VM might need permission to handle the hardware more loosely. If your VM struggles to initialize the device, you can try setting the permissive flag:

xe vm-param-set uuid=<YOUR_VM_UUID> other-config:pci_permissive=1

Success!

Start your VM. Once it boots, run a command like lsblk or check the device manager within the guest OS. You should now see all your SATA block devices appearing as if they were physically plugged into a real machine.