Issues using vagrant up with multiple providers - vagrant

I'm having an issue here trying to bring up a vagrant provider(s) specific box and am not certain what to do to proceed,
if this is in the documentation then I am not seeing it?
I am using the below to add the boxes
## Add the list of used Vagrant boxes
declare -A boxes
inc=1
boxes=(
['spherical64']='http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box' ## Fedora 18 x64 nocm
['centos6464']='http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box' ## CentOS 6.4 x64 nocm
['centos5964']='http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box' ## CentOS 5.9 x64 nocm
['squeeze64']='http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box' ## Debian 6.0.7 x64 nocm
['wheezy64']='http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box' ## Debian 7.0rc1 x64 nocm
['sles11164']='http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box' ## SUSE Enterprise 11sp1 x64 nocm
['lucid64']='http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box' ## Ubuntu Server 10.04.4 x64 nocm
['precise64']='http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box' ## Ubuntu Server 12.04.2 x64 nocm
)
set -e
for box in "${!boxes[#]}"; do
echo "-- Installing: ${inc}/${#boxes[#]} ${box}"
vagrant box add "${box}" "${boxes[$box]}"
((inc+=1))
done
set +e
Then trying to vagrant up from there (after init)
bash-4.3$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Adding box 'base' (v0) for provider: virtualbox
default: Downloading: base
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file /private/tmp/base
bash-4.3$ vagrant box list
centos5964 (virtualbox, 0)
centos6464 (virtualbox, 0)
lucid64 (virtualbox, 0)
precise64 (virtualbox, 0)
sles11164 (virtualbox, 0)
spherical64 (virtualbox, 0)
squeeze64 (virtualbox, 0)
wheezy64 (virtualbox, 0)
bash-4.3$ vagrant up --provider=centos6464
The provider 'centos6464' could not be found, but was requested to
back the machine 'default'. Please use a provider that exists.
bash-4.3$ vagrant up --provider=virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Adding box 'base' (v0) for provider: virtualbox
default: Downloading: base
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file /private/tmp/base

