Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Ensure the lxc templates are executable prior to lxc-create #128

Closed
smaftoul opened this issue Aug 6, 2013 · 1 comment
Closed

Ensure the lxc templates are executable prior to lxc-create #128

smaftoul opened this issue Aug 6, 2013 · 1 comment

Comments

@smaftoul
Copy link

smaftoul commented Aug 6, 2013

While creating my own vagrant-lxc box, I ran VAGRANT_LOG=DEBUG vagrant up --provider lxc and noticed the following in the log:

INFO subprocess: Starting process: ["/usr/bin/sudo", "cp", "/root/.vagrant.d/boxes/vagrant-lxc-lucid-i386-base.test/lxc/lxc-template", "/usr/share/lxc/templates/lxc-vagrant-tmp-root_default-1375807729"]

Later the command failed to run with:

here was an error executing ["sudo", "lxc-create", "--template", "vagrant-tmp-root_default-1375807729", "--name", "root_default-1375807729", "-f", "/root/.vagrant.d/boxes/vagrant-lxc-lucid-i386-base.test/lxc/lxc.conf", "--", "--tarball", "/root/.vagrant.d/boxes/vagrant-lxc-lucid-i386-base.test/lxc/rootfs.tar.gz", "--auth-key", "/opt/vagrant/embedded/gems/gems/vagrant-1.2.7/keys/vagrant.pub"]

I managed to solve the problem with a missing chmod +x lxc-template, but I think we don't need to copy the template in /usr/share/lxc/templates.

As stated in lxc-create manpage in the "-t" section:
Alternatively, the full path to an executable template script can also be passed as a parameter.

Is this right ? Can we make lxc-create work without copying the template ?

@fgrehm
Copy link
Owner

fgrehm commented Aug 7, 2013

@smaftoul the problem is that it won't work under Ubuntu 12.04 / 12.10 as "their lxc"s do not support the full path to the template, only on 13.04 =/
I think we can just make sure that we run a chmod +x after copying the template and prior to lxc-create, I've maked this issue as an Enhancement and updated the title to reflect that :)

@fgrehm fgrehm closed this as completed in d02a9d5 Sep 27, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants