Unfortunately I can't share my vagrant file but I have experienced massive slow down in the latest version of Vagrant ( 2.2.1 ). The slow down happens both when the box is being brought up. ( when the shell scripts run and when logging into the box box and typing commands. When typing commands I would typically see 1 to 2 sec delays before the command appears on the prompt.
OS: Ubuntu 18.04 ( fully up to date )
Kernel: 4.15.0-39
box: puppetlabs/centos-7.2.-64-puppet
Provider: Virtualbox
Virtualbox: 5.2.20
I had a later version of Virtualbox but the behaviour was the same. I downgraded Virtualbox because I thought it might be related to the slowness, since I recently updated it.
When I uninstalled vagrant 2.2.1 and re-installed 2.2.0 the slowness is gone and the box gets provisioned quickly and logging into box using vagrant ssh
I'm seeing the same issues with Vagrant 2.2.1.
OS: Ubuntu 18.04 (fully updated)
Kernel: 4.15.0-39
Box: geerlingguy/centos6
Provider: Virtualbox (5.2.22)
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/centos6"
config.ssh.insert_key = false
config.ssh.forward_agent = true
config.vm.provider :virtualbox do |v|
v.name = "lemp"
v.memory = 4096
v.cpus = 2
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--ioapic", "on"]
end
config.vm.hostname = "lemp"
config.vm.network :private_network, ip: "10.200.200.200"
# Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134
config.vm.define :lemp do |lemp|
end
timezone = 'America/Detroit'
config.vm.provision :shell, :inline => "sudo rm /etc/localtime && sudo ln -s /usr/share/zoneinfo/" + timezone + " /etc/localtime && sudo mkdir -p /dev/shm/ledms && sudo setfacl -dR -m u:www-data:rwx -m u:vagrant:rwx /dev/shm/ledms && sudo setfacl -R -m u:www-data:rwX -m u:vagrant:rwx /dev/shm/ledms && sudo /etc/init.d/mysqld restart", run: "always"
# Ansible provisioner.
config.vm.provision "ansible" do |ansible|
ansible.playbook = "provisioning/playbook.yml"
ansible.become = true
end
config.vm.synced_folder "shared", "/var/www", type: "nfs",
mount_options: ['rw', 'vers=3', 'tcp', 'fsc', 'actimeo=2'],
linux__nfs_options: ['rw','no_subtree_check','all_squash','async']
config.vm.synced_folder ".", "/vagrant", type: "nfs",
mount_options: ['rw', 'vers=4', 'tcp', 'fsc', 'actimeo=2'],
linux__nfs_options: ['rw','no_subtree_check','all_squash','async']
end
Would you provide a gist of the vagrant up that includes debug output with timestamps. If it is possible to provide a gist with previous version displaying no slow down, and current version exhibiting the slow behavior, that would be fantastic. Command to run for timestampped debug output:
vagrant up --debug --timestamp
Thanks!
Having the same issue, here is my debug output: https://gist.github.com/brendenyule/fef244b6ba63bb65227c629a7b1020e6
@brendenyule that time for starting and configuring a guest is expected.
@ggeldenhuis I'm going to close this up now but if you still are experiencing this behavior, please feel free to open a new issue and include the --timestamp flag when generating debug output from the gist.
Cheers!
@chrisroberts, Then there is a larger issue. I am having the same issue that the two people above me are having. Bringing the box up doesn't take any extra time, but I can run nearly nothing because it takes so long. Has been running great for 3+ years until this latest update.
@chrisroberts The problem is not vagrant up or provisioning. It's actually having stuff run within the box that is extremely slow.
For example, I have a Symfony application that I have running. In 2.2.0 a page may load in 800ms but in 2.2.1 it may take 8000ms (or longer) to load the same page. AJAX requests are painfully slow as well.
A little later today, I will do a little debugging. I'll clear all of my caches (redis, symfony), reboot the machine, and look at the Symfony profiler and Chrome network stuff and take some screenshots. Then I will clear all of the caches, upgrade to 2.2.1, and look the same stuff and take similar screenshots and report back.
My issue is exactly the same, I run some simple bash scripts after the box has been brought up and they all run extremely slow. Also once logged into the box using vagrant ssh, there is a significant lag on the command line. The slowness and lag is not present when I go to a previous version of vagrant. @chrisroberts I am definitely still experiencing the issue. It is not related to a slow proxy, slow PC or slow internet but is related to the version of vagrant.
@chrisroberts I have updated my vagrant to 2.2.2 which appears to have resolved the slowness issue. My vagrant box is now responsive and the yum update is working fast.
I'm still having issues with ubuntu 18.04 and vagrant 2.2.2
If you halt the vm, and bring it up with the VirtualBox GUI, do you still get slow down when you run scripts or other various applications like you mentioned before?
Vagrant 2.2.2 has resolved the slowness on my end on Ubuntu 18.04 w/ VirtualBox 5.2.22
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
end
Yet to try this one:
config.vm.synced_folder ".", "/vagrant", :nfs => { :mount_options => ["dmode=777","fmode=777"] }
reference at stackoeverflow
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.
Most helpful comment
My issue is exactly the same, I run some simple bash scripts after the box has been brought up and they all run extremely slow. Also once logged into the box using vagrant ssh, there is a significant lag on the command line. The slowness and lag is not present when I go to a previous version of vagrant. @chrisroberts I am definitely still experiencing the issue. It is not related to a slow proxy, slow PC or slow internet but is related to the version of vagrant.