To install LXD, the container hypervisor, under a KVM or Xen virtual machine, you will need to follow these steps:
Create a new virtual machine using KVM or Xen, and install a Linux operating system on it. Any Linux distribution that is supported by LXD should work.
Once the virtual machine is up and running, log in and update the package manager's package list:
sudo apt updateSourcw:eww.lautturi.com
sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable
lxd
package by running the following command:sudo apt install lxd
sudo lxd init
This will guide you through the process of setting up LXD on your system. Follow the prompts to choose your storage backend, network address, and other options.
lxc launch ubuntu:16.04 my-container
Replace my-container
with the desired name for your container. This will create a new container based on the Ubuntu 16.04 image and start it.
lxc exec my-container bash
Replace my-container
with the name of your container. This will open a terminal session within the container, allowing you to run commands and manage the container.
That's it! You now have LXD installed and configured within your KVM or Xen virtual machine, and you can use it to manage containers.