Use Vagrant box add to use the box_url

31 views
Skip to first unread message

SurferL

unread,
Apr 6, 2018, 6:36:56 AM4/6/18
to Vagrant
Consider this vagrant file:

config.vm.define "mac" do |subconfig|

    subconfig.vm.box = "mac.box"
    subconfig.vm.box_url = "redacted-url-to.box"
    subconfig.vm.boot_timeout = 1200
    subconfig.vm.graceful_halt_timeout = 1200

    subconfig.ssh.username = "vagrant"
    subconfig.ssh.password = "vagrant"

    subconfig.vm.provider "parallels" do |prl|
      prl.name = "mac-dev"
      prl.update_guest_tools = true
    end
  end

Due to a bug I'm unable to do `vagrant up mac`, which on first run would download the box file for me and then stand it up. To workaround said bug, I need to do `vagrant box add...` first.

Is it possible to do `vagrant box add vm.box.url` or something along those lines? where the command would read into the Vagrantfile and get the url for the config I want?

Thanks! 

Alvaro Miranda Aguilera

unread,
Apr 6, 2018, 6:50:25 AM4/6/18
to vagra...@googlegroups.com
Hello

Should be working, seems the problem is the box is called mac.box


   subconfig.vm.box = "mac.box"
    subconfig.vm.box_url = "redacted-url-to.box"


Can you try to match the name of the box? ie mac


you can add the box like

vagrant box add --name mac --provider <provider_here> <url_to_box_here>

Alvaro.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/af2931cd-b7ba-4c85-9d4b-dd6acc53323f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

SurferL

unread,
Apr 6, 2018, 7:00:08 AM4/6/18
to Vagrant
Hi,

Putting in the URL directly does work, however I was wondering if there was another way to do that?

In an ideal scenario I would just use `vagrant up mac` and I would like to do `vagrant box add mac` without having to manually putting in the URL if that makes sense?
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Apr 6, 2018, 7:17:10 AM4/6/18
to vagra...@googlegroups.com
can you update the name of the box to mac

then should work in the way you want.

I think the problem is on the original vagrantfile your box is called mac.box



To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c4c457af-0a9f-42ef-b00b-b0deddef1cec%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

SurferL

unread,
Apr 6, 2018, 8:28:24 AM4/6/18
to Vagrant
I've updated the config to:

config.vm.define "mac" do |subconfig|

    subconfig.vm.box = "mac"
    subconfig.vm.box_url = "redacted-url-to.box"
    subconfig.vm.boot_timeout = 1200
    subconfig.vm.graceful_halt_timeout = 1200

    subconfig.ssh.username = "vagrant"
    subconfig.ssh.password = "vagrant"

    subconfig.vm.provider "parallels" do |prl|
      prl.name = "mac-dev"
      prl.update_guest_tools = true
    end
  end

And doing `vagrant box add mac` does not work?
Reply all
Reply to author
Forward
0 new messages