Roots Discourse

LXC/LXD as an alternative to Virtualbox for local development


#21

Strange.

Seems like a problem with paths.

Do you have apparmor installed?


#22

Yes this is strange, and no i have not installed apparmor. There isn’t any executable command file for lxc under /usr/bin/ either. And what is this!! linux mint site is also down no support nor forum :frowning:

I think i should try ubuntu 15.* for testing now. This is no good.


#23

Well for what it’s worth, Ubuntu is the reference platform because Canonical are driving the development of LXD. I’ve had no problems using this stuff at all.

I’m running 14.04 but will upgrade to 16.04 as soon as it’s out.

The officially supported ZFS in 16.04 is going to make LXD fly.


#24

hello again treb0r , I have Ubuntu 15.04 desktop version now. Unfortunately while trying to add remote images i get following error message.

lxc remote add images images.linuxcontainers.org

error: remote images exists as https://images.linuxcontainers.org:8443

What does it signify. I searched web for this issue but could not find proper answer. Could you please help me on that?
Thank you


#25

Looks like images is already configured. Try running:

lxc remote list

You should see something like:

+-----------------+-----------------------------------------+--------+ | NAME | URL | PUBLIC | +-----------------+-----------------------------------------+--------+ | images | https://images.linuxcontainers.org:8443 | YES | | local (default) | unix:// | NO | +-----------------+-----------------------------------------+--------+

In which case you’re good to go.


#26

Thanks treb0r.
Yup it is as you said they are already configured.
But strange thing is I checked it earlier and it was empty. Just before you replied i also added PPA repository which i thought was not necessary on 15.04 and I am pretty sure it was not the case for my error message.

Thank you once again.


#27

No problem. I personally prefer to stick with LTS releases and I think things will be smoother once 16.04 is out.

Let me know how you get on or if you need a hand with it.


#28

Just a quick heads up that LXD is now at version 2.0 and there have been some major changes to how networking is configured.

I’ll post details here and I’m planning to do another blog post soon.


#29

The authoritative guide to LXD networking in version 2.0, hot off the press:

I couldn’t get the setup wizard to work so I followed the instructions and edited the config file directly. Now it’s all working fine.


#30

hi there,

I have a Github issue on LXD "Synced Folders"

I am super interested in working through to some kind of working solution on this

for me there are two big LXD issues, networking and synced folders

I know both can be done, but I read many options

perhaps an Ansible role or two would work well for this as it seems out of scope for LXD according to LXD maintainers


#31

added another question / issue to the LXD networking blog


#32

I don’t see an issue with either of these.

Synced folders do require global write permissions on the host system, which is obviously not ideal, but apart from that it all seems to work fine.

LXD networking has been in a state of flux and last week they moved away from LXC networking entirely as described in that blog post.

After having a few problems with the setup process I just edited the config file directly and now it’s all working nicely.

The vision is to get this working properly with Vagrant and then packaged as a proper alternative to Virtualbox for Trellis. This has been difficult because LXD itself has been a moving target recently, particularly the networking stuff.

I’m hoping things will settle down a bit with the release of 16.04.


#33

I got synced folders working with the following script.

It sets up subuid/gid map for your uid, and then creates a custom profile for you user that you can use with lxc launch.

Seems to work well for me, and is very flexible.


#34

That looks way cool.

I’ll give it a go, thanks!


#35

Do I need to pass anything in to lxc launch to get this to work?


#36

I am new to this community. I am very excited about the roots ecosystem, but while going through the Trellis tutorial, I fell down on the Vagrant / Virtualbox set up. It turns out that my laptop, running Ubuntu Trusty, would not run a Virtualbox VM because its hardware doesn’t support it. Then I stumbled across your post and started learning about LXC/LXD. It works just fine on my laptop.

While researching, I discovered that there is a custom Vagrant provider plug-in for LXC https://github.com/fgrehm/vagrant-lxc. I haven’t tried it yet, I am still in LXC/LXD learning mode (and I want to get through your tutorial on the manual setup) as well. I don’t know if you have tried this yet. I intend to, after I gain some familiarity with the toolset and configuration. I did want to let you know about this.


#37

Hey @chipk great to hear you have LXD working!

I have seen the Vagrant provider plugin for LXC but unfortunately it won’t work with LXD (as far as I can tell anyway).

I owe the roots guys another blog post about this stuff, this time about using Vagrant with LXD but have struggled to find enough documentation to get it working properly.

Having said that, I have been making progress and have been in touch with Canonical about a couple of issues. A few tips for getting up and running manually without Vagrant:

That gist from @bloodearnest above will allow you to mount a shared directory without the need to make the target directory world writable.

Also, before provisioning your dev environment, check out this thread:

…and make sure to add back those sudoer password definitions.

Let me know if you need a hand.


#38

Wow! The learning curve on LXC/LXD has been circuitous, and required me to get my head around a lot of concepts. I am beginning to see daylight, though. Anyway, I just wanted to let you know I saw your response and thank you for your guidance and offer of assistance. I will update you when I get to the point of having Trellis working, and I definitely will take you up on your offer of help if I get stuck.


#39

This is some great info. I’m just getting to the point where I am doing enough small WordPress sites for customers that I need a more streamlined solution than what I have been doing, which is creating individual KVM instances for each site based on a few default instances I have already created. VVV sounds great but I hate having to switch to Virtual Box and don’t have time at the moment to figure out if I can make it work with KVM. Have you made any further progress on getting LXD and Vagrant working together?


#40

Unfortunately not.

I’ve found that just working with the LXC/LXD tools in combination with trellis gives great results. I just setup the .dev domains in my local /etc/hosts file and handle everything manually. I like the control that gives and don’t really feel the need for Vagrant anymore.