vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Very slow network connection

Open julesbl opened this issue 13 years ago • 12 comments

Hi

Been using a vagrant 2 installation of ubuntu 12.04 on a Linuxmint host.

Getting very slow internet connection on all connections.

Vagrant file has this

Vagrant.configure("2") do |config|

This Vagrantfile is auto-generated by vagrant package to contain

the MAC address of the box. Custom configuration should be placed in

the actual Vagrantfile in this box.

config.vm.base_mac = "080027129698" config.vm.network :public_network config.vm.synced_folder "/home/julianb/MyDocuments/WebSites/JamesGrey/ContentCapsule/working", "/var/ContentCapsule" config.vm.network :forwarded_port, guest: 80, host: 8080 end

When I look at the config using virtualbox admin there are two adapters configured, a NAT with the ports forwarded and a bridge without any ports forwarded. which is, presumably why the problems are occurring.

Anybody got any ideas how to fix this?

Jules

julesbl avatar Jun 07 '13 14:06 julesbl

You could try to add:

config.vm.provider :virtualbox do |vb|
  vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end

thasmo avatar Jun 07 '13 20:06 thasmo

Hi Thomas
  Thanks for this, worked like a dream.
  Jules
On 07/06/13 21:51, Thomas Deinhamer
  wrote:

  config.vm.provider :virtualbox do |vb|

vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"] end

-- 

w34u - Websites Which Work For You www.w34u.com 07833 512221 Company: JB Development Ltd. Company No: 06604371

julesbl avatar Jun 08 '13 12:06 julesbl

Thanks, I'm glad you figured this out. Unfortunately, the heuristic for when to enable/disable this is really just... not strong. I don't know the cases when internet is slow. Sigh VirtualBox.

mitchellh avatar Jun 09 '13 19:06 mitchellh

config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"] end

worked like a charm, thank you!!!

nicam avatar Nov 28 '13 20:11 nicam

This isn't just a VirtualBox thing. I run into the exact same problem with the Parallels provider.

jdhiro avatar Jun 13 '14 04:06 jdhiro

This seems to work. Does anyone have an explanation of what is happening behind the scenes to cause the slow down? Just curious.

jrthib avatar Sep 11 '14 13:09 jrthib

I'd like to know as well? Thanks!

paulcalabro avatar Oct 05 '14 04:10 paulcalabro

This issue also exists on the vagrant-parallels provider. See https://github.com/Parallels/vagrant-parallels/issues/97

There might be a more general fix necessary...

tmaier avatar Dec 29 '14 17:12 tmaier

Test case: a wget of an url from a public cdn:

  1. Run on guest machine (debian jessie) = crawl at ~30kB/s
  2. Run on host machine = around 27MB/s.

I was able to fix it (for the most part) using this: http://superuser.com/a/850389/174755

Thinkscape avatar Oct 07 '15 16:10 Thinkscape

it works thanks

wweiradio avatar Jun 08 '16 00:06 wweiradio

I had success with the localhost:3000 responding-painfully-slow issue using Vagrant. On OS X I followed the instructions in previous posts, disabled IPv6, and changed my hostname from example.local to example.vm (or whatever you want) and then both VirtualBox and Fusion started responding in under 200ms down from 5000ms.

ianregister avatar Oct 18 '16 01:10 ianregister

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

ghost avatar Apr 03 '20 02:04 ghost