Vagrant 'remote connection disconnect' while booting - windows

Whenever I try to boot a Vagrant box on my Windows 7 x64 laptop in git bash using vagrant up, I get a long series of Warning: Remote connection disconnect. Retrying... messages. Occasionally this results in failure with a couple of different messages (either guest VM tools not being installed, or a timeout), but sometimes, after 10 or 15 messages, it will boot successfully and I can SSH into it.
A picture, to illustrate:
And the full output of the vagrant up command:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ianwalter/ubuntu-node-nginx' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 9966 => 9966 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
And so on. Is this usual behavior? Is there some way I can fix it? I'm running Vagrant 1.6.2 with VirtualBox 4.3.12.
EDIT: After BrianC's advice, I booted a GUI session to see what the VM was doing while the connection was refused. This is what it looks like:

I have solved this for now by changing base box from ianwalter/ubuntu-node-nginx to ubuntu/trusty64 and installing node/NPM manually from the package manager. It doesn't seem to give me the same trouble, so I surmise there is something in the other image that is causing the stall.

I also faced similar issue with vagrant but in my case I was not able to SSH even the vagrant was up.
I was using following configurations.
windows 10 64 bit
virtual box 5.0.20
HP ab032tx laptop
enabled virtualization in BIOS settings
Following were the vagrant file setting in my project folder.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "scotchbox"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
config.vm.boot_timeout = 1000
# Optional NFS. Make sure to remove other synced_folder line too
#config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }
end
Every time I run vagrant up command following error occurred.
default: Warning: Remote connection disconnect. Retrying..
Solution To fix this I run the following command (vagrant destroy)
vagrant destroy
default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
Once this command was run I again run vagrant up and everything started working.
Before this when ever I was running vagrang ssh I got following output.
vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile "C:/Users/muk_t/.vagrant.d/insecure_private_key"
IdentitiesOnly yes
LogLevel FATAL
Note : linux version used was 64 bit.

Related

vagrant ssh get error: ssh_exchange_identification: read: Connection reset by peer

I'm installing buildroot. But when I fllow the manual from buildroot doc, the error occurred.
This is my process.
curl -O https://buildroot.org/downloads/Vagrantfile; vagrant up
And the results are as fllows.
==> default: Attempting graceful shutdown of VM...
default: Guest communication could not be established! This is usually because
default: SSH is not running, the authentication information was changed,
default: or some other networking issue. Vagrant will force halt, if
default: capable.
==> default: Forcing shutdown of VM...
==> default: Checking if box 'ubuntu/bionic64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
Then I try to connect with ssh
vagrant ssh
But there is northing to show. Just like this.
lt#ubuntu:~/qemu/buildroot$ vagrant ssh
So I try ssh command.
lt#ubuntu:~/qemu/buildroot$ vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /home/lt/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
ssh vagrant#127.0.0.1 -p 2222 i /home/lt/.vagrant.d/insecure_private_key
However, also northing to show.
Could you give me a sultion? Thanks.
Try performing the following commands:
vagrant halt
vagrant up
vagrant ssh
This should fix the issue. If it still persists, check your bios settings to ensure that virtualization is enabled. If your on windows, make sure hyper-v is disabled.
Its a duplicate question and answered multiple times
You can refer my answer here https://stackoverflow.com/a/62928259/6150566
Enable Virtualization by going to BIOS if you are on Windows.
If you are running VirtualBox inside a nested VM, you can enable the Virtualization settings (VT-X) by powering off the VM.

I want to run a basic Windows guest on OSX with Vagrant, but I keep getting authentication failures

I'm trying to run a Windows 10 guest on an OSX host.
I've installed the latest versions of Vagrant, VirtualBox. I set up a very basic Vagrantfile as follows:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "Microsoft/EdgeOnWindows10"
config.vm.box_version = "1.0"
end
When I try to start Vagrant by executing "vagrant up", I get the following console output which ends with a neverending series of Authentication failure error messages.
TCR-C02X29QPJHC9:automation salimfadhley$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'Microsoft/EdgeOnWindows10'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'Microsoft/EdgeOnWindows10' version '1.0' is up to date...
==> default: Setting the name of the VM: automation_default_1548152471264_36082
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
I don't need Edge - I just need Windows and possibly some dot-Net runtimes. I'd like to get started by getting any Windows image up and running.
You probably just need to use the following in your Vagrantfile:
config.vm.communicator = "winrm"
This option is described here, and you can further configure winrm with the settings listed here.

