microsoft / microsoft/WSL

Provide static IP option in .wslconfig (or elsewhere)

Open
#6,858 6 comments 29 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature network
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.
Currently, I'm attempting to host my own webserver on my machine using WSL2, but because of the changing IP address on VM restart, the domain I registered keeps losing the webserver and I would have to update it on the domain manager's site. I know the simple fix would be to use a CSP, but I'm trying to limit any issues/unexpected costs from occurring during development.

Describe the solution you'd like
The ability to configure a static IP for the VM through something as simple as the .wslconfig file

Describe alternatives you've considered
I've read over

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 by reviewing how .wslconfig is parsed and how WSL2 VM networking is configured. Determine whether a static IP can be supported there or elsewhere, then verify that the configured address persists across VM restarts and that the expected webserver use case works.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
networking, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.