Skip to content

Commit

Permalink
Issue geerlingguy#649: Add docs on how to use vagrant-lxc
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyc committed Dec 31, 2016
1 parent 17a16c6 commit 38b42f6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/other/vagrant-lxc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[`vagrant-lxc` is a Vagrant plugin](https://github.com/fgrehm/vagrant-lxc) that provisions Linux Containers (LXC) rather than VM's such as VirtualBox or VMWare. Although LXC has much better performance, it only works on Linux hosts, and it isn't as well supported or tested by Drupal VM.

### Install dependencies

sudo apt-get install lxc bridge-utils
vagrant plugin install vagrant-lxc

### Load required kernel modules

As containers can't load modules, but inherit them from the host, you need to load these on your host machine.

sudo modprobe iptable_filter ip6table_filter ip_tables ip6_tables

To load these automatically when you boot up your system, you should check the guidelines of your specific distribution. Usually you add them to `/etc/modules` or `/etc/modules-load.d/*`

### Create a [`Vagrantfile.local`](overriding-configurations.md#extending-the-vagrantfile-with-vagrantfilelocal)

config.vm.networks[0][1][:lxc__bridge_name] = 'vlxcbr1'
config.vm.provider :lxc do |lxc|
lxc.customize 'cgroup.memory.limit_in_bytes', "#{vconfig['vagrant_memory']}M"
end

Read more about how to configure the container in [`vagrant-lxc`'s README.md](https://github.com/fgrehm/vagrant-lxc#readme).

### Modify your `config.yml`

The following boxes have been tested only minimally, choose which one you want.

# Centos 7
vagrant_box: frensjan/centos-7-64-lxc

# Ubuntu 16.04
vagrant_box: nhinds/xenial64

# Do not interact with the UFW service on Ubuntu.
drupalvm_disable_ufw_firewall: false

### Provision the Container

vagrant up --provider=lxc
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ pages:
- 'Linux Notes': 'other/linux.md'
- 'Windows Notes': 'other/windows.md'
- 'Vagrant and VirtualBox Tips': 'other/vagrant-virtualbox.md'
- 'Vagrant LXC provider': 'other/vagrant-lxc.md'

0 comments on commit 38b42f6

Please sign in to comment.