Obtain kernel config from currently running Linux system?

Depending on your system, you'll find it in any one of these:

  1. /proc/config.gz
  2. /boot/config
  3. /boot/config-$(uname -r)

and possibly more places.


For an actual running kernel, one way to get the config file this is to

cat /proc/config.gz | gunzip > running.config

or,

zcat /proc/config.gz > running.config

Then running.config will contain the configuration of the running linux kernel.

However this is only possible if your running linux kernel was configured to have /proc/config.gz. The configuration for this is found in

  • General setup
    • [*] Kernel .config support
      • [*] Enable access to .config through /proc/config.gz

Most distributions do not have this configuration set. They provide kernel config files in their kernel packages and is usually found in /boot/ directory.


A Little bit late but maybe it helps someone. I didn't have /proc/config.gz nor /boot/config nor /boot/config-$(uname -r) on my Computer. I had to run modprobe configs as root. Then, /proc/config.gz was present