diff options
author | luxagraf <sng@luxagraf.net> | 2022-08-15 08:11:28 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2022-08-15 08:11:28 -0500 |
commit | de497732a72d2fa299f7bcb3ad4d55f061d87bb1 (patch) | |
tree | 03ffd2343a8d39d7d1eda52f15601fa1f58a65f9 /src/published | |
parent | 7e97a19912bafd8bd87142c92cf31a72d38cda95 (diff) |
jrnl: added latest scratches
Diffstat (limited to 'src/published')
-rw-r--r-- | src/published/2019-04-07_why-and-how-ditch-vagrant-for-lxd.txt | 19 |
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. |