Skip to content

Commit

Permalink
Edit WSL2 install instructions
Browse files Browse the repository at this point in the history
Fix a typo "modules" in instructions.
Add instructions for cloning the WSL2-Linux-Kernel git repo.
Add sudo for `make modules_install` command.
Add instructions for renaming /lib/modules/x.y.z-microsoft-standard-WSL2+
even on recent kernels (needed this on 5.10).
  • Loading branch information
wedaly authored and yonghong-song committed Oct 8, 2022
1 parent a8a0103 commit fe8acc4
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,19 +274,30 @@ sudo docker run --rm -it --privileged \
## WSL(Windows Subsystem for Linux) - Binary

### Install dependencies
The compiling depends on the headers and lib of linux kernel module which was not found in wsl distribution packages repo. We have to compile the kernel moudle manually.
The compiling depends on the headers and lib of linux kernel module which was not found in wsl distribution packages repo. We have to compile the kernel module manually.
```bash
apt-get install flex bison libssl-dev libelf-dev dwarves
```
### Install packages

First, you will need to checkout the WSL2 Linux kernel git repository:
```
git clone [email protected]:microsoft/WSL2-Linux-Kernel.git
cd WSL2-Linux-Kernel
KERNEL_VERSION=$(uname -r | cut -d '-' -f 1)
git checkout linux-msft-wsl-$KERNEL_VERSION
```

Then compile and install:
```
cp Microsoft/config-wsl .config
make oldconfig && make prepare
make scripts
make modules && make modules_install
# if your kernel version is 4.19.y
mv /lib/modules/x.y.z-microsoft-standard+ /lib/modules/x.y.z-microsoft-standard
make modules
sudo make modules_install
sudo mv /lib/modules/$(uname -r)+ /lib/modules/$(uname -r)
````

Then you can install bcc tools package according your distribution.

If you met some problems, try to
Expand Down

0 comments on commit fe8acc4

Please sign in to comment.