I did a quick test running vagrant with the lxc provider inside Ubuntu
14.10 in a Parallels VM on my Mac -- it works!
(Didn't yet try re-exporting the /vagrant dirs to the host Mac OS X system
but it should be doable using standard sharing tools.)
Downside currently is that it doesn't seem to support *transparently* using
a VM as the container host the way the Vagrant Docker provider claims to --
it looks like you have to install and use the Vagrant CLI tools within the
VM.
But, it has the plus that you can use a stock VM if you're going to run
Linux anyway. This is a plus for me as I use VMs for a lot of testing and
prefer Parallels for its much better/faster graphics support. (I had been
making do with VMWare Fusion and the for-pay VMWare provider plugin for
Vagrant, but VMWare's drivers are a lot slower.)
Note that LXC doesn't require enabling nested virtualization or anything
super-scary like that, so it ought to work in any VM host.
Notes:
* install Ubuntu 14.04 Trusty in a Parallels VM
** disabled various Parallels sharing options to make sure it's not hogging
my home dir
** kicked RAM from default 1gb to 2gb for headroom
* install vagrant 1.7.2 (current) from
vagrantup.com
* $ vagrant plugin install vagrant-lxc
* $ vagrant up --provider=lxc
** NFS failed?
* did the apparmor config thing from the readme
https://phabricator.wikimedia.org/diffusion/MWVA/browse/master/support/READ…
* $ vagrant destroy
* $ vagrant up --provider=lxc
-- brion
On Tue, Mar 3, 2015 at 1:00 PM, Bryan Davis <bd808(a)wikimedia.org> wrote:
On Tue, Mar 3, 2015 at 1:43 PM, Brion Vibber
<bvibber(a)wikimedia.org>
wrote:
Awesome!
Is it possible to use a Linux VM as the actual LXC container on a Mac or
Windows host system, as with Vagrant's Docker provider?
This could allow consolidating multiple Vagrant instances on one VM, or
sharing a VM between Vagrant and a Linux GUI used for testing or
specialty
apps.
Well, to half-answer my question:
https://taoofmac.com/space/HOWTO/Vagrant
indicates it's at least possible, though it
doesn't seem to be as
conveniently packaged up as Boot2Docker yet. :)
I started playing with a setup based on that Tao of Mac post on Sunday
but I didn't get to the point of having a fully working solution yet.
With a little more experimentation I hope to have a Vagrantfile and
base box that you could drop in $HOME or a similar common directory
that boots a Linux VM that is all setup to run vagrant-lxc inside it.
In the short term I'll probably focus more on the labs-vagrant
replacement use case in my spare time however so feel free to beat me
to the more general solution. :)
Bryan
--
Bryan Davis Wikimedia Foundation <bd808(a)wikimedia.org>
[[m:User:BDavis_(WMF)]] Sr Software Engineer Boise, ID USA
irc: bd808 v:415.839.6885 x6855
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l