Docker0 interface missing Docker Desktop + WSL

I installed docker desktop and WSL on my windows machine using instructions provided by the docs. However, I cant find any docker0 interfaces.

Ifconfig in WSL gives this:

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 2  bytes 100 (100.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 2  bytes 100 (100.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 172.19.80.125  netmask 255.255.240.0  broadcast 172.19.95.255
    inet6 fe80::215:5dff:fe2d:1dc0  prefixlen 64  scopeid 0x20<link>
    ether 00:15:5d:2d:1d:c0  txqueuelen 1000  (Ethernet)
    RX packets 261  bytes 39151 (39.1 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 158  bytes 14434 (14.4 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I found this in the docs as well:

There is no docker0 bridge on the host
Because of the way networking is implemented in Docker Desktop, you cannot see a docker0 interface on the host. This interface is actually within the virtual machine.

It says the interface is within the virtual machine which I assume corresponds to WSL yet I cant find the docker0 interface. For more information, I’m able to use docker commands e.g. docker ps in WSL so its definitely installed. I’m a beginner and trying to learn how networking is done with docker

There is nothing missing. It is not available by design.

On Windows with WSL2 backed, the “virtual machine” consists of the wsl system vm that provides the kernel shared by all WSL2 distributions, and the docker-desktop distribution.

Still, not even the docker-desktop distro will be able to see the docker0 interface, as the docker engine is run inside some sort of isolated container, which is the one that will see the interface. You can access it by running docker run -it --rm --privileged --pid=host justincormack/nsenter1 in a PowerShell terminal.

Of course other WSL2 distribution with enabled WSL integration aren’t able the see the docker0 interface either.

Though, why do you need access to the docker0 interface ?

1 Like