[TUTORIAL] How to Build a New Kernel to Support ASMEDIA Controllers

Seed

Renowned Member
Oct 18, 2019
134
69
68
126
A couple days ago I ran into a frustrating issue. My UGREEN DXP8800 Sata controller is an ASMEDIA 1164 controller and worked fine with the latest updates of proxmox, was broken in 9.0 beta if I recall, and the promox kernel. A motherboard I have that am porting some hardware too, however, 1064 controller didn't work. This was irritating. I then bought a SATA card with the 1166 controller and that didn't work either. Only the 1164 controller worked. With some reading on this forum I understood that only a specific version of the ASMEDIA controller, 1164, essentially had an official fix so I started snooping around. After some work I've been able to rebuild a kernel that supports the 1064 and should support the 1166 controller along with the existing 1164 controller of ASMEDIA. My symptons when trying to pass it through was simply, it wouldn't appear in my iommu group on the VM and would break proxmox essentially trying to manage the VM after first bind and I would have to reboot the host. I will do some testing this weekend on moving my drives back to this onboard controller (1064) but for the time being I wanted to note the process on how someone, really anyone with some relatively decent linux experience, can do this themselves. I also moved this to a personal automated pipeline that builds the kernel weekly so I can add other versions if necessary. I don't really want to deal with submitting update requests upstream. If other people would like the deb packages I could look at making the builds public. For now here's a list of directions:

Also, as a caveat, I don't claim to be an expert here. I have built custom kernels before for wifi adapters and video cards etc. etc and am a tech professional by trade just not in this field, at all. I am an enthusiast and love Proxmox and the value and the community it brings to many of us, so trying to help the community here. Do this at your own risk and on a dev system. Production hardware likely doesn't care about ASMEDIA controllers but your homelab may so just be aware.

If there is enough support and need I can make the kernel bundle releases available for download that should support these added 2 ASMEDIA controllers. Will know with some testing coming soon (today timestamp 6/2/2026) Just chime in on the thread and if there's enough need or interest from people I can look into it if it helps people and people can test. This kernel will be built weekly and should update to new kernel updates automatically with proxmox as it moves forward as well. This thing could also explode too I have no idea, but will know more as testing happens. Also note my system does the modules work to blacklist the controllers from proxmox as well so this may be needed not sure. See other posts on how to manage these two configs but here's the config:

Code:
 /etc/modprobe.d/ahci-blacklist.conf
 
options vfio-pci ids=1b21:1064,1b21:1166
softdep ahci pre: vfio-pci

Code:
/etc/modules-load.d/modules-custom.conf

vfio
vfio_iommu_type1
vfio_pci

Here is the controller appearing now in the VM, where before it simply wouldn't. Interrupts seem to work ok and reboots work cleanly. I was going to return the 1166 controller but will test it this weekend as well. Regardless this is a kernel build guide mainly for this kind of thing. Function of the result to come.

Code:
08:0e.0 SATA controller [0106]: ASMedia Technology Inc. ASM1064 Serial ATA Controller [1b21:1064] (rev 02)

I ran this build on a VM of fresh debian 13.5 in proxmox and followed their dev guide for env stuff but here's what I have noted:

This took about an hour to build, 40GB RAM, 8 CPUs. Intel desktop hardware. I may have missed a step or a package but this should be relatively complete.

Add proxmox dev repo

Code:
/etc/apt/sources.list.d/proxmox.sources

Code:
Types: deb
URIs: http://download.proxmox.com/debian/devel/
Suites: trixie
Components: main
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg

Get the keyring for the proxmod
Code:
wget http://download.proxmox.com/debian/pbs-client/dists/trixie/main/binary-amd64/proxmox-archive-keyring_4.0_all.deb

Install keyring
Code:
dpkg -i proxmox-archive-keyring_4.0_all.deb

Install packages:
Code:
apt update && apt install -y wget python3-setuptools systemtap-sdt-dev llvm-dev libbabeltrace-dev libcapstone-dev libpfm4-dev curl perl dh-python sphinx-common build-essential devscripts libncurses-dev flex bison bc libelf-dev libssl-dev

Clone kernel code: README -> https://github.com/proxmox/pve-kernel
Code:
git clone https://git.proxmox.com/git/pve-kernel.git

cd into directory (working dir)
Code:
cd pve-kernel

build dir
Code:
make build-dir-fresh

Edit file:
Code:
./proxmox-kernel-7.0.6/ubuntu-kernel/drivers/pci/quirks.c

Add 2 quirks after existing 1164 quirk in fole
Code:
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ASMEDIA, 0x1064, quirk_no_bus_reset);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ASMEDIA, 0x1166, quirk_no_bus_reset);

build deps
Code:
mk-build-deps -ir proxmox-kernel-7.0.6/debian/control

make the packages(8 deb packages will be built)
Code:
make deb

uninstall existing kernel cause you'll get a conflict.
Code:
apt-get remove proxmox-kernel-7.0.6-2-pve-signed

Get ALL built deb packages from your build, into a dir and run:

Code:
dpkg -i proxmox-kernel-*.deb

reboot.

You can also peg this kernel if you like so updates don't overwrite it. Up to you
 
Last edited:
UPDATE:

I decided to test my existing Truenas VM that was running a pair of disks for a Frigate storage array (stripe) off the onboard Intell AHCI Mode Sata Controller. Put one disk on the other 1064 on-board controller and the other disk on the PCIe 4x3 Amazon 6 port 1166 card.

Code:
08:0e.0 SATA controller [0106]: ASMedia Technology Inc. ASM1064 Serial ATA Controller [1b21:1064] (rev 02)
08:0f.0 SATA controller [0106]: ASMedia Technology Inc. ASM1166 Serial ATA Controller [1b21:1166] (rev 02)

Booted Truenas VM with the 2 controllers passed through and the Truenas ZFS 2 disk array on these seperate controllers are working. Will let it run over night to see if it's stable.
 
Last edited:
With surveillance video (9x4k) constantly writing to both disks for 12 hours, so far it's been stable and no issues.