Solucionado (ver solução)
Solucionado
(ver solução)
6
respostas

vagrant up não conclui o download da box

Olá, Alurenses... Estou a muito tempo tentando executar o comando vagrant up e acontece algo curioso, diria preguiçoso. Toda vez que rodo o comando acima parece que o dowload vai começar mas nunca começa. Não lança erro algum só simplesmente para, mas o cursor continua piscando. Acada tentativa, essa para em um ponto diferente.

saida

λ vagrant up 

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise32' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0

e simplesmente para

tem umas tentativas que chegou a iniciar o download da box masi parou.

outro exemplo - dessa vez parou montanto o download

λ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise32' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/precise32'
    default: URL: https://vagrantcloud.com/hashicorp/precise32
==> default: Adding box 'hashicorp/precise32' (v1.0.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/hashicorp/boxes/precise32/versions/1.0.0/providers/virtualbox.box
==> default: Box download is resuming from prior download progress
    default: Progress: 100% (Rate: 108/s, Estimated time remaining: --:--:--)

meu Vagrantfile

Vagrant.configure("2") do |config|
  # faz referencia ao ubunto linux
    config.vm.box = "hashicorp/precise32"
    # nome da maquina virtual é web
    config.vm.define :web do |web_config|

    end

end

estou usando windows 10, migrado do windows 7. Instalei ontem VirtualBox e Vagrant, portando estou com a última versão dos dois. O que fazer?

6 respostas

Oi Cleber, seu Windows não deveria ser o problema, não sei por que exatamente o Vagrant não está baixando o box da hashicorp do ubuntu precise 32bits, mas acho que ela já é bem velhinha, tipo, foi postada a 3 anos atrás.

Tenta mudar a box pra ver se funciona, coloca por exemplo a do Ubuntu Trusty, você não terá grandes diferenças no uso, mas se tiver, posta aqui que a gente dá uma olhada.

Muda a configuração da box:

config.vm.box = "ubuntu/trusty64"

E usa o comando vagrant up novamente.

Valeu a tentativa Wanderson, mas continua acontecendo a mesma coisa, tentei por 6 vezes.

λ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/trusty64'
    default: URL: https://vagrantcloud.com/ubuntu/trusty64
==> default: Adding box 'ubuntu/trusty64' (v20170918.0.1) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20170918.0.1/providers/virtualbox.box

Existe a possibilidade de eu fazer o download da box de outra forma para o vagrant up poder usá-lo?

Existe sim Cleber, você pode procurar a box aqui: https://app.vagrantup.com/boxes/search

Fazer o download e usar os comandos seguintes para utilizar a box baixada:

$ vagrant box add my-box /path/to/the/new.box
$ vagrant init my-box
$ vagrant up

Se eu não estou enganado, o comando vagrant box add também baixa a box

vagrant box add ubuntu/trusty64

O primeiro caso é mais manual, o segundo talvez vala a tentativa. Não sei se é o caso, mas eu acho que tentar depois reinstalar o Vagrant seja uma ideia a se avaliar.

solução!

Bom dia, Wanderson.

Cara eu tava usando o cmder. Tentei como adm tb e não foi. Agora tentei com o cmd puro do windows e o comando vagrant up rodou. Ihuuuu. Deve ter algum problema ao rodar esse comando no Cmder.

Consegui fazer o download, mas deu esse problema de connection

C:\Users\User\git\testeVagrant>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/trusty64'
    default: URL: https://vagrantcloud.com/ubuntu/trusty64
==> default: Adding box 'ubuntu/trusty64' (v20170918.0.1) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20170918.0.1/providers/virtualbox.box
==> default: Box download is resuming from prior download progress
    default: Progress: 100% (Rate: 406k/s, Estimated time remaining: --:--:--)
==> default: Successfully added box 'ubuntu/trusty64' (v20170918.0.1) for 'virtualbox'!
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: testeVagrant_default_1506434520660_84127
==> 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: 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 reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection aborted. Retrying...

As vezes o problema de connection acontece que porque a vm do box demorou a fazer o boot e ai dá essa travada, tenta para o processo com um ctrl+c (talvez funcione, se não abra o gerenciador de processos e mata o vagrant lá e a virtualbox também) e tenta fazer o vagrant up novamente.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software