You need to install this on a qubes machine. This is so that it can pull u2mfn from the qubes kernel you're running. This was performed on Qubes 4.0 using a fedora 28 Qube.
You need to run
1 sudo dnf install @Development-tools quilt gcc-c++.x86_64 gcc.x86_64 gcc-plugin-devel libseccomp.x86_64 libseccomp-devel.x86_64 libseccomp-static.x86_64 xen-devel.x86_64 gtk2-devel inotify-tools
To get the build environment
1 git clone git clone https://github.com/QubesOS/qubes-vmm-xen-stubdom-linux
To get the code.
To get this to compile, you need to remove "qubes-gui-agent.patch" from /home/user/qubes-vmm-xen-stubdom-linux/qemu/patches . TODO How to get this to compile with the gui agent patch?
Set up exports for the makefiles
Run make to download qemu/etc.
To debug if make fails.
Go into the dl directory (for some reason it doesn't copy from there across?)
Remove "build/qemu/.gui-agent-copied-in" from "build/qemu/i386-softmmu/qemu-system-i386: build/qemu/.patched build/qemu/config.status build/qemu/.gui-agent-copied-in" in Makefile.stubdom
1 make -f Makefile.stubdom
Output should be in