11

Trying to setup rethinkdb using https://github.com/RyanAmos/rethinkdb-vagrant

C:\rethinkdb-vagrant>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:

VirtualBox Provider:
* The following settings shouldn't exist: vm

VagrantFile

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    # Ubuntu 12.04, 64 bit
  config.vm.box     = 'precise64'
  config.vm.box_url = 'http://files.vagrantup.com/precise64.box'

  # Providers
  config.vm.provider :virtualbox do |p|
    p.vm.customize ['modifyvm', :id, '--memory', '512', '--ioapic', 'on']
  end

  # SSH
  config.ssh.username = "vagrant"

  # Port Forwarding
  config.vm.network :forwarded_port, guest: 8080, host: 8080
  config.vm.network :forwarded_port, guest: 28015, host: 28015
  config.vm.network :forwarded_port, guest: 29015, host: 29015

  # Attempt to 'guess' the default network
  config.vm.network :public_network, :bridge => 'en0: Wi-Fi (AirPort)'

  # Provisioning
  config.vm.provision :shell do |sh|
    sh.inline = <<-EOF
      export DEBIAN_FRONTEND=noninteractive;
      apt-get update --assume-yes;
      apt-get install --assume-yes python-software-properties;
      add-apt-repository --yes ppa:rethinkdb/ppa 2>&1;
      apt-get update --assume-yes;
      apt-get install --assume-yes rethinkdb;

      sed -e 's/somebody/root/g' -e 's/somegroup/root/g' -e 's/# bind=127.0.0.1/bind=all/g' /etc/rethinkdb/default.conf.sample > /etc/rethinkdb/instances.d/default.conf

      rethinkdb create -d /var/lib/rethinkdb/instances.d/default 2>&1;

      service rethinkdb start;
    EOF
  end
end
Jason More
  • 6,983
  • 6
  • 43
  • 52

2 Answers2

15

The issue is at this section:

# Providers
config.vm.provider :virtualbox do |p|
  p.vm.customize ['modifyvm', :id, '--memory', '512', '--ioapic', 'on']
end

where p.vm.customize should just be p.customize since as the outer loop shows, vm is parent to provider and customize hangs directly off of provider.

So the correct block would be:

# Providers
config.vm.provider :virtualbox do |p|
  p.customize ['modifyvm', :id, '--memory', '512', '--ioapic', 'on']
end
kenorb
  • 155,785
  • 88
  • 678
  • 743
Matt Wrock
  • 6,590
  • 29
  • 23
  • Thanks for the answer. It did cause me to update vagrant to 1.6.2, which had the fix you posted above, but it still didn't fix it. :-( – Jason More May 14 '14 at 12:48
  • Yeah I was messing with the config file this morning and that looks like it. Feel free to update your answer and I'll mark it correct. – Jason More May 14 '14 at 14:39
-2

If you run:

vagrant global-status

you will see all the possible machines that might be running on your computer.

Then take those machines and go vagrant suspend [machine id]

Further more you can open Virtual Box and Power Off those machines manually from that GUI, which should free up the ports.

kenorb
  • 155,785
  • 88
  • 678
  • 743