I've installed ubuntu 20.04 on WSL2 and I started a VM with qemu and kvm,running mac os x as guest os. It works great,except for the configuration of the net. Infact it is not able to connect to internet. Sometime from WSL I get a 192.x.x.x ip number,like :
192.168.69.65 ; 192.168.71.185 ; 192.168.73.223 ; 192.168.69.33 ; 192.168.100.101
sometime I get a 172.x.x.x ip address,like : 172.22.250.54 ; 172.22.253.128 ; 172.21.138.120 ; 172.22.88.142.
The vEthernet (WSL) adapter on Windows 10 is configued like this : 172.26.80.1 as IP address,subnet mask = 255.255.240.0
I have created a bridge in WIndows 10,between my Intel ethernet adapter and the tap0 / Tap-windows. It's IP is 192.168.1.6 ; subnet mask = 255.255.255.0 ; gateway = 192.169.1.1 ; dns primary = 8.8.8.8
I have configured WSL like it is explained,but it didn't work. Check below what happens :
root@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# brctl addbr br0root@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# ip addr flush dev eth0root@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# brctl addif br0 eth0root@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# tunctl -t tap0 -u rootSet 'tap0' persistent and owned by uid 0root@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# brctl addif br0 tap0root@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# ifconfig eth0 uproot@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# ifconfig tap0 uproot@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# ifconfig br0 uproot@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# brctl showbridge name bridge id STP enabled interfacesbr0 8000.00155d99cfa4 no eth0tap0root@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# dhclient -v br0Internet Systems Consortium DHCP Client 4.4.1Copyright 2004-2018 Internet Systems Consortium.All rights reserved.For info, please visit https://www.isc.org/software/dhcp/Listening on LPF/br0/00:15:5d:99:cf:a4Sending on LPF/br0/00:15:5d:99:cf:a4Sending on Socket/fallbackDHCPDISCOVER on br0 to 255.255.255.255 port 67 interval 3 (xid=0xbbd3b615)DHCPDISCOVER on br0 to 255.255.255.255 port 67 interval 8 (xid=0xbbd3b615)DHCPDISCOVER on br0 to 255.255.255.255 port 67 interval 12 (xid=0xbbd3b615)DHCPDISCOVER on br0 to 255.255.255.255 port 67 interval 11 (xid=0xbbd3b615)root@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# ifconfigbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet6 fe80::215:5dff:fe99:cfa4 prefixlen 64 scopeid 0x20ether 00:15:5d:99:cf:a4 txqueuelen 1000 (Ethernet)RX packets 172 bytes 43127 (43.1 KB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 16 bytes 2304 (2.3 KB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500ether 00:15:5d:99:cf:a4 txqueuelen 1000 (Ethernet)RX packets 543 bytes 121055 (121.0 KB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 28 bytes 3280 (3.2 KB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536inet 127.0.0.1 netmask 255.0.0.0inet6 ::1 prefixlen 128 scopeid 0x10loop txqueuelen 1000 (Local Loopback)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 0 bytes 0 (0.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0tap0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500ether 46:88:cb:85:5f:9e txqueuelen 1000 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 0 bytes 0 (0.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0root@DESKTOP-N9UN2H3:/mnt/c/Android/sdk/platform-tools# ping www.google.itping: www.google.it: Name or service not known
I think IPv4 issue can be solved with configuring DHCP, but I don't know how to do that. I dont know why after removing address from eth0, which had an ipv4 address, and creating a bridge,it becomes no ipv4.