Skip to content

Instantly share code, notes, and snippets.

@mietzen
Last active January 4, 2026 01:14
Show Gist options
  • Select an option

  • Save mietzen/6174d04a560fa0bb35f8e752f4743382 to your computer and use it in GitHub Desktop.

Select an option

Save mietzen/6174d04a560fa0bb35f8e752f4743382 to your computer and use it in GitHub Desktop.
Guide on how to setup ASMedia 1166 Passthrough in Proxmox

Guide: Setting Up ASMedia 1166 on Proxmox

To flash the controller with the correct firmware, you must have access to a Windows machine.

⚠️ Do NOT use version 241224-0000-00!

With this version, starting the VM in Proxmox will hang indefinitely. The VM start command never completes, and you're forced to hard reset the Proxmox host. This is also the version reporting 32 SATA Devices instead of 6.


Firmware

Download and flash this firmware version: 211108-0000-00 (archived version). Other might work as well, but this is the one I'm using.

image

My System:

  • AMD Ryzen Pro 5655G
  • GIGABYTE B550I AORUS PRO AX

Kernel Parameters

If Proxmox is installed using ZFS:

Edit /etc/kernel/cmdline and append the following parameter:

iommu=pt

If installed using LVM/ext4:

Edit /etc/default/grub and add it inside the GRUB_CMDLINE_LINUX line:

GRUB_CMDLINE_LINUX="... iommu=pt"

Check IOMMU Groups

Run the following to list your IOMMU groups:

shopt -s nullglob
for g in $(find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V); do
  echo "IOMMU Group ${g##*/}:"
  for d in $g/devices/*; do
    echo -e "\t$(lspci -nns ${d##*/})"
  done
done

If your ASMedia 1166 controller shares an IOMMU group with other devices, add this parameter as well:

pcie_acs_override=downstream,multifunction

Add it to /etc/kernel/cmdline or /etc/default/grub, depending on your setup.


Load Required Modules

Edit /etc/modules and add the following lines:

vfio
vfio_iommu_type1
vfio_pci

Blacklist AHCI for ASM1166

Create /etc/modprobe.d/ahci-blacklist.conf with the following content:

options vfio-pci ids=1b21:1166
softdep ahci pre: vfio-pci

Rebuild Initramfs

Run:

update-initramfs -u -k all

Then reboot your system.


Verify the config

After reboot, run:

lspci -nnk | grep -A 3 ASM1166

You should see something like:

03:00.0 SATA controller [0106]: ASMedia Technology Inc. ASM1166 Serial ATA Controller [1b21:1166] (rev 02)
    Subsystem: ZyDAS Technology Corp. ASM1166 Serial ATA Controller [2116:2116]
    Kernel driver in use: vfio-pci
    Kernel modules: ahci

The line Kernel driver in use: vfio-pci confirms that the controller is bound correctly.


Add Device to VM

Now, you can add the ASM1166 controller to your VM under Hardware -> Add -> PCI Device in the Proxmox UI.

@TimotheFCN
Copy link

This saved me a lot of time and money, thanks a lot !
Works perfectly with my ASM1064 controller.

@cfouche3005
Copy link

do you use BIOS or UEFI for the VM ?

@mietzen
Copy link
Author

mietzen commented Sep 23, 2025

I used BIOS

@cfouche3005
Copy link

Yeah, from my testing, UEFI VM hang with the controller passthrough. Does your VM boot quickly or does it take time (notably on the bios screen) ?

@mietzen
Copy link
Author

mietzen commented Sep 23, 2025

Boots as fast as with no passthrough.

@cfouche3005
Copy link

Mine take a long time to boot when using PCIE passthrough. I hoped it was due a firmware problem but I am on 221118006b00 with no problem for PCIe passthrough.

@thesnallygaster
Copy link

Yeah, from my testing, UEFI VM hang with the controller passthrough. Does your VM boot quickly or does it take time (notably on the bios screen) ?

