WSL2-Linux-Kernel icon indicating copy to clipboard operation
WSL2-Linux-Kernel copied to clipboard

FAILED: load BTF from vmlinux

Open JustGuardian opened this issue 1 year ago • 7 comments

I know that this might be a dead project, but I am facing this issue when launching the first command to build the kernel

make -j $(expr $(nproc) - 1) KCONFIG_CONFIG=Microsoft/config-wsl modules

builds lots of files but then it errors like this:

 MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.btf
  BTF     .btf.vmlinux.bin.o
  LD      .tmp_vmlinux.kallsyms1
  KSYMS   .tmp_vmlinux.kallsyms1.S
  AS      .tmp_vmlinux.kallsyms1.S
  LD      .tmp_vmlinux.kallsyms2
  KSYMS   .tmp_vmlinux.kallsyms2.S
  AS      .tmp_vmlinux.kallsyms2.S
  LD      vmlinux
  BTFIDS  vmlinux
FAILED: load BTF from vmlinux: Unknown error -22make: *** [Makefile:1179: vmlinux] Error 255

I am in a fresh ubuntu installation.

JustGuardian avatar Dec 29 '23 18:12 JustGuardian

same issue did you find any updates

morpheuslord avatar Jun 14 '24 16:06 morpheuslord

same issue help plz

johnathanSigmale avatar Aug 16 '24 10:08 johnathanSigmale

Even I was facing same issue on the 8GB ram machine. I used following .wslconfig and it worked for me. I have set memory more than my device's actual memory and 12 GB of swap for the kernel compilation purpose only.

# Settings apply across all Linux distros running on WSL 2
[wsl2]

# Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB
memory=10GB

# Sets the VM to use two virtual processors
processors=2

# Sets amount of swap storage space to 8GB, default is 25% of available RAM
swap=12GB

# Sets swapfile path location, default is %USERPROFILE%\AppData\Local\Temp\swap.vhdx
swapfile=D:\\swap\\wsl-swap.vhdx
 
# Disable page reporting so WSL retains all allocated memory claimed from Windows and releases none back when free
pageReporting=false

# Disables nested virtualization
nestedVirtualization=false

# Turns on output console showing contents of dmesg when opening a WSL 2 distro for debugging
debugConsole=true

# Enable experimental features
[experimental]
sparseVhd=true

After adding this file, run "wsl --shutdown" in powershell and start wsl instance again.

Most of the values I have used default from given sample config from here

Dev-byte-source avatar Aug 25 '24 06:08 Dev-byte-source

Thanks for all the answers guys, now I try @Dev-byte-source method.

JustGuardian avatar Aug 25 '24 11:08 JustGuardian

@JustGuardian did it work for you ?

johnathanSigmale avatar Aug 26 '24 19:08 johnathanSigmale

Hi, I get the same error, but I try to build it on a ubuntu maschine with 32 gb of ram. Any idea why it throws the error?

DonnerGreif1771 avatar Sep 05 '24 18:09 DonnerGreif1771

any updates??

WarcaIT avatar May 26 '25 19:05 WarcaIT