Ubuntu under LXC/LXD Common configuration

Source: Internet
Author: User

# Ubuntu Version
sudo lsb_release-a
# Initialize config Initial configuration
sudo lxd init
# Container Creating an Ubuntu Container sample
LXC Launch ubuntu:16.04 First
# Show available Mirrors
LXC image list Images: | Less
# Show currently remote available
LXC Remote List
# display Container network
LXC Network show Lxdbr0
# Display Container
LXC List
# Run Container bash
LXC exec first--/bin/bash
# Run container commands directly
LXC exec First--Apt-get update
# File Transfer Download
LXC file Pull first/etc/hosts.
# File Transfer upload
LXC file Push hosts first/tmp/
# Stop Container
LXC Stop First
# Delete Container
LXC Delete First
# display container information
LXC Info First
# Local Configuration
Lxc Config Edit <container>
# show Container details
LXC Config Show first
LXC Config show <container>
# memory View Free-m
LXC exec first--free-m
# Set the maximum memory value
LXC config set first limits.memory 2048MB
# Perform the upgrade
LXC exec First--Apt-get update
LXC exec First--Apt-get dist-upgrade-y
LXC exec First--Apt-get autoremove--purge-y
# Pause
Lxc Pause <container>
# Snapshot snapshots-stateful option contains all States
LXC Snapshot First Clean
# List all the snapshots
LXC Info <container>
LXC Snapshot <container> <snapshot name>
# Snapshot Recovery
LXC Restore First Clean
# Generate container image from snapshot
LXC Publish First/clean--alias Clean-ubuntu
# Start Snapshot container mirroring
LXC Launch Clean-ubuntu Second
# Remove Container mirroring mode one
LXC Delete--force Second
# Remove Container mirroring mode two
LXC Delete-f Second
# Delete a snapshot
LXC Delete <container>/<snapshot name>
# Create a new container from the snapshot
LXC copy <source container>/<snapshot name> <destination container>
# Rename a snapshot
LXC move <container>/<snapshot name> <container>/<new Snapshot name>
# LXC running Docker
LXC Config set first security.nesting true
LXC Restart First

Ubuntu under LXC/LXD Common configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.