I came across the same problem and fix it after struggling. For clarity and reproducibility, I list all the steps.
- create the qcow2 image from ISO ref
disk_img=ubuntu.qcow2
iso_name=ubuntu-21.04-desktop-amd64.iso
qemu-img create -f qcow2 "$disk_img" 1T
qemu-system-x86_64 \
-cdrom "$iso" \
-drive "file=${disk_img},format=qcow2" \
-enable-kvm \
-m 2G \
-smp 2 \
;
Then, you install Ubuntu as the instructions, once finished, just reboot.
- Run the Ubuntu with built-in kernel.
qemu-system-x86_64 \
-drive "file=${disk_img},format=qcow2" \
-enable-kvm \
-m 8G \
-smp 8
In Qemu, open a terminal and use df -h to find out from which drive your Ubuntu boot.On my computer, it's "/dev/sda3".

- compile the kernel
cd /kernel/src/path
git reset --hard origin/master
make defconfig
make -j4
- Run the Ubuntu with the newly compiled kernel with hard drive specified
qemu-system-x86_64 \
-hda ${disk_img} \
-enable-kvm \
-append "root=/dev/sda3" \
-kernel /kernel/src/path/arch/x86/boot/bzImage \
-cpu host \
-m 8G \
-smp 8
As the following pictures says, the kernel is what I just compiled.

The key point is to inform the kernel 'root=/dev/sda3', as can be obtained in step 2.