/ HOWTO

LXC también existe.


Para no dejar afuera a ningún producto, teniendo tantas cosas en común, agregamos este post sobre LXC, un producto declarado como “abierto” y “neutral” para correr contenedores. Es GNU LGPLv2.1+. Aunque el soporte comercial lo brinda Canonical (Ubuntu).

https://linuxcontainers.org/

Es un producto parecido a docker, pero tiene un “init.d”, usa su propio espacio de almacenamiento, paraleliza procesos y estaría en medio entre Docker y un VM. Focalizado principalmente en Ubuntu y quizás (lo tenemos que verificar) mejor performance de I/O.

Mas información de Docker y LXC.

https://robinsystems.com/blog/containers-deep-dive-lxc-vs-docker-comparison/

Algunos conceptos básicos, LXC y LXD. mientras que LXC es el producto inicial, LXD es un producto mejorado que usa LXC como producto por debajo.

Recomiendan no usar al mismo tiempo LXC y LXD. En este post usaremos LXC únicamente.

Existe también LXCFS, mas info aqui. Aunque con los nuevos Kernels no es necesario.

https://linuxcontainers.org/lxcfs/introduction/

Para instalarlo en Debian.

apt install lxc libvirt0 libpam-cgroup libpam-cgfs bridge-utils

Luego editamos la configuración de LXC relacionada con “red”.

# vi /etc/default/lxc-net
USE_LXC_BRIDGE="true"

Agregamos mas opciones, para indicar el nombre de la nueva interfaz virtual Bridge (lxcbr0) y algunos parámetros adicionales (como la mac address asignada).

# vi /etc/lxc/default.conf 
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:00:00:01

Luego debemos hacer un “reboot” para que aparezca la nueva interfaz.

# ifconfig 
lxcbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.0.3.1  netmask 255.255.255.0  broadcast 0.0.0.0
        ether 00:16:3e:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Para crear un nuevo contenedor (deb) basado en “stretch”.

lxc-create -n deb -t debian -- -r stretch

Revisamos la carpeta donde estarán los ficheros relacionados con LXC.

ll /var/lib/lxc/deb/rootfs

Algunos comandos para parar y arrancar el contenedor.

Lo arrancamos en background y accedemos a su consola.

# lxc-start -n deb
# lxc-console -n deb

Tambien podemos arrancarlo en modo Foreground, es decir, teniendo delante una consola.

# lxc-start -F -n deb

Podemos pararlo con este comando, indicando siempre el nombre del contenedor (deb).

# lxc-stop -k -n deb

Para que arranque automáticamente en cada booteo usamos el parámetro.

lxc.start.auto = 1

Ahora pedimos informacin del contenedor corriendo.

# lxc-info -n deb
Name:           deb
State:          RUNNING
PID:            2238
IP:             10.0.3.17
CPU use:        0.24 seconds
BlkIO use:      18.88 MiB
Memory use:     34.58 MiB
KMem use:       3.47 MiB
Link:           veth6A2S50
 TX bytes:      1.27 KiB
 RX bytes:      5.88 KiB
 Total bytes:   7.16 KiB

Vemos los procesos corriendo relacionados con LXC. Entre ellos el lxcfs que es gestor de almacenamiento.

        ├─lxc-start───systemd─┬─5*[agetty]
        │                     ├─dhclient
        │                     ├─sshd
        │                     └─systemd-journal
        ├─lxcfs───2*[{lxcfs}]

Podemos ver la configuración de LXC con este comando.

# lxc-checkconfig 
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-4.9.0-7-amd64
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled
--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
Bridges: enabled
Advanced netfilter: enabled
CONFIG_NF_NAT_IPV4: enabled
CONFIG_NF_NAT_IPV6: enabled
CONFIG_IP_NF_TARGET_MASQUERADE: enabled
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled
FUSE (for use with lxcfs): enabled
--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: enabled
Note : Before booting a new kernel, you can check its configuration
Usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig

