Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been using opscode chef for remote configuration and I wanted to test my chef scripts locally, so I started working on setting up a vagrant box. But, I can't seem to get my vagrant boxes to register. I get errors like the ones listed here:

My Vagrantfile looks like this: do |config| = "lucid32"

  config.vm.forward_port 80, 8080

  config.vm.provision :chef_client do |chef|
   chef.chef_server_url = ""
   chef.validation_key_path = ".chef/pinedesk-validator.pem"
   chef.validation_client_name = "pinedesk-validator"
   chef.node_name = "vagrant"
   chef.provisioning_path = "/etc/chef"
   chef.log_level = :debug

   chef.add_role "base"

And my .chef folder has these:


Chef appears appears to register a new client, and then gets an HTTP 401 when creating the node. Any pointers?

share|improve this question
up vote 2 down vote accepted

It appears you are trying to register a new client by a name that already exists.

If you run knife client list you should see a client name that matches your vagrant vm's host name

Assuming the hostname is 'vagrant' you could run this:

for foo in client node ; do knife $foo delete vagrant -y ; done

then run vagrant up or vagrant provision

You will probably want to delete the client and node after every vagrant destroy

share|improve this answer
Cassiano Leal's vagrant-butcher gem ensures that nodes and clients associated with your Vagrant VMs are deleted when the VMs are destroyed. – cwjohnston Dec 31 '12 at 8:48
Is there a way not to delete client, but reuse an existing one? – Vladislav Rastrusny Aug 6 '14 at 13:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.