ptwobrussell / Mining-the-Social-Web-2nd-Edition

The official online compendium for Mining the Social Web, 2nd Edition (O'Reilly, 2013)
http://bit.ly/135dHfs
Other
2.9k stars 1.49k forks source link

Chef Fails on VMWare Provider for Vagrant #255

Closed Cornellio closed 9 years ago

Cornellio commented 9 years ago

Hello,

I would like to use Vagrant with my existing VMWare installation on OS X. I modified the Vagrantfile and am getting quite far into the setup, but it fails to complete all the Chef recipes.

Would you please review the Chef errors I receive, check the Vagrant file and advise which box I should use? I am using the box puphpet/ubuntu1204-x64.

Here is my Vagrantfile:

Vagrant.configure("2") do |config|

config.vm.provider :vmware_fusion do |v, override|

  # A vmware image for Ubuntu Precise
  override.vm.box = "puphpet/ubuntu1204-x64"
  override.vm.network :forwarded_port, host: 8888, guest: 8888
  override.vm.network :forwarded_port, host: 5000, guest: 5000
  override.vm.network :forwarded_port, host: 27017, guest: 27017
  override.vm.network :forwarded_port, host: 27018, guest: 27018
  override.vm.network :forwarded_port, host: 27019, guest: 27019
  override.vm.network :forwarded_port, host: 28017, guest: 28017
end

config.vm.provision :chef_solo do |chef|
  chef.log_level = :debug
  chef.cookbooks_path = "deploy/cookbooks"
  chef.json = {
    :answer => "42",
  }
  chef.run_list = [
    "recipe[mtsw2e::default]"
  ]
end

end

When doing vagrant up --debug the machine downloads, boots and the Chef loop is executed. Although some Chef actions seem to work, it finally ends with some errors such as:

=> default: Error executing action `run` on resource 'execute[install-setuptools]'
INFO interface: Machine: error-exit 
["VagrantPlugins::Chef::Provisioner::Base::ChefError", "Chef never successfully > completed! Any errors should be visible in the\noutput above. Please fix your  recipes so that they properly complete."]
STDERR: sh: 1: /bin/python: not found
---- End output of   /bin/python ez_setup.py
---------------------------------------
Ran   /bin/python ez_setup.py

Attempting to reload and reprovisoin the VM shows this:

$ sudo vagrant reload

==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'puphpet/ubuntu1204-x64' is up to date...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Starting the VMware VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 172.16.132.140:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Forwarding ports...
    default: -- 8888 => 8888
    default: -- 5000 => 5000
    default: -- 27017 => 27017
    default: -- 27018 => 27018
    default: -- 27019 => 27019
    default: -- 28017 => 28017
    default: -- 22 => 2222
==> default: Configuring network adapters within the VM...
==> default: Waiting for HGFS kernel module to load...
==> default: Enabling and configuring shared folders...
    default: -- /Users/petec/Library/Scripts/python/projects/mining/SocialWebGitRepo: /vagrant

$ sudo vagrant provision

==> default: Running provisioner: chef_solo...
==> default: Detected Chef (latest) is already installed
Shared folders that Chef requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a `vagrant reload` so that the proper shared
folders will be prepared and mounted on the VM.

The shared folder in the VM is working and is mounted as /vagrant. Also, I have network access in the VM, as I'm able to get outside, run apt-get update, etc.

Thank you for any suggestions,

Pete

Cornellio commented 9 years ago

Update:

I got it working with the help of Issue #243 by downgrading Vagrant and adding a symlink for Python.

Working environment:

LINGLUOJUN commented 8 years ago

Hi, I meet the same problem in my win 7 .so how can I inside into the VM since I can't find the password anywhere. Can you help me with this problem? Thank you.