Skip to content

Instantly share code, notes, and snippets.

@dcarley
Created February 1, 2012 10:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcarley/1716454 to your computer and use it in GitHub Desktop.
Save dcarley/1716454 to your computer and use it in GitHub Desktop.
VirtualBox NAT interface stops responding under load

VirtualBox NAT bug

Pushing a certain quantity/mixture of data through a VB guest's NAT interface causes all TCP/UDP connections to fail for a period of time thereafter.

The only way I've been able to reliably reproduce this is to use pip(1) to download a large list of Python packages. After a number of packages have been downloaded (14~20) pip will exit with an HTTP or DNS timeout. Inbound port-forwarded SSH connections will drop with:

Connection to 127.0.0.1 closed by remote host.

This appears most likely to occur with the Intel PRO/1000 MT Desktop (82540EM) NIC. It is harder to reproduce with PCnet-FAST III (Am79C973) NICs. It is not reproducible with host-only or bridged adapters.

Tested against VirtualBox version:

dan@dan-MacPro:~$ VBoxManage -v
4.1.8r75467
[vagrant@cent6 ~]$ set -o pipefail; while true; do curl -sI --connect-timeout 1 --max-time 1 http://10.0.2.2/~dan/ | grep Date; [ $? == 0 ] || echo fail; sleep 1; done
Date: Wed, 01 Feb 2012 12:57:43 GMT
Date: Wed, 01 Feb 2012 12:57:44 GMT
Date: Wed, 01 Feb 2012 12:57:45 GMT
Date: Wed, 01 Feb 2012 12:57:46 GMT
Date: Wed, 01 Feb 2012 12:57:47 GMT
Date: Wed, 01 Feb 2012 12:57:48 GMT
Date: Wed, 01 Feb 2012 12:57:49 GMT
Date: Wed, 01 Feb 2012 12:57:50 GMT
Date: Wed, 01 Feb 2012 12:57:51 GMT
Date: Wed, 01 Feb 2012 12:57:52 GMT
Date: Wed, 01 Feb 2012 12:57:53 GMT
Date: Wed, 01 Feb 2012 12:57:54 GMT
Date: Wed, 01 Feb 2012 12:57:55 GMT
Date: Wed, 01 Feb 2012 12:57:56 GMT
Date: Wed, 01 Feb 2012 12:57:57 GMT
Date: Wed, 01 Feb 2012 12:57:58 GMT
Date: Wed, 01 Feb 2012 12:57:59 GMT
Date: Wed, 01 Feb 2012 12:58:00 GMT
Date: Wed, 01 Feb 2012 12:58:01 GMT
Date: Wed, 01 Feb 2012 12:58:02 GMT
Date: Wed, 01 Feb 2012 12:58:03 GMT
Date: Wed, 01 Feb 2012 12:58:04 GMT
Date: Wed, 01 Feb 2012 12:58:05 GMT
Date: Wed, 01 Feb 2012 12:58:06 GMT
Date: Wed, 01 Feb 2012 12:58:07 GMT
Date: Wed, 01 Feb 2012 12:58:08 GMT
Date: Wed, 01 Feb 2012 12:58:09 GMT
Date: Wed, 01 Feb 2012 12:58:10 GMT
Date: Wed, 01 Feb 2012 12:58:12 GMT
Date: Wed, 01 Feb 2012 12:58:13 GMT
Date: Wed, 01 Feb 2012 12:58:14 GMT
Date: Wed, 01 Feb 2012 12:58:15 GMT
Date: Wed, 01 Feb 2012 12:58:16 GMT
Date: Wed, 01 Feb 2012 12:58:17 GMT
Date: Wed, 01 Feb 2012 12:58:18 GMT
Date: Wed, 01 Feb 2012 12:58:19 GMT
Date: Wed, 01 Feb 2012 12:58:20 GMT
Date: Wed, 01 Feb 2012 12:58:21 GMT
Date: Wed, 01 Feb 2012 12:58:22 GMT
Date: Wed, 01 Feb 2012 12:58:23 GMT
Date: Wed, 01 Feb 2012 12:58:24 GMT
Date: Wed, 01 Feb 2012 12:58:25 GMT
Date: Wed, 01 Feb 2012 12:58:26 GMT
Date: Wed, 01 Feb 2012 12:58:27 GMT
Date: Wed, 01 Feb 2012 12:58:28 GMT
Date: Wed, 01 Feb 2012 12:58:29 GMT
Date: Wed, 01 Feb 2012 12:58:30 GMT
Date: Wed, 01 Feb 2012 12:58:31 GMT
Date: Wed, 01 Feb 2012 12:58:32 GMT
Date: Wed, 01 Feb 2012 12:58:33 GMT
Date: Wed, 01 Feb 2012 12:58:34 GMT
Date: Wed, 01 Feb 2012 12:58:35 GMT
Date: Wed, 01 Feb 2012 12:58:36 GMT
Date: Wed, 01 Feb 2012 12:58:37 GMT
Date: Wed, 01 Feb 2012 12:58:38 GMT
Date: Wed, 01 Feb 2012 12:58:39 GMT
Date: Wed, 01 Feb 2012 12:58:40 GMT
Date: Wed, 01 Feb 2012 12:58:41 GMT
Date: Wed, 01 Feb 2012 12:58:42 GMT
Date: Wed, 01 Feb 2012 12:58:43 GMT
Date: Wed, 01 Feb 2012 12:58:44 GMT
Date: Wed, 01 Feb 2012 12:58:45 GMT
Date: Wed, 01 Feb 2012 12:58:46 GMT
Date: Wed, 01 Feb 2012 12:58:47 GMT
Date: Wed, 01 Feb 2012 12:58:48 GMT
Date: Wed, 01 Feb 2012 12:58:49 GMT
Date: Wed, 01 Feb 2012 12:58:50 GMT
Date: Wed, 01 Feb 2012 12:58:51 GMT
Date: Wed, 01 Feb 2012 12:58:52 GMT
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
fail
Date: Wed, 01 Feb 2012 13:01:46 GMT
Date: Wed, 01 Feb 2012 13:01:47 GMT
Date: Wed, 01 Feb 2012 13:01:48 GMT
Date: Wed, 01 Feb 2012 13:01:49 GMT
Date: Wed, 01 Feb 2012 13:01:50 GMT
Date: Wed, 01 Feb 2012 13:01:51 GMT
Date: Wed, 01 Feb 2012 13:01:52 GMT
Date: Wed, 01 Feb 2012 13:01:54 GMT
Date: Wed, 01 Feb 2012 13:01:55 GMT
Date: Wed, 01 Feb 2012 13:01:56 GMT
Date: Wed, 01 Feb 2012 13:01:57 GMT
Date: Wed, 01 Feb 2012 13:01:58 GMT
Date: Wed, 01 Feb 2012 13:01:59 GMT
Date: Wed, 01 Feb 2012 13:02:00 GMT
Date: Wed, 01 Feb 2012 13:02:01 GMT
Date: Wed, 01 Feb 2012 13:02:02 GMT
Date: Wed, 01 Feb 2012 13:02:03 GMT
^C
[vagrant@cent6 ~]$
[vagrant@cent6 ~]$ time python-pip install -v -d down -r requirements.txt; date
...
Using version 1.2.1 (newest of versions: 1.2.1, 1.2.1)
Downloading Django-1.2.1.tar.gz (6.2Mb): 6.2Mb downloaded
Saved ./down/Django-1.2.1.tar.gz
Downloading/unpacking django-extensions==0.6 (from -r req.txt (line 6))
Could not fetch URL http://pypi.python.org/simple/django-extensions: <urlopen error [Errno -2] Name or service not known>
Will skip URL http://pypi.python.org/simple/django-extensions when looking for download links for django-extensions==0.6 (from -r req.txt (line 6))
Real name of requirement django-extensions is django-extensions
Could not fetch URL http://pypi.python.org/simple/django-extensions/0.6: <urlopen error [Errno -2] Name or service not known>
Will skip URL http://pypi.python.org/simple/django-extensions/0.6 when looking for download links for django-extensions==0.6 (from -r req.txt (line 6))
Could not fetch URL http://pypi.python.org/simple/django-extensions/: <urlopen error [Errno -2] Name or service not known>
Will skip URL http://pypi.python.org/simple/django-extensions/ when looking for
download links for django-extensions==0.6 (from -r req.txt (line 6))
Could not fetch URL http://dist.pinaxproject.com/dev/django-extensions/: <urlopen error [Errno -2] Name or service not known>
Will skip URL http://dist.pinaxproject.com/dev/django-extensions/ when looking for download links for django-extensions==0.6 (from -r req.txt (line 6))
Could not find any downloads that satisfy the requirement django-extensions==0.6 (from -r req.txt (line 6))
No distributions at all found for django-extensions==0.6 (from -r req.txt (line 6))
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/pip/basecommand.py", line 124, in main
self.run(options, args)
File "/usr/lib/python2.6/site-packages/pip/commands/install.py", line 178, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.6/site-packages/pip/req.py", line 896, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.6/site-packages/pip/index.py", line 141, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for django-extensions==0.6 (from -r req.txt (line 6))
Storing complete log in /home/vagrant/.pip/pip.log
real 1m52.367s
user 0m4.801s
sys 0m1.907s
Wed Feb 1 12:59:36 GMT 2012
[vagrant@cent6 ~]$
unittest-xml-reporting==1.0.3
httplib2==0.7.1
BeautifulSoup==3.2.0
raven==1.1.1
amqplib==0.6.1
django-extensions==0.6
south==0.7.3
GChartWrapper==0.9
celery==2.2.6
django-celery==2.2.4
django-rosetta==0.6.0
webassets==0.5
cssmin==0.1.4
python-memcached==1.47
--extra-index-url=http://dist.pinaxproject.com/dev/
Django==1.2.1
Pinax==0.9a1
django-debug-toolbar==0.8.3
django-staticfiles==0.2.0
django-mailer==0.2a1.dev1
django-email-confirmation==0.2.dev2
django-timezones==0.2.dev1
django-ajax-validation==0.1.3
pytz==2010h
django-openid==0.2.3.dev1
python-openid==2.2.5
django-uni-form==0.7.0
django-announcements==0.1.2
django-pagination==1.0.7
django-notification==0.1.4
python-dateutil==1.4.1
docutils==0.6
gdata==1.3.3
Pygments==1.3.1
python-twitter==0.5
simplejson==2.0.9
textile==2.1.4
vobject==0.8.1c
ybrowserauth==1.2
Markdown==2.0.3
diff-match-patch==20090804
geopy==0.94
creole==1.1
django-atomformat==0.1.1.dev1
django-avatar==1.0.4
django-bookmarks==0.1.0
django-flag==0.2.dev9
django-friends==0.1.5
django-locations==0.1.1
django-messages==0.4.2
django-microblogging==0.2.dev1
django-oembed==0.1.1
django-swaps==0.5.3
django-sorting>=0.1
django-tagging==0.3.1
django-threadedcomments==0.5.2
django-voting==0.1
django-wakawaka==0.4.dev5
django-photologue==2.3
django-attachments==0.3.1
django-markup==0.4
django-groups==0.1.dev10
django-tagging-ext==0.2.0
@cowholio4
Copy link

Did you ever find a solution to this?

@dcarley
Copy link
Author

dcarley commented Aug 4, 2012

There are some workarounds. More info here: hashicorp/vagrant#516

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment