lxc-update-template
- vim /etc/cron.daily/lxc-update-template
- chmod +x /etc/cron.daily/lxc-update-template
#!/bin/bash
# =============================================================================
# Script Name: update_lxc_template.sh
# Version: 1.0
# Description: Starts the 'template' LXC container, performs an update &
# upgrade inside it, and shuts it back down after.
# =============================================================================
CONTAINER="template"
echo "[DEBUG] Starting $CONTAINER..."
lxc-start -n "$CONTAINER"incus setup
Install Necessary Packages on Both Nodes
Begin by installing Incus and its associated tools on both node1 and node2.
- apt update sudo apt install incus incus-tools
The
incus-toolspackage includes utilities likelxc-to-incus, which facilitates the migration of LXC containers to Incus.
incus
1. Listing Available Images To view available Debian images:
- incus image list images: debian
2. Launching a New Container To create and start a new container named debian13-container on the 16C32T node:
LXC
- https://wiki.debian.org/LXC
- ai lxc bridge-utils dnsmasq
- sc-status lxc lxcfs lxc-net
- LXCHOSTNAME=template
- export MIRROR=http://ftp.de.debian.org/debian
- lxc-create -n $LXCHOSTNAME -t debian -- -r bookworm
- lxc-start -n $LXCHOSTNAME
- lxc-ls -f
- lxc-info -n $LXCHOSTNAME -l DEBUG
- t /var/log/lxc/$LXCHOSTNAME.log
- lxc-attach -n $LXCHOSTNAME adduser DEINUSER
- lxc-attach -n $LXCHOSTNAME adduser DEI
lxc_list_login.sh
#!/bin/bash
# =============================================================================
# Script Name: lxc_list_login.sh
# Version: 03
# Description: Lists LXC containers, checks their statuses, and allows login.
# =============================================================================
# Required commands
REQUIRED_CMDS=("lxc-ls" "lxc-info" "lxc-start" "lxc-attach")
# Check if required commands are available
for CMD in "${REQUIRED_CMDS[@]}"; do
if ! command -v "$CMD" &> /dev/null; then
echo "The command $CMD is not installed.lxc_snapshot_create.sh
#!/bin/bash
# v01
# List and check LXC containers
echo "Listing all LXC containers..."
CONTAINERS=($(lxc-ls -1))
# Check if there are any containers
if [[ ${#CONTAINERS[@]} -eq 0 ]]; then
echo "There are no LXC containers."
exit 1
fi
echo "Found ${#CONTAINERS[@]} container(s): ${CONTAINERS[@]}"
echo "----------------------------------"
# Loop over each container
for LXCHOSTNAME in "${CONTAINERS[@]}"; do
echo "Processing container: $LXCHOSTNAME"
# Stop the container
echo "Stopping container $LXCHOSTNAME..."
if !lxc_create_container.sh
#!/bin/bash
# =============================================================================
# Script Name: lxc_create_container.sh
# Version: 1.1
# Description: This script creates a new LXC container from a template, assigns
# a unique MAC address, updates the hostname and /etc/hosts file,
# and verifies internet access.
# =============================================================================
# Prompt for the new container hostname
read -e -p "LXCHOSTNAME: " LXCHOSTNAME
export LXCHOSTNAME
# Check if the template containelxc_list_sed.sh
#!/bin/bash
# =============================================================================
# Script Name: lxc_list_sed.sh
# Version: 1.10
# Description: This script lists all LXC containers, checks their statuses, and
# updates the SENDMAILTO field in /etc/logcheck/logcheck.conf for
# running containers.lxc_package_install.sh
#!/bin/bash
# =============================================================================
# Script Name: lxc_package_install.sh
# Version: 1.1
# Author: Andreas Fleckl
# Description: This script installs a specified package in all running LXC
# containers.lxc debug
e2scrub_all.service
Online ext4 Metadata Check for All Filesystems was skipped because of an unmet condition check (ConditionCapability=CAP_SYS_RAWIO)
https://linux.debian.bugs.dist.narkive.com/950nrKYJ/bug-926138-e2scrub-reap-service-fails-in-lxc