El proceso completo de creacin de un nuevo contenedor.

# lxc-create -n deb -t debian -- -r stretch
debootstrap is /usr/sbin/debootstrap
Checking cache download in /var/cache/lxc/debian/rootfs-stretch-amd64 ... 
Downloading debian minimal ...
I: Retrieving InRelease 
I: Retrieving Release 
I: Retrieving Release.gpg 
I: Checking Release signature
I: Valid Release signature (key id 067E3C456BAE240ACEE88F6FEF0F382A1A7B6500)
I: Retrieving Packages 
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Found additional required dependencies: libaudit-common libaudit1 libbz2-1.0 libcap-ng0 libdb5.3 libdebconfclient0 libgcrypt20 libgpg-error0 liblz4-1 libncursesw5 libsemanage-common libsemanage1 libsystemd0 libudev1 libustr-1.0-1 
I: Found additional base dependencies: adduser debian-archive-keyring dmsetup gpgv libapparmor1 libapt-pkg5.0 libbsd0 libc-l10n libcap2 libcryptsetup4 libdevmapper1.02.1 libdns-export162 libedit2 libelf1 libgssapi-krb5-2 libidn11 libip4tc0 libisc-export160 libk5crypto3 libkeyutils1 libkmod2 libkrb5-3 libkrb5support0 libmnl0 libncurses5 libprocps6 libseccomp2 libssl1.0.2 libstdc++6 libwrap0 openssh-client openssh-sftp-server procps systemd systemd-sysv ucf 
I: Checking component main on http://httpredir.debian.org/debian...
I: Retrieving libacl1 2.2.52-3+b1
I: Validating libacl1 2.2.52-3+b1
I: Retrieving adduser 3.115
I: Validating adduser 3.115
I: Retrieving libapparmor1 2.11.0-3+deb9u2
I: Validating libapparmor1 2.11.0-3+deb9u2
.........
I: Configuring libc-bin...
I: Configuring systemd...
I: Base system installed successfully.
Download complete.
Copying rootfs to /var/lib/lxc/deb/rootfs...Generating locales (this might take a while)...
  en_IE.UTF-8... done
  en_IE.UTF-8... done
Generation complete.
update-rc.d: error: cannot find a LSB script for checkroot.sh
update-rc.d: error: cannot find a LSB script for umountfs
update-rc.d: error: cannot find a LSB script for hwclockfirst.sh
Creating SSH2 RSA key; this may take some time ...
2048 SHA256:zElIae5aJxnwwM/bPCuwZEAfI2Ec313tiw6C/UM root@debian9 (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:eQm5j99xp5s00SZKWx5C1rqE+VFaEGKVpZNd/c root@debian9 (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:yYv+blr52MCTQwaGSxj97phTkh9XKsR7ibCQo/8 root@debian9 (ED25519)
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Current default time zone: 'Etc/UTC'
Local time is now:      Wed Aug 15 15:57:37 UTC 2018.
Universal Time is now:  Wed Aug 15 15:57:37 UTC 2018.

Pedimos info del contenedor recien creado.

# lxc-info --name deb
Name:           deb
State:          STOPPED

Arrancamos el contenedor en modo Foreground, tendremos acceso a la consola BASH.

# lxc-start -F -n deb
systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Detected virtualization lxc.
Detected architecture x86-64.
Welcome to Debian GNU/Linux 9 (stretch)!
Set hostname to <deb>.
Failed to install release agent, ignoring: No such file or directory
[email protected]: Cannot add dependency job, ignoring: Unit [email protected] is masked.
[email protected]: Cannot add dependency job, ignoring: Unit [email protected] is masked.
[email protected]: Cannot add dependency job, ignoring: Unit [email protected] is masked.
[email protected]: Cannot add dependency job, ignoring: Unit [email protected] is masked.
[email protected]: Cannot add dependency job, ignoring: Unit [email protected] is masked.
[  OK  ] Listening on Journal Socket.
[  OK  ] Listening on Journal Audit Socket.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Reached target Swap.
[  OK  ] Listening on Journal Socket (/dev/log).
system.slice: Failed to reset devices.list: Operation not permitted
[  OK  ] Created slice System Slice.
dev-hugepages.mount: Failed to reset devices.list: Operation not permitted
         Mounting Huge Pages File System...
[  OK  ] Reached target Slices.
system-getty.slice: Failed to reset devices.list: Operation not permitted
[  OK  ] Created slice system-getty.slice.
systemd-remount-fs.service: Failed to reset devices.list: Operation not permitted
         Starting Remount Root and Kernel File Systems...
dev-mqueue.mount: Failed to reset devices.list: Operation not permitted
         Mounting POSIX Message Queue File System...
systemd-journald.service: Failed to reset devices.list: Operation not permitted
         Starting Journal Service...
systemd-sysctl.service: Failed to reset devices.list: Operation not permitted
         Starting Apply Kernel Variables...
[  OK  ] Reached target Paths.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Encrypted Volumes.
[  OK  ] Reached target Remote File Systems.
proc-meminfo.mount: Failed to reset devices.list: Operation not permitted
proc-swaps.mount: Failed to reset devices.list: Operation not permitted
proc-cpuinfo.mount: Failed to reset devices.list: Operation not permitted
sys-devices-virtual-net.mount: Failed to reset devices.list: Operation not permitted
dev-tty4.mount: Failed to reset devices.list: Operation not permitted
proc-diskstats.mount: Failed to reset devices.list: Operation not permitted
dev-tty1.mount: Failed to reset devices.list: Operation not permitted
dev-tty2.mount: Failed to reset devices.list: Operation not permitted
-.mount: Failed to reset devices.list: Operation not permitted
proc-uptime.mount: Failed to reset devices.list: Operation not permitted
dev-tty3.mount: Failed to reset devices.list: Operation not permitted
proc-stat.mount: Failed to reset devices.list: Operation not permitted
sys-fs-fuse-connections.mount: Failed to reset devices.list: Operation not permitted
proc-sys-net.mount: Failed to reset devices.list: Operation not permitted
proc-sysrq\x2dtrigger.mount: Failed to reset devices.list: Operation not permitted
init.scope: Failed to reset devices.list: Operation not permitted
[  OK  ] Mounted POSIX Message Queue File System.
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.
networking.service: Failed to reset devices.list: Operation not permitted
         Starting Raise network interfaces...
systemd-remount-fs.service: Failed to reset devices.list: Operation not permitted
systemd-sysctl.service: Failed to reset devices.list: Operation not permitted
[  OK  ] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
[  OK  ] Started Flush Journal to Persistent Storage.
         Starting Create Volatile Files and Directories...
[  OK  ] Started Create Volatile Files and Directories.
[  OK  ] Reached target System Time Synchronized.
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Daily apt download activities.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Started Daily apt upgrade and clean activities.
[  OK  ] Reached target Timers.
[  OK  ] Reached target Basic System.
[  OK  ] Started Raise network interfaces.
[  OK  ] Reached target Network.
         Starting Permit User Sessions...
         Starting OpenBSD Secure Shell server...
[  OK  ] Started Permit User Sessions.
[  OK  ] Started Console Getty.
[  OK  ] Started Getty on tty1.
[  OK  ] Started Getty on tty2.
[  OK  ] Started Getty on tty4.
[  OK  ] Started Getty on tty3.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started OpenBSD Secure Shell server.
[  OK  ] Reached target Multi-User System.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Started Update UTMP about System Runlevel Changes.
Debian GNU/Linux 9 deb console
deb login: 

Ahora paramos el Contenedor.

# lxc-stop -n deb
[  OK  ] Reached target Unmount All Filesystems.
[  OK  ] Stopped target Timers.
[  OK  ] Stopped Daily Cleanup of Temporary Directories.
[  OK  ] Stopped Daily apt upgrade and clean activities.
[  OK  ] Stopped Daily apt download activities.
[  OK  ] Stopped target System Time Synchronized.
[  OK  ] Stopped target Multi-User System.
         Stopping OpenBSD Secure Shell server...
[  OK  ] Stopped target Login Prompts.
         Stopping Getty on tty2...
         Stopping Getty on tty1...
         Stopping Console Getty...
         Stopping Getty on tty3...
         Stopping Getty on tty4...
[  OK  ] Stopped Getty on tty1.
[  OK  ] Stopped Getty on tty2.
[  OK  ] Stopped Getty on tty4.
[  OK  ] Stopped Getty on tty3.
[  OK  ] Stopped OpenBSD Secure Shell server.
[  OK  ] Removed slice system-getty.slice.
[  OK  ] Stopped Console Getty.
         Stopping Permit User Sessions...
[  OK  ] Stopped Permit User Sessions.
[  OK  ] Stopped target Basic System.
[  OK  ] Stopped target Slices.
[  OK  ] Stopped target Paths.
[  OK  ] Stopped target Sockets.
[  OK  ] Stopped target Network.
         Stopping Raise network interfaces...
[  OK  ] Stopped target Remote File Systems.
[  OK  ] Stopped target System Initialization.
[  OK  ] Stopped target Encrypted Volumes.
[  OK  ] Stopped Forward Password Requests to Wall Directory Watch.
[  OK  ] Stopped Dispatch Password Requests to Console Directory Watch.
         Stopping Update UTMP about System Boot/Shutdown...
[  OK  ] Stopped target Swap.
[  OK  ] Stopped Update UTMP about System Boot/Shutdown.
[  OK  ] Stopped Create Volatile Files and Directories.
[  OK  ] Stopped Raise network interfaces.
[  OK  ] Stopped target Local File Systems.
[  OK  ] Stopped target Local File Systems (Pre).
[  OK  ] Stopped Remount Root and Kernel File Systems.
[  OK  ] Stopped Apply Kernel Variables.
[  OK  ] Reached target Shutdown.
Sending SIGTERM to remaining processes...
Sending SIGKILL to remaining processes...
Halting system.

Aunque los servicios/demonios que corren con LXC son distintos a Docker, comparten mucho de sus fundamentos.

Para poder acceder al contenedor (deb) debemos asignar una nueva clave al usuario “root” mediante :

# lxc-attach -n deb passwd
Enter new UNIX password: *************
Retype new UNIX password: *************
passwd: password updated successfully

Accedemos mediante bash al contenedor.

# lxc-attach -n deb bash

Aqui estamos en el contenedor.
root@deb:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       218G   55G  152G  27% /
none            492K     0  492K   0% /dev
tmpfs           2.8G     0  2.8G   0% /dev/shm
tmpfs           2.8G  8.1M  2.8G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.8G     0  2.8G   0% /sys/fs/cgroup


root@deb:/# id
uid=0(root) gid=0(root) groups=0(root)


root@deb:/# uname -a
Linux deb 4.9.0-7-amd64 #1 SMP Debian 4.9.110-3+deb9u2 (2018-08-13) x86_64 GNU/Linux


root@deb:/# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.3.17  netmask 255.255.255.0  broadcast 10.0.3.255
        inet6 fe80::216:3eff:fe00:1  prefixlen 64  scopeid 0x20<link>
        ether 00:16:3e:00:00:01  txqueuelen 1000  (Ethernet)
        RX packets 23  bytes 3176 (3.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13  bytes 1514 (1.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Como no podía faltar, comparamos los paquetes instalados.

# dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                      Version           Architecture      Description
+++-=========================-=================-=================-========================================================
ii  adduser                   3.115             all               add and remove users and groups
ii  apt                       1.4.8             amd64             commandline package manager
ii  base-files                9.9+deb9u5        amd64             Debian base system miscellaneous files
ii  base-passwd               3.5.43            amd64             Debian base system master password and group files
ii  bash                      4.4-5             amd64             GNU Bourne Again SHell
ii  bsdutils                  1:2.29.2-1+deb9u1 amd64             basic utilities from 4.4BSD-Lite
ii  coreutils                 8.26-3            amd64             GNU core utilities
ii  dash                      0.5.8-2.4         amd64             POSIX-compliant shell
ii  debconf                   1.5.61            all               Debian configuration management system
ii  debian-archive-keyring    2017.5            all               GnuPG archive keys of the Debian archive
ii  debianutils               4.8.1.1           amd64             Miscellaneous utilities specific to Debian
ii  dialog                    1.3-20160828-2    amd64             Displays user-friendly dialog boxes from shell scripts
ii  diffutils                 1:3.5-3           amd64             File comparison utilities
ii  dmsetup                   2:1.02.137-2      amd64             Linux Kernel Device Mapper userspace library
ii  dpkg                      1.18.25           amd64             Debian package management system
ii  e2fslibs:amd64            1.43.4-2          amd64             ext2/ext3/ext4 file system libraries
ii  e2fsprogs                 1.43.4-2          amd64             ext2/ext3/ext4 file system utilities
ii  findutils                 4.6.0+git+2016110 amd64             utilities for finding files--find, xargs
ii  gcc-6-base:amd64          6.3.0-18+deb9u1   amd64             GCC, the GNU Compiler Collection (base package)
ii  gpgv                      2.1.18-8~deb9u2   amd64             GNU privacy guard - signature verification tool
ii  grep                      2.27-2            amd64             GNU grep, egrep and fgrep
ii  gzip                      1.6-5+b1          amd64             GNU compression utilities
ii  hostname                  3.18+b1           amd64             utility to set/show the host name or domain name
ii  ifupdown                  0.8.19            amd64             high level tools to configure network interfaces
ii  init                      1.48              amd64             metapackage ensuring an init system is installed
ii  init-system-helpers       1.48              all               helper tools for all init systems
ii  iproute2                  4.9.0-1+deb9u1    amd64             networking and traffic control tools
ii  isc-dhcp-client           4.3.5-3+deb9u1    amd64             DHCP client for automatically obtaining an IP address
ii  libacl1:amd64             2.2.52-3+b1       amd64             Access control list shared library
ii  libapparmor1:amd64        2.11.0-3+deb9u2   amd64             changehat AppArmor library
ii  libapt-pkg5.0:amd64       1.4.8             amd64             package management runtime library
ii  libattr1:amd64            1:2.4.47-2+b2     amd64             Extended attribute shared library
ii  libaudit-common           1:2.6.7-2         all               Dynamic library for security auditing - common files
ii  libaudit1:amd64           1:2.6.7-2         amd64             Dynamic library for security auditing
ii  libblkid1:amd64           2.29.2-1+deb9u1   amd64             block device ID library
ii  libbsd0:amd64             0.8.3-1           amd64             utility functions from BSD systems - shared library
ii  libbz2-1.0:amd64          1.0.6-8.1         amd64             high-quality block-sorting file compressor library - run
ii  libc-bin                  2.24-11+deb9u3    amd64             GNU C Library: Binaries
ii  libc-l10n                 2.24-11+deb9u3    all               GNU C Library: localization files
ii  libc6:amd64               2.24-11+deb9u3    amd64             GNU C Library: Shared libraries
ii  libcap-ng0:amd64          0.7.7-3+b1        amd64             An alternate POSIX capabilities library
ii  libcap2:amd64             1:2.25-1          amd64             POSIX 1003.1e capabilities (library)
ii  libcomerr2:amd64          1.43.4-2          amd64             common error description library
ii  libcryptsetup4:amd64      2:1.7.3-4         amd64             disk encryption support - shared library
ii  libdb5.3:amd64            5.3.28-12+deb9u1  amd64             Berkeley v5.3 Database Libraries [runtime]
ii  libdebconfclient0:amd64   0.227             amd64             Debian Configuration Management System (C-implementation
ii  libdevmapper1.02.1:amd64  2:1.02.137-2      amd64             Linux Kernel Device Mapper userspace library
ii  libdns-export162          1:9.10.3.dfsg.P4- amd64             Exported DNS Shared Library
ii  libedit2:amd64            3.1-20160903-3    amd64             BSD editline and history libraries
ii  libelf1:amd64             0.168-1           amd64             library to read and write ELF files
ii  libfdisk1:amd64           2.29.2-1+deb9u1   amd64             fdisk partitioning library
ii  libgcc1:amd64             1:6.3.0-18+deb9u1 amd64             GCC support library
ii  libgcrypt20:amd64         1.7.6-2+deb9u3    amd64             LGPL Crypto library - runtime library
ii  libgpg-error0:amd64       1.26-2            amd64             library for common error values and messages in GnuPG co
ii  libgssapi-krb5-2:amd64    1.15-1+deb9u1     amd64             MIT Kerberos runtime libraries - krb5 GSS-API Mechanism
ii  libidn11:amd64            1.33-1            amd64             GNU Libidn library, implementation of IETF IDN specifica
ii  libip4tc0:amd64           1.6.0+snapshot201 amd64             netfilter libip4tc library
ii  libisc-export160          1:9.10.3.dfsg.P4- amd64             Exported ISC Shared Library
ii  libk5crypto3:amd64        1.15-1+deb9u1     amd64             MIT Kerberos runtime libraries - Crypto Library
ii  libkeyutils1:amd64        1.5.9-9           amd64             Linux Key Management Utilities (library)
ii  libkmod2:amd64            23-2              amd64             libkmod shared library
ii  libkrb5-3:amd64           1.15-1+deb9u1     amd64             MIT Kerberos runtime libraries
ii  libkrb5support0:amd64     1.15-1+deb9u1     amd64             MIT Kerberos runtime libraries - Support library
ii  liblz4-1:amd64            0.0~r131-2+b1     amd64             Fast LZ compression algorithm library - runtime
ii  liblzma5:amd64            5.2.2-1.2+b1      amd64             XZ-format compression library
ii  libmnl0:amd64             1.0.4-2           amd64             minimalistic Netlink communication library
ii  libmount1:amd64           2.29.2-1+deb9u1   amd64             device mounting library
ii  libncurses5:amd64         6.0+20161126-1+de amd64             shared libraries for terminal handling
ii  libncursesw5:amd64        6.0+20161126-1+de amd64             shared libraries for terminal handling (wide character s
ii  libpam-modules:amd64      1.1.8-3.6         amd64             Pluggable Authentication Modules for PAM
ii  libpam-modules-bin        1.1.8-3.6         amd64             Pluggable Authentication Modules for PAM - helper binari
ii  libpam-runtime            1.1.8-3.6         all               Runtime support for the PAM library
ii  libpam0g:amd64            1.1.8-3.6         amd64             Pluggable Authentication Modules library
ii  libpcre3:amd64            2:8.39-3          amd64             Old Perl 5 Compatible Regular Expression Library - runti
ii  libprocps6:amd64          2:3.3.12-3+deb9u1 amd64             library for accessing process information from /proc
ii  libseccomp2:amd64         2.3.1-2.1         amd64             high level interface to Linux seccomp filter
ii  libselinux1:amd64         2.6-3+b3          amd64             SELinux runtime shared libraries
ii  libsemanage-common        2.6-2             all               Common files for SELinux policy management libraries
ii  libsemanage1:amd64        2.6-2             amd64             SELinux policy management library
ii  libsepol1:amd64           2.6-2             amd64             SELinux library for manipulating binary security policie
ii  libsmartcols1:amd64       2.29.2-1+deb9u1   amd64             smart column output alignment library
ii  libss2:amd64              1.43.4-2          amd64             command-line interface parsing library
ii  libssl1.0.2:amd64         1.0.2l-2+deb9u3   amd64             Secure Sockets Layer toolkit - shared libraries
ii  libstdc++6:amd64          6.3.0-18+deb9u1   amd64             GNU Standard C++ Library v3
ii  libsystemd0:amd64         232-25+deb9u4     amd64             systemd utility library
ii  libtinfo5:amd64           6.0+20161126-1+de amd64             shared low-level terminfo library for terminal handling
ii  libudev1:amd64            232-25+deb9u4     amd64             libudev shared library
ii  libustr-1.0-1:amd64       1.0.4-6           amd64             Micro string library: shared library
ii  libuuid1:amd64            2.29.2-1+deb9u1   amd64             Universally Unique ID library
ii  libwrap0:amd64            7.6.q-26          amd64             Wietse Venema's TCP wrappers library
ii  locales                   2.24-11+deb9u3    all               GNU C Library: National Language (locale) data [support]
ii  login                     1:4.4-4.1         amd64             system login tools
ii  lsb-base                  9.20161125        all               Linux Standard Base init script functionality
ii  mawk                      1.3.3-17+b3       amd64             a pattern scanning and text processing language
ii  mount                     2.29.2-1+deb9u1   amd64             tools for mounting and manipulating filesystems
ii  multiarch-support         2.24-11+deb9u3    amd64             Transitional package to ensure multiarch compatibility
ii  ncurses-base              6.0+20161126-1+de all               basic terminal type definitions
ii  ncurses-bin               6.0+20161126-1+de amd64             terminal-related programs and man pages
ii  net-tools                 1.60+git20161116. amd64             NET-3 networking toolkit
ii  netbase                   5.4               all               Basic TCP/IP networking system
ii  openssh-client            1:7.4p1-10+deb9u3 amd64             secure shell (SSH) client, for secure access to remote m
ii  openssh-server            1:7.4p1-10+deb9u3 amd64             secure shell (SSH) server, for secure access from remote
ii  openssh-sftp-server       1:7.4p1-10+deb9u3 amd64             secure shell (SSH) sftp server module, for SFTP access f
ii  passwd                    1:4.4-4.1         amd64             change and administer password and group data
ii  perl-base                 5.24.1-3+deb9u4   amd64             minimal Perl system
ii  procps                    2:3.3.12-3+deb9u1 amd64             /proc file system utilities
ii  sed                       4.4-1             amd64             GNU stream editor for filtering/transforming text
ii  sensible-utils            0.0.9+deb9u1      all               Utilities for sensible alternative selection
ii  systemd                   232-25+deb9u4     amd64             system and service manager
ii  systemd-sysv              232-25+deb9u4     amd64             system and service manager - SysV links
ii  sysvinit-utils            2.88dsf-59.9      amd64             System-V-like utilities
ii  tar                       1.29b-1.1         amd64             GNU version of the tar archiving utility
ii  tzdata                    2018e-0+deb9u1    all               time zone and daylight-saving time data
ii  ucf                       3.0036            all               Update Configuration File(s): preserve user changes to c
ii  util-linux                2.29.2-1+deb9u1   amd64             miscellaneous system utilities
ii  zlib1g:amd64              1:1.2.8.dfsg-5    amd64             compression library - runtime

Dentro del contenedor, instalamos y corremos “HTOP”.

Datos de los contenedores.

# lxc-ls -f
NAME STATE   AUTOSTART GROUPS IPV4      IPV6 
deb  RUNNING 0         -      10.0.3.17 -   

Creando otro contenedor, ahora usando SID y amd64.

# lxc-create -n dsid64 -t debian -- -r sid -a amd64

Ahora veremos como borrar un contenedor.

# lxc-destroy -n deb --force
Destroyed container deb

La lista de imágenes para descargar…

https://us.images.linuxcontainers.org/

Subscríbete y recibirás los últimos artículos semanalmente en tu email.