Benutzer-Werkzeuge

Webseiten-Werkzeuge


lxc

Inhaltsverzeichnis

Linux Container (LXC) ist ein Verfahren zur Virtualisierung auf Betriebssystemebene, das mehrere voneinander isoliert laufende Linux Systeme auf einem einzigen Host ermöglicht.

Siehe auch Docker.

# Installation
sudo apt install lxc

# Interactive
sudo lxc-create -t download -n my-ubuntu-template --
# One Liner
sudo lxc-create -t download -n my-ubuntu-template -- --dist ubuntu --release focal --arch amd64

# Wird der GPG Key nicht gefunden
sudo lxc-create -t download -n my-ubuntu-template -- --dist ubuntu --release focal --arch amd64 --no-validate

# Liste Container
sudo lxc-ls --fancy

# Starte Container
lxc-start --name my-ubuntu-template

# Zeige Infos
sudo lxc-info --name my-ubuntu-template

# Auf Container verbinden
sudo lxc-attach --name my-ubuntu-template

# Container stoppen
sudo lxc-stop --name my-ubuntu-template

# Container löschen
sudo lxc-destroy --name my-ubuntu-template

Container Konfiguration

Die Konfiguration für Container befindet sich unter

/var/lib/lxc/<container-name>/config
# Template used to create this container: /usr/share/lxc/templates/lxc-download
# Parameters passed to the template: --dist ubuntu --release focal --arch amd64 --no-validate
# Template script checksum (SHA-1): 273c51343604eb85f7e294c8da0a5eb769d648f3
# For additional config options, please look at lxc.container.conf(5)

# Uncomment the following line to support nesting containers:
#lxc.include = /usr/share/lxc/config/nesting.conf
# (Be aware this has security implications)

# Distribution configuration
lxc.include = /usr/share/lxc/config/common.conf
lxc.arch = linux64

# Container specific configuration
lxc.rootfs.path = dir:/var/lib/lxc/my-ubuntu-template/rootfs
lxc.uts.name = my-ubuntu-template

# Network configuration
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:0d:15:2c
lxc.txt · Zuletzt geändert: 2024/05/16 20:27 (Externe Bearbeitung)