microsoft / microsoft/WSL

MirroredMode: Virutalbox Host only interface ip address not mirrored

Open
#14,381 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

### Windows Version

Microsoft Windows [Version 10.0.26200.7840]

### WSL Version

2.4.13.0

### Are you using WSL 1 or WSL 2?

- [x] WSL 2
- [ ] WSL 1

### Kernel Version

5.15.167.4-1

### Distro Version

Ubuntu 20.04

### Other Software

### Repro Steps

Use Host-only network in virtualbox.
[Alread mentioned](https://github.com/microsoft/WSL/issues/11642) not sure why was that issue closed, currently there is a workaround of just finding interface with same MAC on windows host and WSL guest and assigning it same ip address as on Windows host and enabling it.

```
ip addr set dev eth up
ip addr add 192.168.56.1/24 dev eth
```

Personaly I think its a bug and should be mirrored correctly.

### Expected Behavior

I expect interface to be mirrored correctly.

### Actual Behavior

Interface isn't mirrored correctly. The problem is that interface seems to change for some rason, somehow WSL interface assignment doesnt even behave deterministically. Since once it assigned me eth1 and second time eth0. So interface assignment being deterministic, would at least allow me to write network config to assign static ip. Now I need to write script, that detects MAC address and based on it it assigns ip address.

### Diagnostic Logs
These are just some logs, its just because github actions bot complained. Not sure that this is even logged.

[wsl-install-logs.txt](https://github.com/user-attachments/files/25839139/wsl-install-logs.txt)

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 reproducing the reported setup: WSL 2.4.13 with Ubuntu 20.04 on Windows, using a VirtualBox host-only network. Compare the interface MAC, IP address, and eth/eth1 assignment between the Windows host and WSL guest; done means the host-only interface is mirrored as expected with a predictable assignment.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.