Vagrant up fails with Warning: Remote connection disconnect. Retrying

Upgraded to vagrant version 2.1.1 and latest centos/7 (virtualbox, 1803.01) and $vagrant up now fails to build just after the new key is loaded. The Vagrant file being used has run fine on previous versions of vagrant (2.0.3).
Interestingly I am able to connect to the instance manually using vagrant, using the new key both using direct ssh and also with:
$vagrant ssh nat
Things already tried:
Extended timeout within vagrant config.vm.boot_timeout = 1200
Uninstalled both vagrant and virtualbox + manually removing plugins and removing both C:\Users\owner\.vagrand.d and C:\Users\owner\.VirtualBox directories before reinstall
Tried older version of nat.vm.box_version = "1704.01" which previous worked.
Why not roll back?
Initially I upgraded as I was having another issue which I will raise a separate thread about. Will link here once I have created it.
Versions
Host OS: Windows 7 Professional
Guest OS: centos/7 1803.01
Vagrant Version: 2.1.1
Vagrant Plugin list:
vagrant-hostmanager (1.8.8)
vagrant-hosts (2.8.1)
vagrant-proxyconf (1.5.2)
vagrant-reload (0.0.1)
vagrant-share (1.1.9)
vagrant-vbguest (0.15.1)
$ vagrant up
Bringing machine 'nat' up with 'virtualbox' provider...
Bringing machine 'fei' up with 'virtualbox' provider...
==> nat: Importing base box 'centos/7'...
==> nat: Matching MAC address for NAT networking...
==> nat: Checking if box 'centos/7' is up to date...
==> nat: Setting the name of the VM: brand_nat_1526342206425_95671
==> nat: Fixed port collision for 22 => 2222. Now on port 2200.
==> nat: Clearing any previously set network interfaces...
==> nat: Preparing network interfaces based on configuration...
nat: Adapter 1: nat
nat: Adapter 2: intnet
==> nat: Forwarding ports...
nat: 22 (guest) => 2200 (host) (adapter 1)
==> nat: Running 'pre-boot' VM customizations...
==> nat: Booting VM...
==> nat: Waiting for machine to boot. This may take a few minutes...
nat: SSH address: 127.0.0.1:2200
nat: SSH username: vagrant
nat: SSH auth method: private key
nat: Warning: Connection aborted. Retrying...
nat: Warning: Connection reset. Retrying...
nat: Warning: Remote connection disconnect. Retrying...
nat: Warning: Connection aborted. Retrying...
nat:
nat: Vagrant insecure key detected. Vagrant will automatically replace
nat: this with a newly generated keypair for better security.
nat:
nat: Inserting generated public key within guest...
nat: Removing insecure key from the guest if it's present...
nat: Key inserted! Disconnecting and reconnecting using new SSH key...
nat: Warning: Remote connection disconnect. Retrying...
nat: Warning: Remote connection disconnect. Retrying...
nat: Warning: Remote connection disconnect. Retrying...
nat: Warning: Remote connection disconnect. Retrying...
nat: Warning: Remote connection disconnect. Retrying...
nat: Warning: Remote connection disconnect. Retrying...
nat: Warning: Remote connection disconnect. Retrying...
nat: Warning: Remote connection disconnect. Retrying...
nat: Warning: Remote connection disconnect. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Also showing my slightly sanitized vagrant file. None of the scripts listed actually get run as the box fails before they are executed.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# abbreviated brand name
BRAND_NAME = "brand"
TOP_LEVEL_DOMAIN = ".some.dev"
BOX_NAME = "centos/7"
Vagrant.configure(2) do |config|
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
config.vm.boot_timeout = 1200
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://192.168.100.3:3128/"
config.proxy.https = "https://192.168.100.3:3128/"
config.proxy.no_proxy = "localhost,127.0.0.1,.some.lan"
end
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.memory = 2048
vb.cpus = 2
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
end
config.vm.define "nat" do |nat|
nat.vm.box = BOX_NAME
nat.vm.network "private_network", ip: "10.0.0.2", virtualbox__intnet: true
nat.vm.hostname = "nat.staging." + BRAND_NAME + TOP_LEVEL_DOMAIN
nat.vm.provision :hosts, :sync_hosts => true
nat.vm.provision "shell", path: "./scripts/aws_replication.sh"
nat.vm.provision "shell", path: "./scripts/nat_ssh.sh"
nat.vm.provision "shell", path: "./scripts/nat_staging.sh"
nat.vm.provision "shell", path: "./scripts/nat_git_clone.sh"
nat.vm.provision "shell", path: "./scripts/nat_set_ansible.sh"
end
config.vm.define "fei" do |fei|
fei.vm.box = BOX_NAME
fei.vm.network "private_network", ip: "10.0.0.4", virtualbox__intnet: true
fei.vm.network "forwarded_port", guest: 80, host: 80, auto_correct: true
fei.vm.network "forwarded_port", guest: 443, host: 443, auto_correct: true
fei.vm.network "forwarded_port", guest: 9000, host: 9000, auto_correct: true
fei.vm.provision :hosts, :sync_hosts => true
fei.vm.hostname = BRAND_NAME + ".staging" + TOP_LEVEL_DOMAIN
fei.vm.provision "shell", path: "./scripts/aws_replication.sh"
fei.vm.provision "shell", path: "./scripts/non-nat_key_staging.sh"
end
end
nat: Vagrant insecure key detected. Vagrant will automatically replace
nat: this with a newly generated keypair for better security.
Every time you are running "Vagrant up" command it tries to find insecure key and replace it.To use default key mentioned at path "config.ssh.private_key_path" include below entry in Vagrantfile.
Use config.ssh.insert_key = false in your Vagrantfile and then try.
I use OSX, I resolved this problem by restart my computer.

