From b48609ab839e92db476927ea4649b9f6061af03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Fri, 30 Dec 2016 23:44:14 -0500 Subject: [PATCH] Issue #649: Add docs on how to use vagrant-lxc [ci skip] --- docs/other/vagrant-lxc.md | 41 +++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 42 insertions(+) create mode 100644 docs/other/vagrant-lxc.md diff --git a/docs/other/vagrant-lxc.md b/docs/other/vagrant-lxc.md new file mode 100644 index 000000000..79279ad21 --- /dev/null +++ b/docs/other/vagrant-lxc.md @@ -0,0 +1,41 @@ +[`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 + sudo modprobe ip6table_filter + +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 diff --git a/mkdocs.yml b/mkdocs.yml index 2169c2271..88488048c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -64,6 +64,7 @@ pages: - Other Information: - 'Networking Notes': 'other/networking.md' - 'Vagrant and VirtualBox': 'other/vagrant-virtualbox.md' + - 'Vagrant LXC provider': 'other/vagrant-lxc.md' - 'Improving Performance': 'other/performance.md' - 'BigPipe with Drupal VM': 'other/bigpipe.md' - 'Drupal multisite': 'deployment/multisite.md'