Assumptions: Host machine is linux.
- Download virtualbox
- Install a linux flavour. Preference for Debian since distro-dependent commands in the following steps will be debian-dependent
- Run your VM.
- Inside VM, download last kernel code from kernel.org
- Extract linux src code
- Copy your configuration file from
/boot/config-$(uname -r)
to.config
in the extract linux src code folder. - Make sure
.config
has the following options: CONFIG_FRAME_POINTER=y , CONFIG_KGDB=y , CONFIG_KGDB_SERIAL_CONSOLE=y , CONFIG_KGDB_KDB=y , CONFIG_KDB_KEYBOARD=y. Change if necessary. Alternatively usemake xconfig
to configure in UI. - Install compilation dependencies (debian:
sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev
)