It was trying to use a base box (which did not exist) on vagrant up. So the answer is really to add the box name on vagrant init.
bash-4.3$ vagrant init precise64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
bash-4.3$ cat Vagrantfile |grep 'config.vm.box'
config.vm.box = "precise64"
bash-4.3$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'precise64'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: tmp_default_1416506255173_95689
==> 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 => 2222 (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 timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.2.10
default: VirtualBox Version: 4.3
==> default: Mounting shared folders...
default: /vagrant => /private/tmp

Related

Vagrant error when running vagrant up on Git Bash on Window 10

I am having trouble with vagrant up on Git Bash.
I'm currently using Vagrant 2.2.19 and VirtualBox 6.1 version.
Whenever I put vagrant up on Bash to be able to open VirtualBox server on Git bash using vagrant ssh, it shows the following error.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/bionic64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/bionic64' version '20200304.0.0' is up to date...
==> default: Setting the name of the VM: profiles-rest-api_default_1644116739589_78823
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 8000 (guest) => 8000 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'unknown' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
What I have done so far
Visualization is enabled from BIOS
Install VirtualBox extension pack
Uninstall and reinstall VirtualBox and Vagrant several times
Also, when I put vagrant ssh after that error, it shows nothing, but the VirtualBox is running as this image. Can you guys help me figure out how to open the VirtualBox server on Bash, please? Thank you!
enter image description here
Welcome to stackoverflow! Please visit this useful link.
-Try to downgrade the vagrant version that you are using and try again.
-Also, try to use the command debug vagrant up in order to have debug logs available for a more precise description of the error message.
Finally, take a look at stackoverflow question too.
You need to downgrade the virtualbox version and the vagrant version (they need to be both on convenient versions)

Getting > web01: Destroying VM and associated drives... while running command vagrant up in gitbash

Getting > web01: Destroying VM and associated drives... while running
command vagrant up in gitbash
Can anyone help me out with this?
Below is the error obtained while running vagrant up :
pavan#Pavan MINGW64 /c/VISUAL PATH
LABS/vprofile-project/vagrant/Manual_provisioning (local-setup) $
vagrant up Bringing machine 'web01' up with 'virtualbox' provider...
Bringing machine 'app01' up with 'virtualbox' provider... Bringing
machine 'rmq01' up with 'virtualbox' provider... Bringing machine
'mc01' up with 'virtualbox' provider... Bringing machine 'db01' up
with 'virtualbox' provider... ==> web01: Importing base box
'ubuntu/xenial64'... ==> web01: Matching MAC address for NAT
networking... ==> web01: Checking if box 'ubuntu/xenial64' version
'20211001.0.0' is up to date... ==> web01: Setting the name of the
VM: Manual_provisioning_web01_1639691363459_90324 ==> web01:
Clearing any previously set network interfaces... ==> web01:
Preparing network interfaces based on configuration...
web01: Adapter 1: nat
web01: Adapter 2: hostonly ==> web01: Forwarding ports...
web01: 22 (guest) => 2222 (host) (adapter 1) ==> web01: Destroying VM and associated drives...
Is there anything related to Hyper-V to be enabled for this command to work? If yes windows 11 home edition does not support Hyper-V natively have to go for the pro version.

Linux Vagrant Box compatible with VirtualBox version 6

I have been trying to install various Vagrant Boxes from Hashicorp's Vagrant Box Catalog but none seem to be compatible with:
Vagrant version: 2.2.9
VirtualBox versions: 6.0.x or 6.1.x
Host: Mac Catalina
I have tried multiple workarounds shared online and either the Guest Additions don't match or there are none available.
Both the plugin and the manual addition of guest additions also doesn't work.
Everything seems to work fine except for the shared folders syncing. Looking to get a workaround to fix the shared folder sync or a standard Linux Vagrant Box that is compatible with the VirtualBox guest additions.
The issue was fixed by manually mounting the Guest Additions VBoxGuestAdditions.iso file as CD-ROM in the VirtualBox.
Despite this, the Vagrant boxes may fail to sync shared folders via VirtualBox provider and instead use rsync for the same.
This can be fixed by updating the Vagrantfile by explicitly setting the provider type to VirtualBox in the config.
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
After this vagrant reload and the shared folder sync should work as expected.
$ vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:
https://www.virtualbox.org/manual/ch04.html#sharedfolders
This option can be disabled globally with an environment variable:
VAGRANT_DISABLE_VBOXSYMLINKCREATE=1
or on a per folder basis within the Vagrantfile:
config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
==> 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: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => /Users/hemanik/vm/
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
Not sure if it was able to find the guest additions default: Checking for guest additions in VM... or if the previous tweaking with the guest additions took effect but the shared folder sync works as expected.
Just for an update, reinstalled Vagrant and the current working versions are as follows:
Vagrant version: 2.2.10
VirtualBox Version: 6.0.24 r139119

CentOS guest in Debian guest on Windows 7 host: "VT-x is not available (VERR_VMX_NO_VMX)"

I have VirtualBox 5.1 installed on Windows 7.
There I have a guest OS Debian (64-bit) set up.
For this guest system I have both "Enable VT-x/AMD-V" and "Enable Nested Paging" boxes checked in the "System - Accelaration" menu and the "Paravirtualization Interface" is set to "KVM".
Now I am trying to deploy a CentOS (guest) system (following these instructions to install an Apache Metron dev environment) inside the Debian guest OS, using VirtualBox 5.0 as a provider to Vagrant.
I run:
vagrant up
and receive the following output:
ytsboe#debian-metron ~/incubator-metron/metron-deployment/vagrant/full-dev-platform$ vagrant up
Running with ansible-skip-tags: ["solr", "yaf"]
Bringing machine 'node1' up with 'virtualbox' provider...
==> node1: Box 'bento/centos-6.7' could not be found. Attempting to find and install...
node1: Box Provider: virtualbox
node1: Box Version: >= 0
==> node1: Loading metadata for box 'bento/centos-6.7'
node1: URL: https://atlas.hashicorp.com/bento/centos-6.7
==> node1: Adding box 'bento/centos-6.7' (v2.2.7) for provider: virtualbox
node1: Downloading: https://atlas.hashicorp.com/bento/boxes/centos-6.7/versions/2.2.7/providers/virtualbox.box
==> node1: Successfully added box 'bento/centos-6.7' (v2.2.7) for 'virtualbox'!
==> node1: Importing base box 'bento/centos-6.7'...
==> node1: Matching MAC address for NAT networking...
==> node1: Checking if box 'bento/centos-6.7' is up to date...
==> node1: Setting the name of the VM: full-dev-platform_node1_1483547498018_38251
==> node1: Clearing any previously set network interfaces...
==> node1: Preparing network interfaces based on configuration...
node1: Adapter 1: nat
node1: Adapter 2: hostonly
==> node1: Forwarding ports...
node1: 22 (guest) => 2222 (host) (adapter 1)
==> node1: Running 'pre-boot' VM customizations...
==> node1: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "34769275-58df-4c89-af8d-d1cb3e538dc9", "--type", "headless"]
Stderr: VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
Does anybody know what is going on?
Note: Many posts here suggest to turn off Hyper-V. I actually tried to do that on my Dell, but could not find it in the BIOS. Neither do I think that it would help, since the problem is in the guest of the guest ...
It turns out that VirtualBox inside VirtualBox is not supported (yet): https://www.virtualbox.org/ticket/4032

Issues when running vagrant in Ubuntu 14.04

When running vagrant with latest package of Ubuntu 14.04, I got the following error message. Is there any configuration for Virtualbox? The provider is Virtualbox, and not special configuration after apt-get install virtualbox. BTW, can not connect to this host by GUI :(.
# vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> 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 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
Enable VT-x Virtualization Technology in BIOS and still your problem remains see issue vagrant issues 2157 and this issue.

Resources