Vagrant GuestAdditions seems to be installed (5.1.20) correctly, but not running - oracle

I want to copy one entire folder present on my windows machine to a vm hosting ubuntu/trusty64.
But every time I try to bring my vagrant up i get below error message.
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: Adapter 2: hostonly
==> 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: Configuring proxy for Apt...
==> default: Configuring proxy environment variables...
[default] GuestAdditions seems to be installed (5.1.20) correctly, but not running.
vboxadd: unrecognized service
vboxadd-service: unrecognized service
bash: line 4: setup: command not found
==> default: Checking for guest additions in VM...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
setup
Stdout from the command:
Stderr from the command:
bash: line 4: setup: command not found
Note:
Ubuntu version is up to date as you can see in the third line.
Vagrant version : Vagrant 1.9.3
Windows version : Windows 7 Enterprise Service Pack 1
Oracle VirtualBox version : Version 5.1.20 r114628 (Qt5.6.2)
On running the command vbguest status i get
$ vagrant vbguest --status
[default] GuestAdditions seems to be installed (5.1.20) correctly, but not running.
My vagrant file contents are
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/trusty64"
config.ssh.insert_key = false
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "xxxxx"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
#config.vm.synced_folder "../data", "/vagrant_data" , "/vagrant"
config.vm.synced_folder ".", "/mydata", :mount_options => ['dmode=775','fmode=664']
#config.vm.synced_folder "./", "/vagrant", id: "vagrant-root", type: "nfs"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "xxxxx"
config.proxy.https = "xxxxx"
config.proxy.ftp = "xxxxx"
config.apt_proxy.http = "xxxxx"
config.apt_proxy.https = "xxxxx"
config.proxy.no_proxy = "xxxxx"
end
if !Vagrant.has_plugin?("vagrant-proxyconf")
system('vagrant plugin install vagrant-proxyconf')
raise("vagrant-proxyconf installed. Run command again.");
end
end
Please suggest
1. How can i correct this error?
2. Share the complete folder from windows to vm?

Connect the Guest VM using WinSCP. Copy the VBoxGuestAddition.iso from the host machine. In my case, the VBoxGuestAddition present in C:\ProgramFiles\Oracle\VirtualBox.
Once iso file copied to Guest VM, login to GUest VM using putty.
mkdir /media/GuestAdditionsISO
Then execute the below command
mount -o loop /path/of/VBoxGuestAddition.iso /media/GuestAdditionsISO
Once mount command executed successfully,
cd /media/GuestAdditionsISO
sudo ./VBoxLinuxGuestAddition.run
Then re-start the VM. This works for me

Related

Vagrantbox with Hyper-V not starting

I'm trying to setup a vagrantbox with Hyper-V on my local windows-10 mashine. My Workstation is running behind a proxy, but I configured a local cntlm proxy to get around these limitations. Proxy settings work fine since I was able to install a vagrant plugin and downloan a box image.
But now my guest linux does not start up and I am running out of ideas.
My vagrant file
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04" # ubuntu 18.04 image with support for virtual box and Hyper-V
config.vm.hostname = "skywalker"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
config.vm.provider "hyperv" do |hv|
hv.memory = "2048"
end
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" # prevent tty errors
# install the vagrant plugin "vagrant-cachier" to cache downloaded artifacts
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
# vagrant behing local cntlm proxy if plugin exists (= provinzial win10 workstation)
if !Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://localhost:3128/"
config.proxy.https = "http://localhost:3128/"
config.proxy.no_proxy = "localhost, 127.0.0.1"
end
# --------------------------------------------------------------------------
# provision virtual mashine (basic setup) and install applications in VM
#config.vm.provision "shell", path: "scripts/install-ansible.sh"
config.vm.provision "shell", path: "scripts/install-ncdu.sh"
config.vm.provision "shell", path: "scripts/install-git.sh"
config.vm.provision "shell", path: "scripts/install-openjdk-11.sh"
config.vm.provision "shell", path: "scripts/install-maven.sh"
config.vm.provision "shell", path: "scripts/install-node-npm.sh"
config.vm.provision "shell", path: "scripts/install-docker.sh"
config.vm.provision "shell", path: "scripts/install-docker-compose.sh"
# npm webserver
config.vm.provision "shell", path: "apps/install-npm-apps.sh"
config.vm.network "forwarded_port", guest: 8000, host: 8000
# artifactory setup (start artifactory after vm startup)
config.vm.network "forwarded_port", guest: 8081, host: 8081 # artifactory from docker
config.vm.network "forwarded_port", guest: 8082, host: 8082 # artifactory from docker
# See README.md for Artifactory in Docker
end
Starting the box with this settings results in
C:\home\work\workspace\vagrant-boxes\skywalker (master -> origin)
λ vagrant up
Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
==> default: Verifying Hyper-V is accessible...
==> default: Importing a Hyper-V instance
default: Creating and registering the VM...
default: Successfully imported VM
default: Configuring the VM...
==> default: Starting the machine...
==> default: Waiting for the machine to report its IP address...
default: Timeout: 120 seconds
default: IP: fe80::215:5dff:fe02:8b01
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: fe80::215:5dff:fe02:8b01:22
default: SSH username: vagrant
default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
On a different mashine with VirtualBox as VM provider this Vagrantfile works fine. Sadly I cannot use any VM provider other than Hyper-V on my windows mashine due to limitations which are out of my control ...
I set up Hyper-V using Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All.
Any ideas? Thanks in advance and best regards. Sebastian
I went through this exercise last week and saw similar problems. I made lot of progress following these steps and the vm's get spun up at a reasonable time under windows 10 hyper-v. This is what i did.
Followed this blog and tried creating a vm successfully first.
https://win32.io/posts/Vagrant-Install-HyperV
Then i created a simple vagrantfile and got it to work successfully. Here is mine ,
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/bionic64"
config.vm.hostname = 'utility-server-1'
config.vm.network 'public_network', bridge: 'Internet'
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider "hyperv" do |vb|
vb.memory = "4024"
vb.cpus = 2
vb.vmname = 'utility-server-1'
end
end
Once this works, add more complex steps from your vagrantfile, like shell scripts and forwarded ports.

