Questions tagged [vagrantfile]

Vagrantfiles are configuration files for vagrant. The Vagrantfile describes the type of virtual machine, and how to configure and provision the vm.

Filter by
Sorted by
Tagged with
-3 votes
0 answers
13 views

Trying to vagrant up but getting error wrong number of arguments (given 2, expected 1) (ArgumentError) [closed]

I am trying to run kitchen converge/vagrant up on my local system but it doesnt allow me to spin a machine just keeps throwing error. C:/Program Files (x86)/Vagrant/embedded/gems/gems/vagrant-2.4.0/...
Coverpoint. xyz's user avatar
-1 votes
0 answers
14 views

Vagrant not running on Macbook

I am following Imran Teli's Devops course on Udemy and getting the following error: I am trying to run Vagrant using VMVare fusion on my Macbook Air M2 but I keep getting this issue: I have enabled ...
Haseeb Ashraf's user avatar
0 votes
0 answers
297 views

Error: [email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

windows 11 Vagrant 2.4.0 I was using multiple vagrants using single file This is the code of my vagrant file Vagrant.configure("2") do |config| config.hostmanager.enabled = true config....
Ham Apke Hai Kon's user avatar
-1 votes
1 answer
35 views

Can't connect to a running server in vagrant with windows OS

I recently installed vagrant in windows 10 and everything just work fine but as I know almost nothing about Virtualization or VM's I got a problem when connecting to a server. I have a nodejs server ...
nabe's user avatar
  • 1
1 vote
1 answer
21 views

Create an alias in Vagrant shell provision

I can't figure out why my alias definition within the Vagrantfile shell provisioning script is not working. This is (a part of) my Vagrantfile: config.vm.provision "shell", inline: <<-...
vasilli's user avatar
  • 45
0 votes
0 answers
25 views

How to get SQL script from MySQL Workbench .mwb file programatically?

My db schema is designed in MySQL Workbench and saved as a .wmb file. In my Vagrantfile I want to generate the SQL schema for my db and then load it. Smth like this: MySQLWorkbench --generateSQL ...
vasilli's user avatar
  • 45
0 votes
0 answers
18 views

What is the point of do |variable| in Vagrantfile?

Can someone explain to me the difference b/w these two options, if any? What is the preferred way and why? Rn I have this: BoxName = "crbienes-test" Vagrant.configure("2") do |...
vasilli's user avatar
  • 45
-1 votes
1 answer
88 views

Pinging multiple vms on local network: destination host unreachable

While doing a vprofile project in linux setting up a multiple vm through hypervisor and a vagrant file i'm facing issues as all vms can't ping to each other as required in the stack. PING web01 (192....
Rutz's user avatar
  • 1
0 votes
1 answer
53 views

Vagrantfile docker provider network errors

I'm attempting to use the following files to create 3 k8 nodes using the docker provider and ansible. Vagrantfile: IMAGE_NAME = "roboxes/rhel8" N = 3 Vagrant.configure("2") do |...
J1raya's user avatar
  • 330
1 vote
2 answers
70 views

in a Vagrantfile, I define a local variable. How can pass it to a bash script as a parameter? $var, #var, #{var}?

In a Vagrantfile, I want to run scripts. But some part of them shouldn't run in provision mode. I've sat a local variable update = "true" (or false) depending of the value of the Vagrant ...
Marc Le Bihan's user avatar
9 votes
4 answers
10k views

GPG error public key is not available: NO_PUBKEY B53DC80D13EDEF05: during VM creation using Vagrant

I am trying to install a K8s cluster VM nodes using Vagrant and relevant install shell script (listed below). I tried some of the suggestions in similar questions, but they did not help my case. I am ...
AnilJ's user avatar
  • 2,019
0 votes
1 answer
77 views

PyCharm "Cannot find reference" error with nested packages in a Vagrant VM

I'm working on a Python project that utilizes a unique nested package structure and is running within a Vagrant VM. Everything works fine when I run the code within the VM, but PyCharm IDE is throwing ...
xaostheory's user avatar
0 votes
1 answer
428 views

How can I access an NGINX web server running inside a Docker container on a virtual machine managed by Vagrant, from my Windows host machine?

I have set up the Vagrantfile to use a public network with IP address 192.168.1.10 : # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "...
Khaled Boussoffara's user avatar
1 vote
1 answer
39 views

I tried creating an centos image vagrant file and the error showed up

$ vagrant init geerlingguy/centos7 Vagrant failed to initialize at a very early stage: The executable 'cmd.exe' Vagrant is trying to run was not found in the %PATH% variable. This is an error. Please ...
RAJKUMAR MIKKILI's user avatar
0 votes
1 answer
59 views

Vagrantfile provision script credentials

Banging my head of a brick wall with this and have tried multiple methods without success so far. Hoping the Vagrant gurus out there can assist. I am trying to find a method of successfully removing ...
gone t'pub's user avatar
0 votes
0 answers
70 views

Using a vagrant to connect to a docker container(outside vagrant) and both are independent to each other on one host

I'm trying to connect to a docker-compose container(which is not installed on vagrant) from a vagrant app running on the same host. How do i enable the communication between them. I have seen there is ...
user avatar
0 votes
0 answers
14 views

How can I query already existing configuration properties in Vagrantfile?

In case my Vagrantfile runs second (or subsequent) times the VirtualBox machine exists. I do know how to customize the configuration with vb.customize. I am wondering is there a way to query somehow ...
g.pickardou's user avatar
1 vote
0 answers
22 views

How can I handle errors in Vagrantfile?

I have this code in Vagrantfile: begin ... vb.customize ... my Ruby code goes here ... rescue puts "my error message goes here in case of Ruby error" end # Ruby code ...
g.pickardou's user avatar
0 votes
0 answers
95 views

Vagrant provisioning script installs software (Pyenv) which requires shell restart

I am using Vagrant to spin up an Ubuntu box and run a shell script which configures the VM to use Pyenv. The Pyenv docs recommend restarting the shell after installation & configuration. Having ...
PJ Simpo's user avatar
  • 214
-1 votes
1 answer
145 views

Vagrant file: host name repeated?

I have following in vagrant config file: config.vm.define "db01" do |db01| db01.vm.box = "geerlingguy/centos7" db01.vm.hostname = "db01" db01.vm.network "...
Mandroid's user avatar
  • 6,428
-1 votes
1 answer
53 views

Running Vagrant Up error - 'Never run this as root (or with sudo).'

Windows - Vagrant and VM Virtual Box If I use Vagrant Up command, I get an error. "Never run this as root (or with sudo)." Vagrant file opens with this... # prevent accidental sudo / root if ...
lowercase's user avatar
  • 1,210
0 votes
1 answer
232 views

vagrant shell provisioner stops being able to install docker

I have been using the Vagrantfile below to create virtual machine and the same time install docker on the vms by simply running vagrant up. Now this script fails whenever i make subsequent attempt to ...
amachree tamunoemi's user avatar
-1 votes
1 answer
49 views

Puppet not using the specified environment path

I am new to vagrant and puppet and having problem getting environment and environment_path to work. My working directory looks like this: => C:/vagrantdemo/Vagrantfile => C:/vagrantdemo/...
Kent's user avatar
  • 33
0 votes
1 answer
204 views

how to import vagrant without going through 'vagrant add box'

I have the vagrant 'virtualbox' virtual machine, however I can no longer access vagrant with another pc to retrieve my information contained in the virtual machine. 'ubuntu/focus' how can I proceed?
DIRKK's user avatar
  • 3
0 votes
1 answer
80 views

How do I resolve a `vagrant up` issue

I have been trying to run vagrant up but I keep getting an error, though I have run a command for the box vagrant init ubuntu/focal64 and the result said I am ready to vagrant up but I keep getting ...
Sunday Brown Akobo's user avatar
-1 votes
1 answer
115 views

Is it possible to set up a Vagrant sync folder with variable host/source directory, possibly from config file? [closed]

I'm trying to set up a Vagrantfile that will mount a code base on the developer's machine. The place the developer puts the codebase on their machine could be anywhere they like based on how they ...
Kevin's user avatar
  • 175
1 vote
0 answers
186 views

Can I load a Vagrantfile that loads another Vagrantfile?

I'm trying to set up an inheritance structure in my forest of Vagrantfiles. Basically I wanted something like this: /base Vagrantfile /testvm Vagrantfile /nginx-test Vagrantfile The ...
Don Seiler's user avatar
0 votes
0 answers
113 views

Troubleshooting access to Flask app in Vagrant guest

I have a toy Flask app: from flask import Flask app = Flask(__name__) @app.route("/home") def home(): return "<h1>Home...</h1>" @app.route("/health") ...
user3535074's user avatar
  • 1,298
0 votes
1 answer
124 views

Trying to figure out where ssh port forwarding is configured in vagrantfile

I'm trying to learn Vagrant, Ansible, and Jenkins, so I was super stoked when I came across this repo. A lot of the code is out of date so I've spent my time updating things and it is almost running ...
ChadDa3mon's user avatar
0 votes
1 answer
27 views

How to acees the exact total memory from vagrant VM

Ex : here I am able to see the base memory in vagrant machine 11800 Is there any Linux or any other command to extract this memory value it should retrive 11800
praveen pattar's user avatar
0 votes
1 answer
299 views

How can I change the default box in vagrant

I want to run vagrant up with provider is docker with command vagrant up --provider=docker in Mac M1. The output is Bringing machine 'default' up with 'docker' provider... ==> default: Box 'debian/...
Noob's user avatar
  • 23
0 votes
0 answers
606 views

Vagrant boxes gives SSH error when trying to connect

I'm trying to create 3 ubuntu vagrant boxes: machine1,machine2,machine3. machine3 should run an ansible playbook which installs something on machine1 and machine2. However, keep getting an error when ...
Yael's user avatar
  • 25
1 vote
0 answers
88 views

How can I control Vagrant from an ansible playbook?

I am currently working on my final degree project and I have been asked to create a platform in which I have to generate a Vagrantfile (in general control vagrant) from an ansible playbook. Ansible ...
Alexis Peralta's user avatar
2 votes
0 answers
129 views

Vagrant Multiple VM Provision Order

I'm trying to build a vagrant file that defines multiple VM. Vagrant.configure("2") do |config| config.vm.define "one" do |cfg| [...] end config.vm.define "two&...
shoxx's user avatar
  • 21
0 votes
1 answer
371 views

How to disable Vagrant port forwarding for SSH?

I would like to set up VirtualBox via Vagrant in a way that resembles my cloud provider setup as close as possible. This means: VM is reachable via some public IP (e.g. 192.168.0.2) A given public ...
ss1's user avatar
  • 1,049
40 votes
9 answers
29k views

The IP address configured for the host-only network is not within the allowed ranges

I got this error when I run vagrant up on my macOS: The IP address configured for the host-only network is not within the allowed ranges. Please update the address used to be within the allowed ...
Hongbo Miao's user avatar
  • 46.4k
1 vote
1 answer
1k views

What is the difference between hashicorp/precise64 and hashicorp/bionic64?

I found some online tutorial is using vagrant init hashicorp/bionic64 or vagrant init hashicorp/precise64 to initialize Vagrant. I only found these info about these two boxes: https://app.vagrantup....
Hongbo Miao's user avatar
  • 46.4k
0 votes
1 answer
141 views

vagrant: select sync method by provider

Is any reliable method available for including a conditional in a Vagrantfile, for use in Vagrant, to select method of folder syncing based on provider? Presently, I have included the following line:...
brainchild's user avatar
6 votes
0 answers
83 views

How to specify network when provisioning in vagrant

I have multiple networks specified in my vagrantfile and only one of them are accessible from outside. When the vagrant starts provisioning, sometimes it chooses the wrong network (IP) to connect to ...
Teymur's user avatar
  • 63
1 vote
2 answers
116 views

Strange behaviour of Vagrant Up command

Whenever I run Vagrant up, I am getting the following error. Following is my vagrant file default_box = "generic/opensuse42" Vagrant.configure("2") do |config| config.vm....
codeX's user avatar
  • 4,972
-1 votes
1 answer
693 views

In Vagrant, how do I open a port on my virtual machine so that the host machine can connect (testing with telnet)?

I’m using Vagrant 2.2.18 on Mac and creating a local Ubuntu 14.04 virtual machine. I want to expose port 1234 in my VM, so I have configured this config.vm.define "dev" do |dev| dev....
Dave's user avatar
  • 15.1k
1 vote
1 answer
2k views

Public Network for Vagrant using libvirt

I am trying to create a virtual machine using libvirt and Vagrant. I am successful in creating a VM with private networking, but when I try using public Networking, the virtual machine creation fails ...
hellodk's user avatar
  • 316
1 vote
0 answers
10 views

Force failure if Vagrantfile misses environment variable

I have a Vagrantfile which I want to use as a common base for different machines. Each machine must have a static IP assigned. This can be achieved using ENV[] in the Vagrantfile. Though I'd like to ...
benjist's user avatar
  • 2,781
0 votes
1 answer
495 views

Vagrant cannot find files on Host OS in Vagrantfile

I attempted to reference a file on Host OS in Vagrantfile and set an environment variable. However, it appears that Vagrant fails to find the file. Everything works perfectly when the file located in ...
tipotto's user avatar
  • 107
1 vote
1 answer
522 views

Github action job recurse the directory structure as the working-directory?

I have the following directory structure, and one github action. I want to run the github aciton in every sub folder like (centos7, centos8, ubuntu2004 ...). How to config the github action? . ├── ...
fei_hsueh's user avatar
  • 171
0 votes
1 answer
286 views

lochalhost:8080 does not display Centos 8 Tomcat SpringBoot server contents

As part of a local deployment of a GitHub project using a Centos 8 Vagrant virtual machine, I have obtained the following results after running "vagrant up" in GitBash: Virtual machine log: ...
Brxan's user avatar
  • 1
2 votes
0 answers
45 views

when i am doing vagrant up i am facing this error regarding could not resolve host

when i am doing vagrant up i am facing this error. An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again. Could not ...
Dhaval Shah's user avatar
0 votes
1 answer
338 views

Detect Vagrant up in vagrantfile

In my vagrantfile I use two lines of rudy code to get the username and password from the console and pass it on to the shell script for creating an additional user account instead of the default ...
Sency's user avatar
  • 2,838
3 votes
0 answers
1k views

Vagrant setup error: There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox

i am new to coding and am currently facing an annoying issue when installing Vagrant and it is stopping from completing my studies, i am using: macOS Big Sur 11.3.1 on a MacPro I've tried ...
Mohamed Arafa's user avatar
0 votes
1 answer
40 views

when looking up "vagrant up" it gives unsatisfactory information on getting vagrant working

when looking for vagrant up this is what you get: Error when trying vagrant up . I didn't find this particularly helpful so what the correct answer is you need to go to, https://app.vagrantup.com/...
Whitequill Riclo's user avatar

1
2 3 4 5
20