For new or intermediate kernel developers, here are some tips for using virtual machines to work more effectively.
Kernel Development with VMs: Some Tips | Groveronline
When doing kernel development, doing it in a virtual machine can be very convenient, if there's no need for actual hardware devices or features. This is especially true for network or client/server development where multiple physical machines would otherwise be needed.
9 plus ones
Shared publicly•View activity
- Nice tutorial, thanks for sharing!
Some minor additions:
A) Instead of talking to the guest by means of VNC, run the VM without graphics:
* set up a serial kernel console as described in the tutorial, step 1)
* set up your VM to offer a getty prompt on the serial console
* start qemu with the -nographic option
=> When starting qemu from the console, you will now get kernel boot
messages directly in this same shell.
=> After booting finished, you will get a login prompt at the same shell.
This basically reduces qemu to a command line application.
B) Use qemu's gdb stub (-s or -gdb options). You can step through kernel code, set up break points and the like, and generally debug your kernel code just like you would debug a user space app.Dec 16, 2013
- I second Thilo's advice. I've been using this for most of my work recently. In some cases (i.e usb) it's perfectly fine to do the development within the VM using qemu (kvm?) USB's passthrough.Dec 16, 2013
- I've never tried it, but can you kdump from the guest back out to the host via netdump?Jan 14, 2014
Add a comment...