How to up Vagrant with hashicorp/precise64 box?

I started learning Vagrant and I'm trying to up vagrant machine with hashicorp/precise64 box. I've installed VirtualBox 5.1 on Gentoo and I emerged Vagrant from Gentoo repository. I executed following command in terminal:
pecan#tux ~/vagrant_getting_started $ vagrant box add hashicorp/precise64
==> box: Loading metadata for box 'hashicorp/precise64'
box: URL: https://vagrantcloud.com/hashicorp/precise64
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.
1) hyperv
2) virtualbox
3) vmware_fusion
Enter your choice: 2
==> box: Adding box 'hashicorp/precise64' (v1.1.0) for provider: virtualbox
box: Downloading: https://vagrantcloud.com/hashicorp/boxes/precise64/versions/1.1.0/providers/virtualbox.box
==> box: Successfully added box 'hashicorp/precise64' (v1.1.0) for 'virtualbox'!
pecan#tux ~/vagrant_getting_started $ nano Vagrantfile
pecan#tux ~/vagrant_getting_started $ vagrant up
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
and I got above error when I tried to up Vagrant machine.
Vagrantfile content:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "base"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = "1024"
end
#
# View the documentation for the provider you are using for more
# information on available options.
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
end
end
vagrant up --provider=virtualbox command returns the below error:
pecan#tux ~/vagrant_getting_started $ vagrant up --provider=virtualbox
The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.
I'm counting for help!
The Vagrantfile is wrong, it does not contain the correct box information
You can remove the whole folder all together and start with vagrant init hashicorp/precise64 which will create a correct Vagrantfile, then you can run vagrant up (virtual box should be the default provider if not run vagrant up --provider virtualbox)
Fix the Vagrantfile and replace
config.vm.box = "base"
with
config.vm.box = "hashicorp/precise64"
Then you can run vagrant up and it will work.

Vagrant on w7 : can't find any box

