This is an old revision of the document!
Table of Contents
LXD
LXD est un outil moderne, sécurisé et puissant qui offre une expérience unifiée pour l'exécution et la gestion de containers ou de machines virtuelles. Pour plus d'informations, consultez : https://canonical.com/lxd
Initialisation de LXD
lxd init : Initialise LXD avant la première utilisation.
Création d'instances
lxc init ubuntu:22.04 <nom_du_conteneur> : Crée un container LXC système (sans le démarrer).
lxc launch ubuntu:24.04 <nom_du_conteneur> : Crée et démarre un container LXC système.
lxc launch ubuntu:22.04 <nom_de_la_vm> –vm : Crée et démarre une machine virtuelle.
Gestion des instances
lxc list : Liste les instances. lxc info <instance> : Affiche des informations sur l'état d'une instance. lxc start <instance> : Démarre une instance. lxc stop <instance> [–force] : Arrête une instance. lxc delete <instance> [–force|–interactive] : Supprime une instance.
Accès aux instances
lxc exec <instance> – <commande> : Exécute une commande dans une instance. lxc exec <instance> – bash : Accède au shell d'une instance (si bash est installé). lxc console <instance> [flags] : Accède à la console d'une instance. lxc file pull <instance>/<chemin_du_fichier_instance> <chemin_local> : Récupère un fichier depuis une instance. lxc file pull <chemin_local> <instance>/<chemin_du_fichier_instance> : Envoie un fichier vers une instance.
Utilisation des projets
lxc project create <projet> [–config <option>] : Crée un projet. lxc project set <projet> <option> : Configure un projet. lxc project switch <projet> : Passe à un autre projet.
