Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 5c71fd2

Browse files
authored
Merge pull request #1094 from oxyc/lxc
Issue #649: Add docs on how to use vagrant-lxc
2 parents 3566b31 + b48609a commit 5c71fd2

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

docs/other/vagrant-lxc.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[`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.
2+
3+
### Install dependencies
4+
5+
sudo apt-get install lxc bridge-utils
6+
vagrant plugin install vagrant-lxc
7+
8+
### Load required kernel modules
9+
10+
As containers can't load modules, but inherit them from the host, you need to load these on your host machine.
11+
12+
sudo modprobe iptable_filter
13+
sudo modprobe ip6table_filter
14+
15+
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/*`
16+
17+
### Create a [`Vagrantfile.local`](overriding-configurations.md#extending-the-vagrantfile-with-vagrantfilelocal)
18+
19+
config.vm.networks[0][1][:lxc__bridge_name] = 'vlxcbr1'
20+
config.vm.provider :lxc do |lxc|
21+
lxc.customize 'cgroup.memory.limit_in_bytes', "#{vconfig['vagrant_memory']}M"
22+
end
23+
24+
Read more about how to configure the container in [`vagrant-lxc`'s README.md](https://github.com/fgrehm/vagrant-lxc#readme).
25+
26+
### Modify your `config.yml`
27+
28+
The following boxes have been tested only minimally, choose which one you want.
29+
30+
# Centos 7
31+
vagrant_box: frensjan/centos-7-64-lxc
32+
33+
# Ubuntu 16.04
34+
vagrant_box: nhinds/xenial64
35+
36+
# Do not interact with the UFW service on Ubuntu.
37+
drupalvm_disable_ufw_firewall: false
38+
39+
### Provision the Container
40+
41+
vagrant up --provider=lxc

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pages:
6464
- Other Information:
6565
- 'Networking Notes': 'other/networking.md'
6666
- 'Vagrant and VirtualBox': 'other/vagrant-virtualbox.md'
67+
- 'Vagrant LXC provider': 'other/vagrant-lxc.md'
6768
- 'Improving Performance': 'other/performance.md'
6869
- 'BigPipe with Drupal VM': 'other/bigpipe.md'
6970
- 'Drupal multisite': 'deployment/multisite.md'

0 commit comments

Comments
 (0)