If your vm hangs when using pve 9 try disabling ROM-Bar for the PCI Device in vm settings (it's hidden under advanced checkbox)

@Byolock
Copy link

Byolock commented Oct 14, 2025

EDIT: It does work (but I too have a delay at the bios screen - maybe 40 seconds) . My Problem seems to come from the fact I am attaching 2 ASM1166 on a PCIe Bifurcation Board.

--------------- Original Comment ------

Does not work for me. I can start the VM once but it does not see any disks. If I shut the vm down and try to start it again it can not start anymore :

error writing '1' to '/sys/bus/pci/devices/0000:0a:00.0/reset': Inappropriate ioctl for device
failed to reset PCI device '0000:0a:00.0', but trying to continue as not all devices need a reset
error writing '1' to '/sys/bus/pci/devices/0000:09:00.0/reset': Inappropriate ioctl for device
failed to reset PCI device '0000:09:00.0', but trying to continue as not all devices need a reset
kvm: ../hw/pci/pci.c:1803: pci_irq_handler: Assertion `0 <= irq_num && irq_num < PCI_NUM_PINS' failed.
TASK ERROR: start failed: QEMU exited with code 1

@cfouche3005
Copy link

Yeah, from my testing, UEFI VM hang with the controller passthrough. Does your VM boot quickly or does it take time (notably on the bios screen) ?

If your vm hangs when using pve 9 try disabling ROM-Bar for the PCI Device in vm settings (it's hidden under advanced checkbox)

Sorry for not replying sooner but it doesn't change, it still take a long time on the bios screen. (Also I use incus, which use qemu in the backend so no big change compared to proxmox)

@denovare
Copy link

Came here to say: you are the GOAT my man! Spent hours to get that stupid passthrough working and was finally able to it with your guide. Thanks a lot!

@ireun
Copy link

ireun commented Nov 19, 2025

I've flashed "241224-0000-00" on my ASM1064, that I've pass-through to TrueNAS VM in Proxmox - works just fine (without anything that you had to set - I've only set pcie_aspm=off for ASPM errors).

@cloudschnell
Copy link

cloudschnell commented Dec 22, 2025

thanks! flashed to 241224, everything looks okay... then create a new machine with asm, and every machine with this controller got errors.

yet is working again!

---edit:
checked again in power top 32 ports! single asm1166 under OMV... firmware Version: 211108-0000-00

@simonjur
Copy link

👍 this worked for me flawlessly. thank you

@iskl
Copy link

iskl commented Jan 3, 2026

This saved me a lot of time and money, thanks a lot ! Works perfectly with my ASM1064 controller.

May I ask which version of the firmware you flashed? Was it from the webpage provided by the author as
https://www.station-drivers.com/index.php/th/component/remository/Drivers/Asmedia/ASM-106x-Sata-6G-Controller/Firmwares/Asmedia-ASM-2116-116x-Sata-6G-Controller-Firmware-Version-NC/lang,th-th/,
or from
https://www.station-drivers.com/index.php/th/component/remository/Drivers/Asmedia/ASM-106x-Sata-6G-Controller/lang,th-th/
?

According to the author's description, the ASM1166 requires firmware version 211108-0000-00. And, based on the firmware webpage, this version appears to be intended for the ASM-2116/116x series, while it seems that ASM1064 has a separate firmware.

@geobdesign
Copy link

I'm new to Proxmox and trying to follow this tutorial.

I have a latest gen MSI Intel 125H NUC using M.2 to SATA ASM1166.

1 - I successfully downgraded the firmware to the recommended version.
2 - I have PVE OS installed on it's own Ext4 LVM NVMe.
3 - I want to create a ZFS RADI10 with 4x Ent. SSDs (for VMs and LXCs) using this ASM1166 M.2 to SATA card.
4 - It also looks like I do not have my ASM sharing a IOMMU group:
IOMMU Group 18: 01:00.0 SATA controller [0106]: ASMedia Technology Inc. ASM1166 Serial ATA Controller [1b21:1166] (rev 02) IOMMU Group 19:... etc

I'm new to Proxmox and only have basic Linux experience over the decades.
So unfortunately I'm confused about some of the recommended steps.
And I have been looking for YT and other posts to clear some of it up and only getting more confused.

Has any one come across a related article or YT video they can recommend that will clear up some of this?

Ideally a way to do some of this via the GUI?

So I can better view and understand what is changing?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment