peiyuanix / build-your-own-zerotier

Build your own layer-2 virtual switch in less than 300 lines of code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Under WSl2 environment, client-2 started failed

zjb1001 opened this issue · comments

Environment:

PS C:\Users\ui> wsl -l -v
NAME STATE VERSION

  • Ubuntu Running 2
    docker-desktop Stopped 2
    docker-desktop-data Stopped 2

Client-2 start error info:
pg@HW:build-your-own-zerotier$ sudo ./vport 172.30.201.250 9999
[sudo] password for pg:
fail to tap_alloc: Device or resource busy

Any suggestion to fix it?

I haven't tested the program in wsl2.
It looks like your error info is related to linux tun/tap device.
Maybe, you can confirm if /dev/net/tun exists.

And these keywords may be helpful: wsl2 tun tap

Summary my test result, we can not assign two clients under the same kernel (here is the wsl2 kernel), because the tap device had been created after once one client was created, then it will conflict the when the second client was created.