简体   繁体   中英

vagrant not working on win 10

I recently migrated to win 10 from 7.my vagrant was working fine initially on win 7 but in the new win 10; its not working properly.

 default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. 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.

then when i vagrant ssh I get

ssh_exchange_identification: read: Connection reset by peer

any solution please

The problem is not Vagrant, it's Virtualbox which is not yet Windows 10 compliant.

You can get a test version here which fixes most of the bugs https://www.virtualbox.org/wiki/Testbuilds

There is an explanation here about how to overcome the issues with bridged networking https://forums.virtualbox.org/viewtopic.php?f=6&t=68444

This is my vagrantfile config

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  config.vm.box = "ubuntu/trusty64"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.network "forwarded_port", guest: 3306, host: 3306
  config.vm.network "forwarded_port", guest: 9000, host: 9000

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
    vb.memory = "3000"
    vb.cpus = "2"
  end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  config.vm.provision "shell", inline: <<-SHELL
    sudo apt-get update
    debconf-set-selections <<< 'mysql-server mysql-server/root_password password anysecurepassword'
    debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password anysecurepassword'
    debconf-set-selections <<< 'phpmyadmin phpmyadmin/dbconfig-install boolean false'
    debconf-set-selections <<< 'phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2'
    debconf-set-selections <<< 'phpmyadmin phpmyadmin/app-password-confirm password anysecurepassword'
    debconf-set-selections <<< 'phpmyadmin phpmyadmin/mysql/admin-pass password anysecurepassword'
    debconf-set-selections <<< 'phpmyadmin phpmyadmin/password-confirm password anysecurepassword'
    debconf-set-selections <<< 'phpmyadmin phpmyadmin/setup-password password anysecurepassword'
    debconf-set-selections <<< 'phpmyadmin phpmyadmin/database-type select mysql'
    debconf-set-selections <<< 'phpmyadmin phpmyadmin/mysql/app-pass password anysecurepassword'
    debconf-set-selections <<< 'dbconfig-common dbconfig-common/mysql/app-pass password anysecurepassword'
    debconf-set-selections <<< 'dbconfig-common dbconfig-common/mysql/app-pass anysecurepassword'
    debconf-set-selections <<< 'dbconfig-common dbconfig-common/password-confirm password anysecurepassword'
    debconf-set-selections <<< 'dbconfig-common dbconfig-common/app-password-confirm password anysecurepassword'
    debconf-set-selections <<< 'dbconfig-common dbconfig-common/app-password-confirm password anysecurepassword'
    debconf-set-selections <<< 'dbconfig-common dbconfig-common/password-confirm password anysecurepassword'
    sudo apt-get install -y apache2
    sudo apt-get install -y mysql-server
    sudo apt-get install -y openssh-server unattended-upgrades
    sudo apt-get install -y unzip zip aspell-en aspell-fr aspell-de aspell-es
    sudo apt-get install -y curl php5-curl php5-gd php5-xmlrpc php5-intl
    sudo apt-get install -y clamav-base clamav-freshclam clamav php5-mcrypt
    sudo apt-get install -y nodejs
    sudo apt-get install -y npm
    sudo php5enmod mcrypt
    #cd /var/www/html
    #sudo wget http://wordpress.org/latest.tar.gz
    #sudo tar -xvzf latest.tar.gz
    #mv wordpress/* .
    #rm -R wordpress
    apt-get -y install phpmyadmin
    sudo ln -s /usr/share/phpmyadmin /var/www/html
    chown -R www-data:www-data /var/www
    chmod -R 755 /var/www
    sudo a2enmod rewrite
    sudo service apache2 restart
    #curl -sS https://getcomposer.org/installer | php

  SHELL
end

MAKE SURE YOU TURN OFF HYPER-V

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM