May 9, 20179 yr Here are some notes regarding using containers in Ubuntu via lxd Install was pretty simple since lxd said it was already installed when I tried to run sudo apt-get install lxd I got no errors running: newgrp lxd Also no errors running: sudo lxd init So you must have some images to create lxd instances.. Here is a manual way of adding an image to the image store lxc image import <file> --alias <name> If you want to see a list of images you can simply run: lxc image list images: By default lxd comes with three image stores built in ubuntu: (for stable Ubuntu images) ubuntu-daily: (for daily Ubuntu images) images: (for a bunch of other distros) So if you wanted to check out what images are available at the default image stores you could run lxc image list ubuntu: lxc image list ubuntu-daily: lxc image list images: Once you found an image you would like to install you simply type in: lxc launch ubuntu:14.04 my-ubuntu lxc launch ubuntu-daily:16.04 my-ubuntu-dev lxc launch images:centos/6/amd64 my-centos But let's say you already have an image and its not on one of these stores. This is how you import it Import it with: lxc image import \<file\> --alias my-alias Run it with: lxc launch my-alias my-container Now if you wanted to run a command against one of your containers (let's say my-ubuntu that you created above) you would run: lxc exec my-ubuntu -- /bin/bash Here are some other examples: lxc exec my-ubuntu -- apt-get update lxc file pull my-ubuntu /etc/hosts . lxc file push hosts my-ubuntu /tmp/ You may want to stop the container and to do so you would run: lxc stop my-ubuntu And to delete the container: lxc delete my-ubuntu
Create an account or sign in to comment