Ubuntu wsl2 git getting "The remote end hung up unexpectedly" on large repos - windows

Getting this action for days in Ubuntu 19.04 in wsl2 on Windows.
$ git clone https://github.com/gohugoio/hugo.git
Cloning into 'hugo'...
error: RPC failed; curl 56 GnuTLS recv error (-12): A TLS fatal alert has been received.
fatal: The remote end hung up unexpectedly
I tried recompiling git to use openssl, didn't do anything.
I tried both ssh and https.
I tried to modify git settings for http.
I modified all kinds of git memory settings.
Nothing currently on Stack Overflow is correct for this issue.
I completely reinstalled Windows. Nope, still hosed.
Four days of Whiskey Tango Foxtrot... then I found it.

The latest Windows Hyper-V has issues with your wifi driver. You need to get the latest from https://downloadcenter.intel.com/download/28876/Windows-10-Wi-Fi-Drivers-for-Intel-Wireless-Adapters?v=t
Once the new drivers are installed, you can marvel at how git in wsl2 totally does what it is supposed to. I will never get those 5 days of my life back. I hope this will keep you from losing 5 days of yours.
Here is the issue: https://github.com/microsoft/WSL/issues/4253

Update Nov. 2020: the latest comments on WSL2 4253 point out to:
set MTU to 1350 (same as VPN interface):
sudo ifconfig eth0 mtu 1350
# or
ip link set dev eth0 mtu 1350
Check your MTU:
PS C:\> netsh interface ipv4 show subinterface
MTU MediaSenseState Bytes In Bytes Out Interface
------ --------------- --------- --------- -------------
4294967295 1 0 117945 Loopback Pseudo-Interface 1
1500 1 879583365 308029141 Wi-Fi
...
1500 1 3616963 2778319 vEthernet (WSL)
vs.
➜ ip addr | grep mtu
5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
A Windows 10 build 20231 might be needed to ensure issue 5821 "WSL vEthernet adapter shows up as disconnected" is fixed.
B. Agustín Amenábar Larraín explains:
Until this issue I never had heard of MTU, and it was hard for me to believe that was the cause, well it is.
I'm having isues when my Pulse Secure VPN is connected and I'm trying to connect to the internal self-hosted Gitlab.
SSH traffic to the regular internet is fine.
I'm using WSL2 Ubuntu 20.04, if I drop it to WSL1, all works as expected (Same for Debian).
Try upgrading your drivers first, that thidn't work for me.
First open a PowerShell prompt and type:
netsh interface ipv4 show subinterface
You will get an output like the following:
MTU MediaSenseState Bytes In Bytes Out Interface
------ --------------- --------- --------- -------------
4294967295 1 0 5974969 Loopback Pseudo-Interface 1
1500 1 2678641808 213293706 Wi-Fi
1500 5 0 0 Local Area Connection* 1
1500 5 0 0 Local Area Connection* 2
1500 1 0 529702 vEthernet (Default Switch)
1300 1 2106 509236 vEthernet (WSL)
1200 1 553027168 20290571 Local Area Connection* 13
1500 1 0 22759124 VirtualBox Host-Only Network #3
1500 5 0 0 Bluetooth Network Connection 4
The key is in the Local Area Connection 13 MTU* (The name and value can change from machine to machine), that is the VPN interface. In my case it's 1200 which is why
set MTU to 1350 (same as VPN interface):
sudo ifconfig eth0 mtu 1350
didn't work for me... and I didn't know how to get the VPN Interface MTU.
(I also hated to install ifconfig which is deprecated in favor of ip).
Now that we know, you can change the VPN MTU from Windows it in a PowerShell with Elevated Privileges,
netsh interface ipv4 set subinterface "Local Area Connection* 13" mtu=1400 store=persistent
If you want to skip the next step, you can set it to 1500, but you are leaving no room for the VPN to wrap the packets, for example I have had trouble with Github because of setting it to 1500.
Then, inside your WSL2 distro, you can check your current MTU values with:
❯ ip addr | grep mtu
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
5: sit0#NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
We care about eth0 (the virtual ethernet connection to Windows), you have to set a matching MTU to where you left it in the previous step.
sudo ip link set eth0 mtu 1400
Sadly both settings get resetted every time you start a new VPN session, or restart the WSL2, or even switch from WLAN to LAN.
Leonardo Oliveira adds:
Your solution to the problem was similar to mine, however I changed the Ethernet MTU inside on my WSL2 to the same numbering I saw in windows power shell (Ethernet WSL), and that way it worked for me.

Related

how to network to and from local VM (fusion) with fixed IP on mac os host

I am running a VM (Debian) on MacOs using VMware Fusion. The VM has fixed IP address (required) and the networking is bridged. It all works very well in my local network under 192.168.1.XXX ip range. The problem is when I leave home and connect to internet via 4G or some public wifi etc. In this situation my Host OS (Mac) obviously gets a different ip address and the VM (Debian) becomes inaccessible from the host mac os. I would really like to be able to keep the VM on the fixed 192.168.1.XXX address even outside of my home network. That is to be able to connect to the guest from the host and also to connect from the guest to the outside internet (as I am able to do when on the home network). Could you please advise on ways how to achieve that. Thank you.
EDIT1:
More googling gained this link .. I followed the steps and created adapter as per the screenshot attached. I am now able to ssh to the VM from the MacOs host (progress!), however the connectivity from the Debian VM to the internet still does not work. Ping 8.8.8.8 fails. My network setup on the Debian VM is:
/etc/network/interfaces:
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.177
netmask 255.255.255.0
gateway 192.168.1.1
/etc/resolv.conf:
nameserver 192.168.1.1
nameserver 8.8.4.4
EDIT2:
netstat -nr on the host:
Destination Gateway Flags Refs Use Netif Expire
default 172.20.10.1 UGSc 141 64 en0
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 5 420 lo0
169.254 link#10 UCS 0 0 en0 !
172.16.37/24 link#19 UC 2 0 vmnet1 !
172.16.37.255 ff:ff:ff:ff:ff:ff UHLWbI 0 9 vmnet1 !
172.20.10/28 link#10 UCS 1 0 en0 !
172.20.10.1/32 link#10 UCS 1 0 en0 !
172.20.10.1 XXXXXXXXXXXXXXXXX UHLWIir 56 440 en0 1192
172.20.10.6/32 link#10 UCS 0 0 en0 !
172.20.10.15 ff:ff:ff:ff:ff:ff UHLWbI 0 9 en0 !
192.168.1 link#20 UC 2 0 vmnet3 !
192.168.1.177 0:50:56:35:35:b UHLWIi 2 756 vmnet3 1180
192.168.1.255 ff:ff:ff:ff:ff:ff UHLWbI 0 9 vmnet3 !
192.168.114 link#21 UC 2 0 vmnet8 !
192.168.114.255 ff:ff:ff:ff:ff:ff UHLWbI 0 9 vmnet8 !
224.0.0/4 link#10 UmCS 2 0 en0 !
224.0.0.251 1:0:5e:0:0:fb UHmLWI 0 0 en0
239.255.255.250 1:0:5e:7f:ff:fa UHmLWI 0 54 en0
255.255.255.255/32 link#10 UCS 1 0 en0 !
255.255.255.255 ff:ff:ff:ff:ff:ff UHLWbI 0 128 en0 !
According to the VMware docs here, the ping from the guest to the outside should "just work" in this setup, but it does not.
Try using a host-only or NAT network setup instead of bridged. A bridged adaptor will always give your VM an IP address from whatever wireless/ethernet network your host machine resides in at a given time. Using a host-only or NAT setup should allow you to create a private network between your host and VM in which you can get a static IP for your VM. The link I posted is for VMware Workstation, but the network options should be relevant to Fusion as well.
Talking to VMware support gained a solution that is acceptable. They recommended setup with 2 adapters. This way both ssh into (via one adapter that keeps the same fixed internal IP address) and connections to the internet (second adapter with dhcp) work fine.

macOS en5 network can't be turned off

I have MacBook Pro 2017, and currently am using High Sierra. I have specific requirement by some software to disable all networks. But this en5 network can't be disabled.
I have removed everything from Networks in network preferences. When I try to disable it through terminal sudo ifconfig en5 down I get ifconfig: down: permission denied.
Few days ago I ran across some article saying I need to change some permits to my sudo user but I can't find that article now :(.
Here are some more info on en5 from terminal
defaults read /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist | grep en5
"BSD Name" = en5;
IOPathMatch = "IOService:/AppleACPIPlatformExpert/PCI0#0/AppleACPIPCI/XHC1#14/XHC1#14000000/HS03#14100000/iBridge#14100000/NCM Data#5/AppleUSBNCMData/en5";
en5: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether ac:de:48:00:11:22
inet6 fe80::aede:48ff:fe00:1122%en5 prefixlen 64 scopeid 0x7
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
Any Idea how to disable this en5 network?
You cannot disable en5 in your mac probably because you have the touchbar version. en5 is reserved for iBridge interface (used by the touchbar) therefore it's protected and you won't be able to disable it.

Why docker allow me to run container on 192.168.8.101:8082 and localhost but not on other IPs

Hello I have following dockerfile on my macOS Sierr High (as example):
FROM richarvey/nginx-php-fpm:1.3.7
EXPOSE 80
And I'm able to build and run it on 192.168.8.101:8082 by
docker build -t myproject
docker run -d -p 192.168.8.101:8082:80 --name myproject myproject
and it works on http://192.168.8.101:8082 my local computer and devices (iPhone) connected to the same wifi network (I also have no problem to run container on localhost).
However when I try tu run this container on other IP like for example 192.168.8.102:8082 I get following error:
Mac-mini-Kamil:myproject Kamil$ docker run -d -p 192.168.8.102:8082:80 --name myproject myproject
f939d38243f420f812c859f5fe275faf49dc6e123d807583ec240fbdf0619a17
docker: Error response from daemon: driver failed programming external connectivity on endpoint myproject (0b546e63887e3ddeb4d2b21a8d6d15a94e33f1ff67c2765174a808bf6b13e120): Error starting userland proxy: listen tcp 192.168.8.102:8082: bind: cannot assign requested address.
I try also other addresses like 172.17.1.2 but with no success and I don't have idea why. Do someone cane give me advice (and/or instruction about what more information I should provide to this question to solve it) ? I would like to know: why I cannot use other IPs and what I can do to use other IPs?
UPDATE - additional informations:
After execute ifconfig I selected two interesting results :
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether a8:8e:24:a3:d3:91
inet6 fe80::18fe:1146:6389:b630%en1 prefixlen 64 secured scopeid 0xa
inet 192.168.8.101 netmask 0xffffff00 broadcast 192.168.8.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 32:00:11:fc:70:40
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 9 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: <unknown type>
status: inactive
The output of ifconfig (linux, OSX) or ipconfig (Windows) will probably tell you that your IP4 is 192.168.8.101.
That's reason why 192.168.8.101:8082:80 works. Docker can access the endpoint and can map port 80 of its container on port 8082 of 192.169.8.101.
When you use another IP this error will pop up:
Error response from daemon: driver failed programming external connectivity on endpoint
This means your Docker daemon can not access the endpoint 192.168.8.102 which is logical because it isn't the IPV4 address of your machine.
The bridge0 network is the default Docker network. If you don't specify a network your Docker container will be deployed inside this network.
You can do: docker inspect network bridge
The output of this command will return a subnet like "Subnet": "172.17.0.0/16". Every container will have an IP between this private range.
What you are actually doing is mapping 172.17.X.X:80 on 192.168.8.101:8082 which works when 192.168.8.101 is accessible from you machine.
i suspect that your previous container still using port 8082 try using another port. . i dont know how to check used port in mac but if its in linux you can check your open port with netstat -ntlp

Oracle on mac using VirtualBox with Windows 10 not working [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I've been researching everywhere and couldn't solve the problem. I'm receiving the error:
"Status: Failure-Test failed: IO Error: Got minus one from a read call." when trying to connect to the Oracle server running on the VirtualBox in my Macbook.
What I did so far:
Installed Windows 10 x64 with default configuration on VirtualBox
Installed Oracle 11 XE 112 Win 64 on the Windows installed in the step #1
Installed SQL Developer 4.0.2.15 on my Macbook (OS X El Captain)
On VirtualBox, went to Network (Attached to NAT) and added port forwarding with:
host IP: 127.0.0.1
host port: 1521
guest ip: tried empty and after tried using my mac ip (192.168.2.68)
guest port: 1521
I also tried adding a Bridged second adapter. No luck.
Tested the Oracle local connection on Windows with the sql command line utility ("connect hr/hr") and could connect successfully.
Tested the Oracle listener on Windows using the lsnrctl utility ("status") and could see the "xe" listener active.
On my Mac, tried to connect using SQL Developer with every possible combination that I could imagine:
username/password: hr/hr
hostname: 127.0.0.1 / localhost / 10.0.2.15 (that's the virtual Windows ip)
service name: xe / xexdb / orcl
tried the same for SID.
Every time that I click in test, I receive the error mentioned before.
Disabled the firewall on the virtual Windows
Please, I researched everywhere here, google, oracle community, VirtualBox community and nothing. Thank you so much in advance.
ifconfig on my mac:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.94.0.2 netmask 0xff000000
inet 127.94.0.1 netmask 0xff000000
nd6 options=1<PERFORMNUD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 54:26:96:e0:e7:57
inet6 fe80::5626:96ff:fee0:e757%en0 prefixlen 64 scopeid 0x4
inet 192.168.2.68 netmask 0xffffff00 broadcast 192.168.2.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 32:00:1b:a0:70:e0
media: autoselect <full-duplex>
status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 32:00:1b:a0:70:e1
media: autoselect <full-duplex>
status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether 06:26:96:e0:e7:57
media: autoselect
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether 6a:0e:9b:1d:78:7b
inet6 fe80::680e:9bff:fe1d:787b%awdl0 prefixlen 64 scopeid 0x8
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 56:26:96:0e:29:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 5 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
nd6 options=1<PERFORMNUD>
media: <unknown type>
status: inactive
vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00
inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255
ipconfig on the virtual Windows box:
Your VirtualBox port forwarding configuration is incorrect, guest IP should be 10.0.2.15, not your host IP address. After that, you should be able to connect through 127.0.0.1:1521 on your host OS.
I couldn't find a solution installing Windows 10, but it worked super fine following the instructions of this post

OSX Tomcat access via VirtualBox Windows 7

I'm trying to access my Tomcat instance on OSX with Windows 7 via VirtualBox.
My network settings on VirtualBox:
Adapater 1: Bridged Adapter
Name: en1: Wi-Fi (Airport)
Adapter 2: Host-only Adapter
Name: vboxnet0
my ifconfig -a from OSX:
vboxnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00
inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255
I can ping my OSX box from Windows 7, but when I try to visit http://192.168.56.1:8080 I simply get an error that looks like I'm not connected.
Any ideas? Am I missing something in my OSX settings?
edit:
netstat -lan |grep 8080:
tcp46 0 0 *.8080 *.* LISTEN
Problem solved.
Adapter 1: NAT
Adapter 2: Disabled

Resources