Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.
boltronics edited this page Sep 20, 2017 · 10 revisions

Help, my shared folders have the wrong owner!

The base boxes use UID 1000 for the vagrant user. So if your UID on the host box is something other than 1000, shared folders will be owned by something other than the vagrant user.

You can work around this problem via judicious chown'ing, or by using rsync or NFS shared folders instead.

See GH-191 for additional information.

How can I store container's rootfs on a separate partition?

Before the 0.3.0 version of this plugin, there used to be a support for specifying the container's rootfs path from the Vagrantfile, on 0.3.0 this was removed as you can achieve the same effect by symlinking or mounting /var/lib/lxc on a separate partition.

Does NFS synced folders work?

NFS synced folders work since v1.0.0.alpha.1. See GH-191 for additional information. You may need to modify /etc/apparmor.d/lxc/lxc-default to allow NFS access from your LXC container.

How can I set a static IP for the container?

At some point Vagrant's network configurations will be supported, for now you can use the provider block like:

Vagrant.configure("2") do |config|
  config.vm.box = "quantal64"
  config.vm.provider :lxc do |lxc|
    lxc.customize 'network.ipv4', '10.0.3.15/24'
  end
end

Please keep in mind that it won't work for any IP you pass in, please check this issue for more information.

How can I build a base box / container?

See the Base boxes page of this wiki.

Why do I get Could not chdir to home directory /home/vagrant: Permission denied when vagrant-lxc attempts to SSH into the guest?

Make sure the user you are running the vagrant command as has the ability to access the guest vagrant directory directly (ie. on the host, not the guest). Depending on the host distribution, this might be on a path like /var/lib/lxc/<some guest>/rootfs/home/vagrant. If the umask permissions are too tight, you might find the <some guest>/rootfs directory permissions are too tight.