Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WSL2] wsl2 machine is not re-entrance capable by default - network collision #3269

Open
arixmkii opened this issue Feb 23, 2025 · 0 comments

Comments

@arixmkii
Copy link
Contributor

Description

Scenario:

  1. run machine starting container with networking and then delete it
limactl create template://experimental/wsl2
<output omitted>

limactl start wsl2
<output omitted>

limactl shell wsl2 sudo nerdctl run -d -p 8080:80 nginx
<output omitted>

limactl stop wsl2
<output omitted>

limactl delete wsl2
<output omitted>
  1. try to use the scenario of step 1 again and get error starting container
limactl create template://experimental/wsl2
<output omitted>

limactl start wsl2
<output omitted>

limactl shell wsl2 sudo nerdctl run -d -p 8080:80 nginx

FATA[0006] failed to verify networking settings: failed to create default network: subnet 10.4.0.0/24 overlaps with other one on this address space

I have the default Ubuntu instance in WSL2, so I could check that there is actually a network leftover:

wsl -d Ubuntu ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:15:5d:0e:30:ad brd ff:ff:ff:ff:ff:ff
3: nerdctl0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 7e:90:3b:41:32:17 brd ff:ff:ff:ff:ff:ff

And I have to manually delete it with command line or restart the WSL2 fully

wsl --shutdown
<output omitted>

wsl -d Ubuntu ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:15:5d:0e:3a:da brd ff:ff:ff:ff:ff:ff

I didn't check, but I expect the same issue if running 2 WSL2 instances side by side (this might be unsupported scenario and in this case requires only documentation). The supported scenario with machine deletion w/o restarting the subsystem might be still desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants