When Ubuntu16.04.1 is in the virtualbox with NAT adapter, the network will have errors about "Connection reset by peer"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
network-manager (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
By means of vagrant for using the ubuntu/xenial64 box, or under the virtualbox 5.1.6/5.1.8, installing ubuntu-
In this case, some commands are executed with a "Connection reset by peer" error, such as apt-key or docker pull.
==== The current test results ====
If the network is not NAT but NAT Network or Host Only, it will not go wrong.
If the virtual machine is not virtualbox, it will not go wrong.
Keeping other unchanged and just replacing centos with Ubuntu, it will not go wrong.
Under different wifi environment, the test results remain unchanged.
Upgrade all ubuntu to the latest version by using sudo apt upgrade, the test results are unchanged.
Maybe the combination of virtualbox + NAT + ubuntu1604 is the reason and this error is very convert. Other network functions are available, may have errors only in a specific command.
==== Repeating Steps ====
1. Run "vagrant init ubuntu/xenial64" in an empty directory
2. vagrant up
3. vagrant ssh
4. Run "sudo apt-key adv --keyserver hkp://ha.
The output is as follows :
Executing: /tmp/tmp.
hkp://ha.
--recv-keys
58118E89F3A9128
gpg: requesting key 2C52609D from hkp server ha.pool.
?: [fd 4]: read error: Connection reset by peer
gpgkeys: key 58118E89F3A9128
gpg: no valid OpenPGP data found.
gpg: key 2C52609D: no valid user IDs
gpg: this may be caused by a missing self-signature
gpg: Total number processed: 1
gpg: w/o user IDs: 1
There is an error message during this "? : [fd 4]: read error: Connection reset by peer"
==== Another error scene ====
I created a docker registry (called S) on the virtual machine of IDC, and when I ran "docker pull xxx" from another ubuntu Guest OS (called C) (virtualbox + NAT), you can see something from /var/log/syslog in C as follows:
Nov 3 12:59:00 ubuntu-xenial dockerd[2167]: time="2016-
Nov 3 12:59:00 ubuntu-xenial dockerd[2167]: time="2016-
The 10.99.169.227 is the ip of S.
S is also Ubuntu 16.04.1 LTS, but which is not running under the virtualbox. Run the above repeating steps 4 in S will not appear "Connection reset by peer" error.
==== Script which can be executed on other system ====
Attachment is a test script, which is copied from output /tmp/tmp.LO7eukZqdi directory of the above repeating step 4. You can perform a test on any system by following these steps:
1. tar -xf gpgtest.tar
2. cd gpgtest
3. ./gpg.1.sh --keyserver hkp://ha.
In the environment of virtualbox + NAT + ubuntu, output will be like this:
gpg: WARNING: unsafe permissions on homedir `.'
gpg: requesting key 2C52609D from hkp server ha.pool.
?: [fd 4]: read error: Connection reset by peer
gpgkeys: key 58118E89F3A9128
gpg: no valid OpenPGP data found.
gpg: key 2C52609D: no valid user IDs
gpg: this may be caused by a missing self-signature
gpg: Total number processed: 1
gpg: w/o user IDs: 1
You can see the output of "?: [Fd 4]: read error: Connection reset by peer".
Under the vagrant + virtualbox + centos/7 box + NAT, the script output is like this:
gpg: 警告:用户目录‘.’权限不安全
gpg: 下载密钥‘2C52609D’,从 hkp 服务器 ha.pool.
gpg: 密钥 2C52609D:“Docker Release Tool (releasedocker) <email address hidden>”未改变
gpg: 合计被处理的数量:1
gpg: 未改变:1
==== My test environment ====
Macbook pro 15, macOS 10.12.1 (16B2555), XPS15 (win10), MiBook13 (win10)
Vagrant 1.8.6
VirtualBox 5.1.6, 5.1.8
vagrant box ubuntu/xenial64 20161102.0.0, 20161104.0.0
vagrant box centos/7 1609.01
ubuntu-
ubuntu-
Status changed to 'Confirmed' because the bug affects multiple users.