ssh-agent inside VM loses connection to host's agent - how do I restore it?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ssh-agent inside VM loses connection to host's agent - how do I restore it?

Adam Fields
I'm using config.ssh.forward_agent = true, and finding that frequently when I bring the vm back from a vagrant suspend (using the precise64 base box), it can no longer contact the ssh agent. If I then run eval `ssh agent` inside the vm, that results in an agent starting up, but it has no identities, even though the host ssh-agent has them. How can I get these back in sync again?

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Static IP on Public Network/Bridged

James Jelinek
Here is a very basic Vagrantfile that I'm using to boot a web and db server which I plan to setup nginx/rails and mysql.  

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

Vagrant.configure("2") do |config|
config.vm.define :web do |web|
    web.vm.box = "web"
    web.vm.hostname = "web"
    web.vm.network :public_network, ip: "192.168.1.200"
  end

  config.vm.define :db do |db|
    db.vm.box = "precise32"
    db.vm.hostname = "db"
    db.vm.network :public_network, ip: "192.168.1.201"
  end
end


I want to assign a static IP to the interface instead of having dhclient pull one.  I've read the documentation and this seems to be the way to do it but each time I boot the VMs they grab an IP from the dhcp pool of my router instead of the IPs I've specified.

Am I doing something wrong here?


--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: Static IP on Public Network/Bridged

Raymond Kroeker

Hi James, 

One thing I've noticed with my them machines is that on my host only networks the static IP is there and works (ie ssh and other services) *even though* ifconfig reports the dhcp address.  After restarting the interface it reports correctly as well.

Raymond

On May 25, 2013 9:10 AM, "James Jelinek" <[hidden email]> wrote:
Here is a very basic Vagrantfile that I'm using to boot a web and db server which I plan to setup nginx/rails and mysql.

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

Vagrant.configure("2") do |config|
config.vm.define :web do |web|
    web.vm.box = "web"
    web.vm.hostname = "web"
    web.vm.network :public_network, ip: "192.168.1.200"
  end

  config.vm.define :db do |db|
    db.vm.box = "precise32"
    db.vm.hostname = "db"
    db.vm.network :public_network, ip: "192.168.1.201"
  end
end


I want to assign a static IP to the interface instead of having dhclient pull one.  I've read the documentation and this seems to be the way to do it but each time I boot the VMs they grab an IP from the dhcp pool of my router instead of the IPs I've specified.

Am I doing something wrong here?


--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Static IP on Public Network/Bridged

Weidong Shao
I am running into  the same issue. Looks like Vagrant  assumes that a
bridge interface use DHCP. on my Ubuntu Guest, it appends  the
following block in /etc/network/interface

  auto eth2
  iface eth2 inet dhcp

I want to use static IP and could not figure out a way to do it under vagrant.
I hate to have to resort to VBoxManage to configure networking and
start/stop vm.

Is there any way to override vagrant's network config on bridge interface?


thanks,
Wei
On Sat, May 25, 2013 at 9:59 AM, Raymond Kroeker <[hidden email]> wrote:

> Hi James,
>
> One thing I've noticed with my them machines is that on my host only
> networks the static IP is there and works (ie ssh and other services) *even
> though* ifconfig reports the dhcp address.  After restarting the interface
> it reports correctly as well.
>
> Raymond
>
> On May 25, 2013 9:10 AM, "James Jelinek" <[hidden email]> wrote:
>>
>> Here is a very basic Vagrantfile that I'm using to boot a web and db
>> server which I plan to setup nginx/rails and mysql.
>>
>> # -*- mode: ruby -*-
>> # vi: set ft=ruby :
>>
>> Vagrant.configure("2") do |config|
>> config.vm.define :web do |web|
>>     web.vm.box = "web"
>>     web.vm.hostname = "web"
>>     web.vm.network :public_network, ip: "192.168.1.200"
>>   end
>>
>>   config.vm.define :db do |db|
>>     db.vm.box = "precise32"
>>     db.vm.hostname = "db"
>>     db.vm.network :public_network, ip: "192.168.1.201"
>>   end
>> end
>>
>>
>> I want to assign a static IP to the interface instead of having dhclient
>> pull one.  I've read the documentation and this seems to be the way to do it
>> but each time I boot the VMs they grab an IP from the dhcp pool of my router
>> instead of the IPs I've specified.
>>
>> Am I doing something wrong here?
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Vagrant" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [hidden email].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: Static IP on Public Network/Bridged

VMTrooper
It is not possible to assign a static IP for bridged\public interfaces in the Vagrantfile.  You can set the MAC address in the Vagrantfile and then set your hypervisor's dhcp server (or if you use a different dhcp server) to recognize that MAC address and assign a specific IP of your choosing.

I do not know how to do this for Virtualbox, but there are write-ups online if you search Google.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: Static IP on Public Network/Bridged

Carlos Encine
in my vagrantfile i use

config.vm.network "public_network", bridge: 'eth1', ip: "192.168.0.104"

to set static ip from my server

 

Em segunda-feira, 27 de maio de 2013 09h03min25s UTC-3, Trevor Roberts Jr escreveu:
It is not possible to assign a static IP for bridged\public interfaces in the Vagrantfile.  You can set the MAC address in the Vagrantfile and then set your hypervisor's dhcp server (or if you use a different dhcp server) to recognize that MAC address and assign a specific IP of your choosing.

I do not know how to do this for Virtualbox, but there are write-ups online if you search Google.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.