fgrehm/vagrant-lxc

vagrant-lxc fails with lxc 2.0

Closed this issue · 5 comments

I'm running on an Archlinux distribution with the latest version of LXC (lxc 2.0.0-1).

This version of lxc causes an error so it seems

There was an error executing ["sudo", "/usr/bin/env", "lxc-create", "-B", "best", "--template", "/home/jan/.vagrant.d/gems/gems/vagrant-lxc-1.2.1/scripts/lxc-template", "--name", "downloads_default_1460450736002_2008", "--", "--tarball", "/home/jan/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-precise64-lxc/1.2.0/lxc/rootfs.tar.gz", "--config", "/home/jan/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-precise64-lxc/1.2.0/lxc/lxc-config"]

When downgrading lxc to version 1.1.5-4 it works fine again.

This is a problem because lxc 2.0 seems to have remove the backingstore option 'best'.
You can have it working with lxc2.0 by adding in vagrant provider block a specific backingstore like dir :

config.vm.provider :lxc do |lxc,ovrd|
    ovrd.vm.box = 'fgrehm/trusty64-lxc'
    lxc.backingstore = 'dir'
    lxc.customize 'cgroup.memory.limit_in_bytes', '512M'
    lxc.customize 'aa_allow_incomplete', 1
    lxc.container_name = project
    ovrd.vm.synced_folder *share
end

@megheaiulian This seems to work fine. :)

Do you know if there's any downside of using that option with LXC 1.1.5 as well?

@Restless-ET I think dir is the default one even when best is used. There should be no problem with lxc 1.1.5.

@megheaiulian It does seem to be that way (I've tried it on LXC 1.1.5).
It's the default of LXC itself at least: https://help.ubuntu.com/14.04/serverguide/lxc.html#lxc-backinstores

Thanks for you feedback. 😄

This indeed did the trick for both versions 2.0.0 and 1.1.5, many thanks for solving this one!