Solved Kernel development debugging with DDB/KDB/KGDB just hangs


New Member

Messages: 1


As part of a smaller research project I’d like to modify the FreeBSD kernel and some of its system calls and MAC apis. For better exploration of how things currently work I’d like to step through some of these calls and possibly view values of kernelspace adresses.
I am running FreeBSD 11.1 in Vagrant/VirtualBox, and I thought I could just recompile the kernel with my changes as well as a new DEBUG kernel configuration.
The build and installation of the kernel works fine and my changes are included after a reboot. Running sysctl debug.kdb.available only prints ddb (and not kgdb or kdb), and entering sysctl debug.kdb.enter=1 to force a panic freezes the system – the DDB prompt never shows up and I have to reboot the VM.

Am I missing some option? Does it only work over a serial connection? Or could Vagrant or VirtualBox possibly cause some issues?
I would love to hear about how other people have configured a development environment for kernel development.

[SOLVED] I ran the machine in a headless mode through Vagrant, and the (k)db console only shows up when not running headless.
Last edited: