-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support for kdump/kexec on WSL2 #5823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You need to enable the relevant config option and add it to .wslconfig |
Where would I as a curious user, go to change that? Suppose, mind you suppose, I had an interest in using either that feature, or the kexec one? |
So I don't know which kernel option enables these but you can create a .wslconfig with notepad or some other text editor and place it at C:/Users/user. You can find examples on what to put for config options here in the github. The release notes have the template (or you can just use a search engine, plenty of blogs about it). |
I guess that will work. I'm also interested in kexec as well. |
https://www.kernel.org/doc/html/v5.8/admin-guide/kdump/kdump.html should do the trick. Per the doc, kdump uses kexec to execute. Now we both know the kernel option needed. I would recommend rebuilding a new kernel with the options you want enabled (there are a number of them there to choose) and specifying it in .wslconfig. |
Thanks, I did not know about .wslconfig I will check that out. I will
search to learn some more, such as if the file goes in the root of your
profile does that mean one config for all installed instances.
Cheers,
Graham
|
@WSLUser so you're saying that I should create configure in my user name file, that contains the appropriate terms in it? And of course it would be called .wslconfig? Interesting. @grahamm78 what's your take on this? |
#4694 (comment) Here's an example for you and comes straight from one of the MS devs. |
I've gotten a lot further now! I've still got a few pieces to figure out though. I built 2 kernels with updated .config based on the 4.19.128-microsoft-standard kernel. I followed some steps herewhich were helpful on building the kernel, then went back to the kdump documentation to set config options
System Kernel cp Microsoft/wsl-config .config-syskernel
cp .config-syskernel .config Dump-capture kernel
cp .config-dumpkernel .config
Now I launched wsl and I saw the custom kernel and kernelcommandline take effect.
root@GRAHAMM-Z2:/dev# kexec -p /mnt/c/Windows/system32/lxss/tools/dumpkernel root@GRAHAMM-Z2:/dev# cat /sys/kernel/kexec_crash_loaded But - I tried to test it with kdump-config test and it dies because KDUMP_KERNEL doesn't exist.
so I need to find the places to fix the rest of the configuration settings
EDIT I found the config file nano /usr/share/kdump-tools/kdump-tools.conf root@GRAHAMM-Z2:/mnt/c/Users/grahamm# kdump-config test
|
One note of advice - don't put your custom kernels in c:\Windows\system32\lxss\tools\ I'll keep working on this and post an update if I find a solution. |
I am trying to set up kernel core dumps (preferably kdump but vmcore is OK) on WSL2 4.19.128-microsoft-standard. I'm wanting to use this for testing, and debugging (I'm working on some kernel panic / dump parsers) and was hoping I could use WSL2 to generate kdumps via sysrq or driver causing an OOPS. I can install kdump-tools and kernel-kdump but I cannot get it all configured, such as setting crashkernel kernel variabl
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
Unclear if there are workarounds outside of not using WSL2 for kdump. For sysrq issue that can be resolved by building a driver to trigger a panic.
Additional context
kdump-config show
DUMP_MODE: kdump
USE_KDUMP: 1
KDUMP_SYSCTL: kernel.panic_on_oops=1
KDUMP_COREDIR: /var/crash
crashkernel addr:
/var/lib/kdump/vmlinuz
kdump initrd:
/var/lib/kdump/initrd.img
cat: /sys/kernel/kexec_crash_loaded: No such file or directory
/usr/sbin/kdump-config: line 155: [: too many arguments
current state: Not ready to kdump
The text was updated successfully, but these errors were encountered: