diff options
author | luxagraf <sng@luxagraf.net> | 2019-04-08 13:46:39 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2019-04-08 13:46:39 -0500 |
commit | 41d5367448cd69158a61cf4e022baf803b157af7 (patch) | |
tree | fd1e067ece7a8467cfaffe2b0d90ba9e58f2033e /switching-to-lxc-lxd-for-django-dev-work-cuts.txt | |
parent | 0d42f78479c79dd4b425411f08f83a2864938c16 (diff) |
added src articles
Diffstat (limited to 'switching-to-lxc-lxd-for-django-dev-work-cuts.txt')
-rw-r--r-- | switching-to-lxc-lxd-for-django-dev-work-cuts.txt | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/switching-to-lxc-lxd-for-django-dev-work-cuts.txt b/switching-to-lxc-lxd-for-django-dev-work-cuts.txt new file mode 100644 index 0000000..5f128fe --- /dev/null +++ b/switching-to-lxc-lxd-for-django-dev-work-cuts.txt @@ -0,0 +1,42 @@ + +Error: Failed to run: /usr/bin/lxd forkstart debian /var/lib/lxd/containers /var/log/lxd/debian/lxc.conf: +Try `lxc info --show-log local:debian` for more info +Hmmm. Nothing like a error right after init. Okay so run that suggested command: + +~~~~console +lxc info --show-log local:debian +If this is your first time running LXD on this machine, you should also run: lxd init +To start your first container, try: lxc launch ubuntu:18.04 + +Error: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: permission denied +~~~~ + +I after a bit of searching I figured out the permissions problem has to do with privileged vs unprivileged containers. I skipped a part in the initial setup on Arch. Out of the box on Arch you'll need to jump through a few extra hoops to run unprivileged containers, which seem odd and even backward to me because as I understand it that exactly what you want to run. For now I have skipped those extra steps until I better understand them. In the mean time I used the workaround suggested in the Arch wiki, which is to append `-c security.privileged=true` to the end of the `launch` command we used a minute ago. However, I believe this defeats one of the major security benefits of containers, by, uh, containing things. So I wouldn + +~~~~console +sudo lxc launch images:debian/stretch/amd64 debian -c security.privileged=true +Error: Failed container creation: Create container: Add container info to the database: This container already exists +~~~~ + +Okay, so even though we couldn't connect in our previous effort, we did create a container with that name so we need to get rid of it first. Let's see what we have. + +~~~~console +sudo lxc list ++--------+---------+------+------+------------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++--------+---------+------+------+------------+-----------+ +| debian | STOPPED | | | PERSISTENT | | ++--------+---------+------+------+------------+-----------+ +~~~~ + +Yup, there's our debian container. Now the question is how do delete a container using the `lxc` command? Curiously, the command `lxc-delete`, which you'll discover if you type `man lxc` errored out for me. After a bit of searching I found the LXD equivelant is `lxc delete`: + +~~~~console +sudo lxc delete debian +~~~~ + +Okay, not back to our create command: + +~~~~console +sudo lxc launch images:debian/stretch/amd64 debian -c security.privileged=true +~~~~ |