installing open edx on Ubuntu 14.04.1

i tried to install Open edX Fullstack on my Ubuntu 14.04.1 LTS
i followed the installation documentation
mkdir fullstack
cd fullstack
curl -L https://raw.githubusercontent.com/edx/configuration/master/vagrant/release/fullstack/Vagrantfile > Vagrantfile
vagrant plugin install vagrant-hostsupdater
vagrant up
but after that, when i opened virtualbox
and vagrant keep showing
default: Error: Connection timeout. Retrying...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
i added this code to Vagrantfile to show up the window fullstack virtual machine
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
and i entered manually to Ubuntu [hitting the Enter Key]
but, after a moment i get a black windows with a blinking cursor on it !
and still getting
default: Error: Connection timeout. Retrying...
in the terminal !
PS:
My computer doesn't support virtualization Technology
(i tried the same steps on Windows 8.1, but i get the same Error)
PC Info:
Processor: Pentium(R) Dual-Core CPU T4300 # 2.10GHz 2.10Ghz
RAM : 4 GB
This error
default: Error: Connection timeout. Retrying...
Cause of your internet connection.
You can't install Open Edx in Ubuntu 14.04 at this time, isn't supported yer but if you want to do research on it there's small discussion about installing open edx on Ubuntu 14.04 here https://groups.google.com/forum/#!topic/edx-code/d0gc1lhQ7-Q
Advice from me is please use Ubuntu 12.04 for best support.
Thanks,

vboxsf error when passing owner,group and mount options parameters

Vagrant Version 1.6.3
Virtual Box 4.3.12
VBoxGuestAdditions-4.3.2
Host OS -> Windows 8
Guest OS -> CentOS 6.5
Vagrant synced_folder works fine when this is the content of Vagrentfile
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder ".", "/var/www"
But I am unable to change the permissions of files or directories in synced_folder (/var/www).
https://github.com/mitchellh/vagrant/issues/897
To solve this problem I made following changes in Vagrentfile
https://serverfault.com/questions/398414/vagrant-set-default-share-permissions
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder ".", "/var/www",
:owner=> 'shiva',
:group=> 'shiva',
:mount_options=> ['dmode=>777', 'fmode=>666']
(where 'shiva' is the user which I created, I deleted the default user 'vagrant')
Now the problem is when I try to do vagrant up ,it shows this error
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: shiva
default: SSH auth method: password
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /var/www => C:/Users/Shiva/CentOSDevEnv_v1_1
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u shiva`,gid=`getent group shiva | cut -d: -
f3`,dmode=>777,fmode=>666 var_www /var/www
mount -t vboxsf -o uid=`id -u shiva`,gid=`id -g shiva`,dmode=>777,fmode=
>666 var_www /var/www
I already go through this link
https://github.com/mitchellh/vagrant/issues/3341
I don't know ruby syntax (Vagrantfile syntax).
I am really stuck here, please help.
The error was in my Vagrantfile syntax, my bad :(
This is the correct syntax
:mount_options=> ['dmode=777', 'fmode=666']
But it would be more helpful if vagrant can show the correct error information , something like
"Error in Vagrantfile syntax"
instead of
"This is usually because the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and can work properly."

Resources