# \[RESOLVED\] Cannot use kitchen under proxy

**URL:** https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374
**Category:** Chef Infra (archive)
**Created:** [February 8, 2017, 9:34am UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374 "2017-02-08T09:34:02Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![giuseppestorm](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/giuseppestorm/32/1982_2.png) [@giuseppestorm](https://discourse.chef.io/u/giuseppestorm)
#### Post date: [February 8, 2017, 9:34am UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/1 "2017-02-08T09:34:03Z")

</div>

Hello,  
I'm starting now with chef and following the tutorial I'd already cooked my first recipes :).

I'd also used kitchen, but then I've tried to use kitchen at work(and we're under proxy 😕 )

It seems that the problem is the vagrant file automatically generated when I'm launching the command kitchen create. I know that for using proxy with vagrant I need to set some entries (and in other project without chef there's no problem)

this the output of the command kitchen create:

```
> gdm:learn_chef_httpd gi.dimaria$ kitchen create
> -----> Starting Kitchen (v1.14.2)
> -----> Creating <default-centos-72>...
> Bringing machine 'default' up with 'virtualbox' provider...
> ==> default: Checking if box 'bento/centos-7.2' 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 (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
> 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.

```

and this is the my .kitchen.yml:

> driver:  
> name: vagrant  
> provisioner:  
> name: chef\_zero  
> http\_proxy: [http://myproxy.it:8080](http://myproxy.it:8080)

> verifier:  
> name: inspec

> platforms:
> 
> - name: centos-7.2

> suites:
> 
> - name: default  
> run\_list:
> - recipe[learn\_chef\_httpd::default]  
> attributes:

I need to use kitchen under proxy but I don't know how to set correctly this file.  
can you help me please?

in my shell the proxy variables are already set

Giuseppe

---

<div class="post-metadata">

### Author: ![kawolfe](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@kawolfe](https://discourse.chef.io/u/kawolfe)
#### Post date: [February 8, 2017, 3:55pm UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/2 "2017-02-08T15:55:40Z")

</div>

you may need to set a no\_proxy env var as well.  
`no_proxy: "localhost,127.0.0.1,*.local,*.yourdomain.com"`

I see you are using `bento/centos-7.2` and might be having the same issue I ran into last week. After tons of searching it turns out I needed to set `cableconnected` as `on`.

`driver:`  
`name: vagrant`  
`customize:`  
`cableconnected1: 'on'`

---

<div class="post-metadata">

### Author: ![giuseppestorm](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/giuseppestorm/32/1982_2.png) [@giuseppestorm](https://discourse.chef.io/u/giuseppestorm)
#### Post date: [February 8, 2017, 4:31pm UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/3 "2017-02-08T16:31:01Z")

</div>

thank you.  
the no\_proxy was already set on my .bash\_profile

so the new files should be:

```
driver:
name: vagrant
customize:
cableconnected1: 'on'
provisioner:
name: chef_zero
http_proxy: http://myproxy.it:8080

verifier:
name: inspec

platforms:
- name: centos-7.2

suites:
- name: default
run_list:
- recipe[learn_chef_httpd::default]
attributes:

```

right?

---

<div class="post-metadata">

### Author: ![reddybathina](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@reddybathina](https://discourse.chef.io/u/reddybathina)
#### Post date: [February 8, 2017, 4:34pm UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/4 "2017-02-08T16:34:01Z")

</div>

You need to set timeout variable in vagrant file with higher value, I think  
the default value will be around 300, increase it to 1200 and see…

---

<div class="post-metadata">

### Author: ![kawolfe](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@kawolfe](https://discourse.chef.io/u/kawolfe)
#### Post date: [February 8, 2017, 4:35pm UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/5 "2017-02-08T16:35:30Z")

</div>

looks good to me.

---

<div class="post-metadata">

### Author: ![sunilkumar](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@sunilkumar](https://discourse.chef.io/u/sunilkumar)
#### Post date: [February 9, 2017, 9:42am UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/6 "2017-02-09T09:42:02Z")

</div>

@giuseppestorm Can you please try with centos-7.1…I think there is a issue with centos-7.2 Box.

[https://github.com/nsidc/vagrant-vsphere/issues/182](https://github.com/nsidc/vagrant-vsphere/issues/182)

---

<div class="post-metadata">

### Author: ![jbellone](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jbellone/32/1179_2.png) [@jbellone](https://discourse.chef.io/u/jbellone)
#### Post date: [February 9, 2017, 12:02pm UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/7 "2017-02-09T12:02:09Z")

</div>

We use this extensively. Assuming I can dig out of my hotel and get to the office I’ll provide our config. You can hit me up on Chef Community Slack if I forget :).

JB

---

<div class="post-metadata">

### Author: ![giuseppestorm](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/giuseppestorm/32/1982_2.png) [@giuseppestorm](https://discourse.chef.io/u/giuseppestorm)
#### Post date: [February 13, 2017, 8:31am UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/8 "2017-02-13T08:31:30Z")

</div>

Hello,  
I’ve resolved the issue but the problem was my conf file in .ssh. Infact, even the knife command given a problem for ssh connection.

after having disabled the conf file I could use kitchen and knife.

---

<div class="post-metadata">

### Author: ![giuseppestorm](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/giuseppestorm/32/1982_2.png) [@giuseppestorm](https://discourse.chef.io/u/giuseppestorm)
#### Post date: [February 14, 2017, 1:39pm UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/9 "2017-02-14T13:39:03Z")

</div>

sorry I don’t understand 🙂

---

<div class="post-metadata">

### Author: ![joerg.herzinger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joerg.herzinger/32/1514_2.png) [@joerg.herzinger](https://discourse.chef.io/u/joerg.herzinger)
#### Post date: [February 14, 2017, 1:48pm UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/10 "2017-02-14T13:48:29Z")

</div>

Hi,

We had similar issues and it turned out that the system environment variable no\_proxy has a slightly different syntax than the ruby setting. While the system needs wildcards like \*.localdomain, ruby does not need/allow that. Even worse, it seems that if the environment variable is set the specific ruby setting is overridden by it.  
So we had to unset all proxy related environment variables and set them in our knife.rb:

```auto
http_proxy "http://proxy.local:57165"
https_proxy "http://proxy.local:57165"
no_proxy "domain.com,domain.corp,localhost,127.0.0.1"

```

---

<div class="post-metadata">

### Author: ![giuseppestorm](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/giuseppestorm/32/1982_2.png) [@giuseppestorm](https://discourse.chef.io/u/giuseppestorm)
#### Post date: [February 16, 2017, 6:00pm UTC](https://discourse.chef.io/t/resolved-cannot-use-kitchen-under-proxy/10374/11 "2017-02-16T18:00:08Z")

</div>

the problem is solved.  
After commenting the ssh config on my host I can use correctly kitchen.

thanks of all 🙂  
Giuseppe
