microsoft / microsoft/WSL

Enable VRF Support in WSL2 linux kernel

Open
#6,850 7 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature kconfig
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

Is your feature request related to a problem? Please describe.
My team in Azure is trying to adopt WSL2 as our dev environment. Our dev work and tests depend on linux VRFs but this isn't currently included in the WSL2 linux kernel build.

Describe the solution you'd like
I'd like a straight forward way to enable VRF support the WSL2 linux kernel. This can be:

  1. VRF support enabled by default
  2. Ability to compile and insert vrf module into the shipped kernel easily.

Describe alternatives you've considered
I looked into compiling the VRF module and inserting it into the pre-installed kernel on boot. This has two problems:

  1. VRF depends on IPV6_MULTIPLE_TABLES which has to be a built-in module but isn't included in the default kernel.
  2. Even if the IPV6_MULTIPLE_TABLES was built-in, WSL2 at the moment doesn't support inserting kernel modules.

As a workaround, I have compiled a WSL2 linux kernel release with the config needed to support VRFs and replaced the default shipped kernel with this. This works Ok, but:

  1. It is not scalable -- We want to be able to allow developers to be up and running without going through this process.
  2. It is not maintainable -- We'll need to re-rollout this solution for each new kernel update.

Additional context

Enabling VRF requires this additional config:

CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_NET_VRF=y

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WSL2 Linux kernel build configuration and the settings named in the issue: CONFIG_IPV6_MULTIPLE_TABLES and CONFIG_NET_VRF. Check how the shipped kernel is configured and built, then verify whether VRF is available without a custom kernel or module insertion. Done means a supported WSL2 kernel build provides VRF for developers without manual replacement.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
networking, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.