Beginner's Guide to Setting up QEMU Devel Env
Example: test io_uring.c in QEMU
Environment: Fedora 35
It requires a host[1] os having a new kernel, QEMU and liburing.git(one specific version).
build the kernel from source:
various mistakes can arrive when installing new kernel from source. However, there are certain steps requiring more attention.
When I found a seemly good tutorial and tried it: Read error message to know which type of error and google it.
-
security check in config file(this part is literally killing me :): you can disable security check by modifying config file.
If you meet a SSL error when
make modules_install
like me after disabling the security check above and discover that sign file missing, you may checkCONFIG_SYSTEM_TRUSTED_KEYS='certs/signing_key.pem'
and remake again. -
Orders of make commands:
1
2
3
4
5
6
7make menuconfig
make -j 8
make modules
make bzImage
sudo make modules_install
sudo make install
sudo kernel-install add <version> /boot/vmlinuz-<version> # Fedora linux
build QEMU from source: Follow the documentation
build liburing from source: After this step, liburing support can be found in config with version 2.2 and QEMU should run correctly.
-
check a few things before
make install
:-
right kernel version:
uname -ra
->5.17-rc7
-
No liburing package(liburing and liburing-devel) installed
-
-
Orders of commands: configure it first
after fetching liburing.git:
1
2./configure --libdir=/usr/lib64 --libdevdir=/usr/lib64 # /usr/lib for Ubuntu Linux
make && sudo make install
It should work by now.
Qemu:
it is better to know common commands to trace, debug, test.
1 | # default setting: |
Err log:
I have met a lot of issues[2] when setting up the enviroument. Luckily, the mentors of QEMU are very good and patient to go through this with me.
it should be noticed that the host and guest in QEMU stand for. QEMU host is where QEMU runs and guest is to run on QEMU. In QEMU’s term, “–enable-kvm” ensures QEMU is running on the host and “-kernel” implies a guest os running. ↩︎
Attach a log here. I will reorganize it when outreachy application term finishes. ↩︎