summaryrefslogtreecommitdiff
path: root/src/published
diff options
context:
space:
mode:
Diffstat (limited to 'src/published')
-rw-r--r--src/published/2019-04-07_why-and-how-ditch-vagrant-for-lxd.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/published/2019-04-07_why-and-how-ditch-vagrant-for-lxd.txt b/src/published/2019-04-07_why-and-how-ditch-vagrant-for-lxd.txt
index 837af2b..e83d8e3 100644
--- a/src/published/2019-04-07_why-and-how-ditch-vagrant-for-lxd.txt
+++ b/src/published/2019-04-07_why-and-how-ditch-vagrant-for-lxd.txt
@@ -1,3 +1,5 @@
+* **Updated July 2022**: This was getting a bit out of date in some places so I've fixed a few things. More importantly, I've run into to some issues with cgroups and lxc on Arch and added some notes below under the [special note to Arch users](#arch)*
+
I've used Vagrant to manage my local development environment for quite some time. The developers I used to work with used it and, while I have no particular love for it, it works well enough. Eventually I got comfortable enough with Vagrant that I started using it in my own projects. I even wrote about [setting up a custom Debian 9 Vagrant box](/src/create-custom-debian-9-vagrant-box) to mirror the server running this site.
The problem with Vagrant is that I have to run a huge memory-hungry virtual machine when all I really want to do is run Django's built-in dev server.
@@ -96,10 +98,25 @@ The last step in our setup is to add our user to the lxd group. By default LXD r
sudo usermod -a -G lxd yourusername
~~~~
-#####Special note for Arch users.
+#####Special note for Arch users. {:#arch }
To run unprivileged containers as your own user, you'll need to jump through a couple extra hoops. As usual, the [Arch User Wiki](https://wiki.archlinux.org/index.php/Linux_Containers#Enable_support_to_run_unprivileged_containers_(optional)) has you covered. Read through and follow those instructions and then reboot and everything below should work as you'd expect.
+Or at least it did until about June of 2022 when something changed with cgroups and I stopped being able to run my lxc containers. I kept getting errors like:
+
+~~~~console
+Failed to create cgroup at_mnt 24()
+lxc debian-base 20220713145726.259 ERROR conf - ../src/lxc/conf.c:lxc_mount_auto_mounts:851 - No such file or directory - Failed to mount "/sys/fs/cgroup"
+~~~~
+
+I tried debugging, and reading through all the bug reports I could find over the course of a couple of days and got nowhere. No one else seems to have this problem. I gave up and decided I'd skip virtualization and develop directly on Arch. I installed PostgreSQL... and it wouldn't start, also throwing an error about cgroups. That is when I dug deeper into cgroups and found a way to revert to the older behavior. I added this line to my boot params (in my case that's in /boot/loader/entries/arch.conf):
+
+~~~~console
+systemd.unified_cgroup_hierarchy=0
+~~~~
+
+That fixed all the issues for me. If anyone can explain *why* I'd be interested to hear from you in the comments.
+
### Create Your First LXC Container
Let's create our first container. This website runs on a Debian VM currently hosted on Vultr.com so I'm going to spin up a Debian container to mirror this environment for local development and testing.