Proxmox
docker

Proxmox

Some tweaks for Proxmox

Tailscale on LXC

Allow tailscale on LXC

You need to edit the container in the PVE shell and add the following lines to the config file:

lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file

Installing Tailscale on LXC

You can install Tailscale by running the following commands:

curl -fsSL https://tailscale.com/install.sh | sh

Building custom LXC images

You can build custom LXC images by creating a clean LXC from a template. Customize it to your needs and follow the steps below to create a new image:

Create a new image

Deploy a template and configure the template to your liking.

Clean up and prepare the image

  • apt clean
  • rm -rf /var/cache/apt/archives /var/cache/apt/lists/*
  • rm /etc/ssh/ssh_host_*
  • shutdown now

Now make a backup of the LXC

Store the backup in a safe location and use it as a template for future LXC containers.

In my case I need to follow these steps to provide a custom LXC image for my clients.

  • Go to /mnt/pve/local-nas/caches and find the backup file
  • Transfer it to the templates folder: cp file_name.tar.gs ./templates/cache/ubuntu_docker_xxx.tar.gs
  • And now the LXC should be in the templates folder if the naming is correct.