Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and deploy LXC under Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to install and deploy LXC under Linux". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install and deploy LXC under Linux".

The Chinese name of LXC is Linux container tool. Containers can provide lightweight virtualization to isolate processes and resources. The advantage of using LXC is that it does not need to install too many software packages, and the use process will not take up too many resources. This paper introduces the establishment and management of LXC step by step, as well as the setting method of virtual network interface.

LXC relies on cgroups (Control Groups) system of Linux kernel for resource management. Cgroups system is a process group-based resource management framework provided by Linux kernel, which can limit the resources that can be used for specific process groups. It was originally proposed by Google engineers and later integrated into the Linux kernel. Cgroups is also a resource management tool used by LXC to achieve virtualization. LXC has entered the Linux kernel, which means that LXC technology will be the most competitive lightweight virtual container technology.

1. Build the first LXC virtual computer.

# yum install lxc*

2. To check the LXC support of the kernel of the Linux distribution after installing the package, use the following command

# lxc-checkconfig

# after the lxc-checkconfig command checks, if all items show "enabled", you can use LXC directly

3. Establish a fedora Server LXC virtual computer system.

# lxc-create-t fedora-n testA

# fedora template is used here, and the template file is saved in the / usr/lib/lxc/templates/ directory

After the above command is completed, the virtual machine testA will be generated in the / var/lib/lxc directory

4. Check the created virtual machine system

# tree-L 2 / var/lib/lxc/

5. Start the LXC virtual computer

# lxc-start-n testA

Log in to the virtual computer after confirming the account number and password

6. List all the containers in the current system

# lxc-ls

7. Log in to the container using console

# lxc-console-n testA-t 3

8. Stop running a container

# lxc-stop-n testA

9. Get the status of a container

# lxc-info-n ol6ctr1

10. Destroy a container

# lxc-destroy-n testA1

11. Copy a container

# lxc-clone-o testA-n ol6ctr2

12. Pause or resume a container

# lxc-freeze-n testA

# lxc-unfreeze-n testA

13. Modify LXC network interface

# vi / etc/default/lxc

# restart the network service after modification

# service lxc-net restart

Thank you for your reading, the above is the content of "how to install and deploy LXC under Linux". After the study of this article, I believe you have a deeper understanding of how to install and deploy LXC under Linux. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report