vagrantfile

Vagrant Refused via browser

痞子三分冷 提交于 2019-12-06 06:17:40
问题 I am very new to using Vagrant in my development workflow, however when setting up the box using vagrant up and then accessing it via my host i get a connection refused with my browser. Is all that needs to be done to work is: vagrant init scotch/box vagrant up ? 回答1: Make sure to forward the 80 port from the guest so you can access the vm from your browser. Edit your Vagrantfile and make sure to have a line like (by default when doing vagrant init I believe this is commented) config.vm

How to switch order of network adapters in Vagrant under VirtualBox?

不想你离开。 提交于 2019-12-06 04:49:06
Under Vagrant I have config something like this: Vagrant.configure(2) do |config| config.vm.box = "ubuntu/trusty64" config.vm.provider "virtualbox" do |vb| vb.memory = "512" end config.vm.host_name = 'core.example.com' config.vm.network "forwarded_port", guest: 22, host: 2222, id: 'ssh' config.vm.network "private_network", ip: '172.28.128.3' config.vm.synced_folder "./vagrant_core", "/vagrant", create: true end And after this I receiving something like that: Adapter eth0 -> NAT Adapter eth1 -> 'Private_network' ifconfig: eth0 Link encap:Ethernet HWaddr 08:00:27:cf:da:f3 inet addr:10.0.2.15

Vagrant::Errors::NetworkCollision: The specified host network collides with a non-hostonly network

风流意气都作罢 提交于 2019-12-06 03:43:28
I'm using vagrant with multiple machine, it's ever worked normally, but then it just doesn't work again. My part of Vagrantfile that defining the network: config.vm.define "app" do |layer| layer.vm.provision "chef_solo", id:"chef" do |chef| ..... end # Forward port 80 so we can see our work layer.vm.network "forwarded_port", guest: 80, host: 9999 layer.vm.network "private_network", ip: "10.10.10.10" end It's a standar configuration and I only have that vm. But when I tried to vagrant up , it shows error: Vagrant::Errors::NetworkCollision: The specified host network collides with a non-hostonly

Overriding Cookbook Attribute in Vagrantfile Custom JSON Data

孤者浪人 提交于 2019-12-05 22:10:38
How do you access node.override using chef.json in a Vagrant file? For example, using vagrant-berkshelf , I'm trying to install a particular Maven version based on Custom JSON Data in the Vagrantfile : chef.json = { 'maven' => { 'version' => '3.0.5' } } cookbooks\maven_custom\attributes\default.rb default['maven']['version'] = "3.2.1" cookbooks\maven_custom\recipes\default.rb Chef::Log.info(node['maven']['version']) When I run vagrant provision , the following gets printed out: 3.2.1 Additionally, I tried vagrant reload --provision , yet still saw "3.2.1" print out. I would've expected 3.0.5

Centos7 with private network lost fixed IP

青春壹個敷衍的年華 提交于 2019-12-05 09:24:59
I've a network issue with a centos7 vagrant box. When I setup a private network, with fixed IP, this one is well binding first, but get lost after some seconds/minutes. vagrant up ==> default: Forcing shutdown of VM... ==> default: Destroying VM and associated drives... ==> default: Running cleanup tasks for 'shell' provisioner... Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'sfeirbenelux/centos7'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'sfeirbenelux/centos7' is up to date... ==> default: Setting the

How to fix Vagrant error: `private_key_path` file must exist:

人盡茶涼 提交于 2019-12-05 06:12:32
I've been using PuPHPet to create virtual development environments. Yesterday I generated a config file for a new box. When I try to spin it up using the vagrant up command, I get the following error message: C:\xx>vagrant up Bringing machine 'default' up with 'virtualbox' provider... There are errors in the configuration of this machine. Please fix the following errors and try again: SSH: * private_key_path file must exist: P://.vagrant.d/insecure_private_key I came across this question and moved the insecure_private_key from puphpet\files\dot\ssh to the same directory as where the

GuestAdditions version mismatch

馋奶兔 提交于 2019-12-05 05:17:39
when I use this command: vagrant up I obtain this error: [machine1] GuestAdditions versions on your host (4.3.36) and guest (5.0.10) do not match. how can I update guest addition from ubuntu shell? Use the vagrant vbguest plugin Install the plugin: vagrant plugin install vagrant-vbguest Let vagrant up it will install the virtual box client if needed. If you want to force the installation you can run vagrant vbguest --do install You need to upgrade your VBoxGuestAdditions ISO either by: installing/upgrading the package by running: sudo apt-get install virtualbox-guest-additions-iso or by

Answering prompt using vagrant file?

匆匆过客 提交于 2019-12-04 23:38:11
Is it possible to add a script to a Vagrantfile that answers a prompt. I am provisioning a ubuntu box for docker config.vm.box = "ubuntu" config.vm.provision :shell, :inline => "sudo apt-get update" config.vm.provision :shell, :inline => "sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring" After running the last command, there is a prompt that asks Do you want to continue [Y/n]? An easier solution would be to use the -y option of apt-get : config.vm.provision :shell, :inline => "sudo apt-get -y install linux-image-generic-lts-raring linux-headers-generic-lts

Vagrant & Chef - Cookbook *** not found

牧云@^-^@ 提交于 2019-12-04 06:22:42
问题 I am trying to set up a simple development VM using vagrant and Chef as a provisioner. I am able to install chef using shell provisioner but it seems to me that the folder with chef recipes does not get mounted to the VM. It keeps complaining that cookbook *** not found. Here is my vagrant file and output I am getting # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant::Config.run do |config| # This strange method defines the name of the Vagrant Machine config.vm.define "SubscriptionAPI" do

How to automatically install Ansible Galaxy roles, using Vagrant?

陌路散爱 提交于 2019-12-04 04:48:07
Using one playbook only, then it's not possible to have Ansible automagically install the dependent roles. At least according to this SO thread . But, I have the added "advantage" of using Vagrant and Vagrant's Ansible local provisioner . Any tricks I may apply? Update 2018-11-22! Given the evolution of software, I can not guarantee that all of the "old stuff/answer" below is still legit and won't set your machine on fire lol. I do, however, maintain a Vagrantfile on GitHub that does install Ansible Galaxy roles automatically and this guy should essentially be regarded as the only one and holy