LXC unprivileged containers require these steps for snapd (required by certbot) #4539

Closed
opened 2025-12-29 18:37:04 +01:00 by adam · 3 comments
Owner

Originally created by @lewisbergman on GitHub (Feb 7, 2021).

Change Type

[ X ] Addition
[ ] Correction
[ ] Deprecation
[ ] Cleanup (formatting, typos, etc.)

Area

[ X ] Installation instructions
[ ] Configuration parameters
[ ] Functionality/features
[ ] REST API
[ ] Administration/development
[ ] Other

Proposed Changes

On the HTTP server step, Obtain an SSL Certificate.
Certbot now requires snapd as step 2 of it's install. Snapd requires a privileged environment to mount a files system. If you have installed netbox in an unprivileged environment this will run into issues with snapd and it will install but not run. I found the post here extremely helpful in resolving the issue. Maybe worth a reference. My install was in a Proxmox unprivileged LXC container. When you set up an LXC container in Proxmox one of the settings you cannot change later is privilege.
It might be worth mentioning in the beginning (not that certbot installs issues are your problem) that you either need to set up a privileged container (likely only available if you own the cluster, which you might if you are installing netbox) or get ready to follow the instructions listed on the post.
The steps required to get it running boil down to:

  1. Add the following on the host for the container in /etc/pve/lxc/<container ID>
# Mounting fuse (for snap squashfs)
lxc.mount.entry = /dev/fuse dev/fuse none bind,create=file,optional
# Mount cgroup in rw to get snaps working
lxc.mount.auto=cgroup:rw
  1. Restart the container
  2. sudo mkdir /lib/modules <== I can't verify I needed this step but it was harmless so I did it anyway.
  3. sudo apt install squashfuse fuse
    sudo apt install snapd
    Now you can continue installing certbot as instructed.
    The issues I experienced when installing netbox, other than the inability to read what the doc said and general stupidity, were all certbot related. This is all based on the latest releases as of 02/06/2021.

I would guess you could avoid the whole snapd thing by using one of the package managers but I didn't know if that would get the latest certbot.

Originally created by @lewisbergman on GitHub (Feb 7, 2021). ### Change Type [ X ] Addition [ ] Correction [ ] Deprecation [ ] Cleanup (formatting, typos, etc.) ### Area [ X ] Installation instructions [ ] Configuration parameters [ ] Functionality/features [ ] REST API [ ] Administration/development [ ] Other <!-- Describe the proposed change(s). --> ### Proposed Changes On the HTTP server step, Obtain an SSL Certificate. Certbot now requires snapd as step 2 of it's install. Snapd requires a privileged environment to mount a files system. If you have installed netbox in an unprivileged environment this will run into issues with snapd and it will install but not run. I found the post [here](https://github.com/lxc/lxc/issues/1854) extremely helpful in resolving the issue. Maybe worth a reference. My install was in a Proxmox unprivileged LXC container. When you set up an LXC container in Proxmox one of the settings you cannot change later is privilege. It might be worth mentioning in the beginning (not that certbot installs issues are your problem) that you either need to set up a privileged container (likely only available if you own the cluster, which you might if you are installing netbox) or get ready to follow the instructions listed on the post. The steps required to get it running boil down to: 1. Add the following on the host for the container in `/etc/pve/lxc/<container ID>` ``` # Mounting fuse (for snap squashfs) lxc.mount.entry = /dev/fuse dev/fuse none bind,create=file,optional # Mount cgroup in rw to get snaps working lxc.mount.auto=cgroup:rw ``` 2. Restart the container 3. `sudo mkdir /lib/modules` <== I can't verify I needed this step but it was harmless so I did it anyway. 4. `sudo apt install squashfuse fuse` `sudo apt install snapd` Now you can continue installing certbot as instructed. The issues I experienced when installing netbox, other than the inability to read what the doc said and general stupidity, were all certbot related. This is all based on the latest releases as of 02/06/2021. I would guess you could avoid the whole snapd thing by using one of the package managers but I didn't know if that would get the latest certbot.
adam closed this issue 2025-12-29 18:37:05 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 8, 2021):

The official documentation does not involve or support containers. Maybe you want the netbox-docker project?

@jeremystretch commented on GitHub (Feb 8, 2021): The official documentation does not involve or support containers. Maybe you want the [netbox-docker project](https://github.com/netbox-community/netbox-docker)?
Author
Owner

@lewisbergman commented on GitHub (Feb 8, 2021):

Maybe.
I understand you can't account for every permutation that some edge case
might use. I guess what I am saying is even just a mention of containers,
the Docker project, and a link to a page with information on what you can
expect and maybe pointing out some experiences you have become aware of.

Docker isn't a great choice for me. I use Proxmox clusters which have had
varying success with Docker even though Docker is LXC based there evidently
enough differences to make it troublesome to run Docker in an LXC.

Finding your program wasn't all that easy and no google search I used
turned up the Docker project. I probably missed it but maybe you referred
to Docker in the docs somewhere.

At any rate, thanks for the great program!

On Mon, Feb 8, 2021 at 9:29 AM Jeremy Stretch notifications@github.com
wrote:

The official documentation does not involve or support containers. Maybe
you want the netbox-docker project
https://github.com/netbox-community/netbox-docker?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/netbox-community/netbox/issues/5762#issuecomment-775229446,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ASYATWLBR7EMIFS6ONUGEO3S577NXANCNFSM4XHWH63A
.

--
Lewis Bergman
325-439-0533 Cell

@lewisbergman commented on GitHub (Feb 8, 2021): Maybe. I understand you can't account for every permutation that some edge case might use. I guess what I am saying is even just a mention of containers, the Docker project, and a link to a page with information on what you can expect and maybe pointing out some experiences you have become aware of. Docker isn't a great choice for me. I use Proxmox clusters which have had varying success with Docker even though Docker is LXC based there evidently enough differences to make it troublesome to run Docker in an LXC. Finding your program wasn't all that easy and no google search I used turned up the Docker project. I probably missed it but maybe you referred to Docker in the docs somewhere. At any rate, thanks for the great program! On Mon, Feb 8, 2021 at 9:29 AM Jeremy Stretch <notifications@github.com> wrote: > The official documentation does not involve or support containers. Maybe > you want the netbox-docker project > <https://github.com/netbox-community/netbox-docker>? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/netbox-community/netbox/issues/5762#issuecomment-775229446>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ASYATWLBR7EMIFS6ONUGEO3S577NXANCNFSM4XHWH63A> > . > -- Lewis Bergman 325-439-0533 Cell
Author
Owner

@jeremystretch commented on GitHub (Feb 8, 2021):

The scope of the installation documentation is necessarily strictly limited, as every line of it needs to be maintained and tested with new releases. Anything pertaining to containers would unfortunately be out of scope.

@jeremystretch commented on GitHub (Feb 8, 2021): The scope of the installation documentation is necessarily strictly limited, as every line of it needs to be maintained and tested with new releases. Anything pertaining to containers would unfortunately be out of scope.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4539