vagrant-landrush / landrush

A Vagrant plugin that provides a simple DNS server for Vagrant guests
MIT License
668 stars 78 forks source link

Vagrant::LXC::Provider support #23

Open vovimayhem opened 10 years ago

vovimayhem commented 10 years ago

Any info on what is required to make this work? I'm available and highly interested :)

phinze commented 10 years ago

Hi! I'm not familiar with networking on LXC. Essentially we are running a tiny DNS proxy on the host, and redirecting DNS traffic from the guest through that proxy. So that's the broad strokes.

We're currently using iptables to inject rules that redirect DNS traffic - do LXC containers use iptables or have an equivalent packet filter system?

borgand commented 9 years ago

Regarding iptables I'm getting this error (though, admittedly I run very stripped down Gentoo Linux in the container and that might affect something):

Vagrant attempted to execute the capability 'iptables_installed'
on the detect guest OS 'gentoo', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

But even on Parallels/VirtualBox VM-s I have always had this setting off as I don't need it, which seems to avoid above error message:

config.landrush.guest_redirect_dns = false

But, then running vagrant up, Landrush does not seem to do anything:

==> default: Machine booted and ready!
 INFO warden: Calling IN action: #<Landrush::Action::InstallPrerequisites:0x00000002847748>
 INFO warden: Calling IN action: #<Landrush::Action::RedirectDns:0x000000028476f8>
 INFO warden: Calling IN action: #<Proc:0x00000002847680@/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:94 (lambda)>
 INFO warden: Calling OUT action: #<Proc:0x00000002847680@/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:94 (lambda)>
 INFO warden: Calling OUT action: #<Landrush::Action::RedirectDns:0x000000028476f8>
 INFO warden: Calling OUT action: #<Landrush::Action::InstallPrerequisites:0x00000002847748>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::WaitForCommunicator:0x000000028477c0>
 INFO warden: Calling OUT action: #<Vagrant::LXC::Action::Boot:0x00000002847810>
 INFO warden: Calling OUT action: #<Vagrant::LXC::Action::PrivateNetworks:0x00000002847860>
 INFO warden: Calling OUT action: #<Vagrant::LXC::Action::ForwardPorts:0x0000000281a9a0>
 INFO warden: Calling OUT action: #<Vagrant::LXC::Action::WarnNetworks:0x0000000281a9f0>
 INFO interface: info: Setting hostname...
 INFO interface: info: ==> default: Setting hostname...
==> default: Setting hostname...

It does not start it's daemon and does not list any dependent VM-s.

I have very simple Vagrantfile with Gentoo Linux box:

Vagrant.configure(2) do |config|
  config.vm.box = "gentoo-box"
  config.vm.hostname = "test1.vm"
  config.landrush.enable
  config.landrush.guest_redirect_dns = false
  config.landrush.tld = 'vm'
end

Versions:

Can I provide any more information or help to support LXC containers?

kingcrunch commented 8 years ago

I just want to bump this one ... Sorry

I cannot provide additional information right now, but I'd really like to use this plugin with lxc like I use it with virtualbox.