I am new on stackoverflow and this is my first question...
I had an issue with Vagrant when trying to get a box on a private repository so I tried to get 'hashicorp/precise64' on Atlas and I have the same problem : Vagrant can't find the box.
I am using Vagrant 1.9.3 on Windows 7 with Virtualbox 5.1.18 (with extension pack).
I had no issue on installation.
$ vagrant version
Installed Version: 1.9.3
Latest Version: 1.9.3
You're running an up-to-date version of Vagrant!
Everything seems to be right on initialization, Vagrantfile is created :
$ vagrant init hashicorp/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.
Vagrantfile :
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "hashicorp/precise64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
end
Here is the error I get when using 'vagrant up' command :
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/precise64'
default: URL: https://atlas.hashicorp.com/hashicorp/precise64
The box 'hashicorp/precise64' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: https://atlas.hashicorp.com/hashicorp/precise64
Error: Failed writing body (0 != 1063)
I have the same issue when trying to download other public boxes.
I tried with few Vagrant versions (v1.9.0, v1.9.1, v1.9.2, v1.9.3), with and without admin rights.
I have no proxy and no internet connection issue.
I tried to disable my firewall.
I did some research on this, especially on Vagrant compatibility issues, but I could not find much and the problem remains.
Does anyone have an idea?
I just found the origin of my problem : I had special characters in my windows username that brought encoding issue in Vagrant temporary folder path...
A big thanks to Frédéric Henri (https://stackoverflow.com/users/4296747/fr%c3%a9d%c3%a9ric-henri) who helped me a lot and also found the origin of my issue.

localhost Vagrant and VM on a windows (8.1) build - vagrant file specifications

Having a problem getting my localhost to work properly.
Running git bash I've successfully vagrant init "hashicorp/precise32"
vagrant up
Perhaps I'm putting my local host IP in the wrong place: 127.0.0.1
Confirmed my VM is running and here is my vagrant file:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
# config.vm.boot_timeout = "300"
# Setting this above never worked for me when i had a config.vm.boot_timeout
config.vm.network :forwarded_port, guest: 80, host: 8082
# config.vm.network :public_network
config.vm.network "private_network", ip: "127.0.0.1"
config.vm.synced_folder ".", "/vagrant", type: "nfs"
config.vm.provider :virtualbox do |vb|
vb.gui = true
# I turned this vb.gui = true on when i was having a problem with config.vm.boot_timeout
vb.customize ["modifyvm", :id, "--memory", "4096"]
vb.cpus = 4
end
end
I've added some additional options but I think my ip or ports are wrong. Any help would be greatly appreciated. Thank you.
edit ************************
Host file looks like so:
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handle within DNS itself.
127.0.0.1 localhost
::1 localhost
After I vagrant reload:
$ vagrant reload
==> default: [vagrant-hostsupdater] Removing hosts
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'hashicorp/precise32' 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: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 (guest) => 8082 (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
==> default: Machine booted and ready!
[default] GuestAdditions 5.1.8 running --- OK.
==> default: Checking for guest additions in VM...
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/Timothy/Documents/Magento
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
Why is this so confusing right now, I've never had so much trouble setting up a local dev. environment.
you cannot use a private_network of 127.0.0.1 from your host thats your loopback adapter so it will never be able to reach your VM.
You should use on of the 3 following ranges (see https://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces)
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
vagrant will already create a NAT adapter on 10.0.2.15 to communicate over ssh.
I suggest to take an IP in the 192.168.x.x range and you will be able to work correctly with your VM

Vagrant Up provisions on one computer but not on another

I'm trying to get my Vagrant box setup from my work environment on my home computer but I've been running into issues. I've uninstalled and reinstalled Virtualbox and Vagrant twice now. At work, everything works as expected. At home, nothing. My vagrant file is as follows:
Vagrant::configure("2") do |config|
config.vm.box = "saucy64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.network :private_network, ip: "192.168.33.10"
# Allow more memory usage for the VM
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--memory", "1024"]
end
# Fix rights and permissions on shared folder
config.vm.synced_folder ".", "/vagrant/", :mount_options => [ "dmode=777", "fmode=666" ]
config.vm.synced_folder "./www", "/vagrant/www/", :mount_options => [ "dmode=775", "fmode=644" ], :owner => 'vagrant', :group => 'www-data'
# Set the timezone to something useful
config.vm.provision :shell, :inline => "echo \"Europe/London\" | sudo tee /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata"
# Make sure APT is up to date
config.vm.provision :shell, :inline => "apt-get update --fix-missing"
# Fix locales
# config.vm.provision :shell, :inline => "apt-get -y install language-pack-en"
config.vm.provision :puppet do |puppet|
puppet.facter = { "fqdn" => "dev.oraculum2.local", "hostname" => "www" }
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "oraculum2.pp"
puppet.module_path = "puppet/modules"
puppet.options = "--hiera_config /vagrant/hiera.yaml"
end
end
My output looks like this:
$ vagrant up --provision
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'saucy64'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Running 'pre-boot' VM customizations...
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period. This can
mean a number of things.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Of course, I've tried to increase the boot timeout but that had the same effect. I tried to boot in the GUI but it goes to a black screen and never changes.
Using:
Vagrant 1.4.1 and Virtualbox 4.3.6
I'm on an Ubuntu 12.04 machine and that's the same as work as well.
I tried with Vagrant 1.4.3 as well but same result. I'm lost as it worked fine at work. Any ideas?
I was initially going to suggest that there are networking issues, but I missed the 'GUI goes to a black screen and never changes' part.
This sounds as if the VirtualBox setup itself seems to have some trouble. I would suggest to try it with a different box as well to determine if it is a problem with the box (maybe a broken download?) or with VirtualBox itself.
make sure the box user ~vagrant/.ssh/authorized_keys contain the pub key to match your vagrant private key.
I had a very similar problem. vagrant up would abort and virtual box would start just fine.
i would get this:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[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
'aborted' 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.
i watched open console and see it started up and THEN aborted.
and so i generated debug.
VAGRANT_LOG=debug vagrant up >> DEBUG.LOG.0 2>&1 &
i walked through that data and saw inside:
DEBUG ssh: == Net-SSH connection debug-level log END ==
INFO ssh: SSH not up: #<Vagrant::Errors::SSHAuthenticationFailed: SSH authentication failed! This is typically caused by the public/private
keypair for the SSH user not being properly set on the guest VM. Please
verify that the guest VM is setup with the proper public key, and that
the private key path for Vagrant is setup properly as well.>
i started the virtual box from provider, logged in, checked and vagrant key was corrupt.
replaced it. tested ssh as vagrant without password. shutdown -h now. vagrant up…
SUCCESS!!
the output from vagrant up is misleading. in the debug we can see that it knows where it failed but this is not handled sufficiently to tell the user that the box /may be/ fine, the communication was bad.
Run the below command on the terminal
$ vagrant ssh-config
then check the output on the IdentityFile values, e.g.:
IdentityFile /home/{USERNAME}/.vagrant.d/insecure_private_key
then switch or login to the appropriate SSH user and run vagrant up, before login the SSH user, you must "suspend the vagrant box" using vagrant suspend command.

Resources