一, 首先配置lxc需要的网卡断

  

  吧eth0复制一份变为br0

  配置br0

    

  配置eth0

    

 重启网卡

  /etc/init.d/network restart

 安装lxc软件 需要epel源---

  yum install  lxc* libcgroup* -y

 安装完成过后:

  

  启动lxc

 

  配置lxc源

  

  

  

  复制内容 到命令行擦做

  

  

  自己选择自己系统的版本信息,

  主要

    ppc的话事IBM的

    arm64手机那种

    amd63  X64

    i386     X32

  查看下载的文件内容

  

  下载一个模板

  

  查看模板信息

  

  启动lxc

  

  发现需要登入但是并没有密码

  新建一个连接

  

  

  

  进去啦...

  

  发现没有网

  

  lxc配置网络

  新建一个连接配置文件

  

  重启服务:

  新开连接

  

  在启动lxc

  更改容器的DNS

    resolve.conf

  新建连接配置容器

    

  容器中查看已经同步 

    

  cnetos6 配置地址

  

  

  在容器中ping 百度

  

  更改yum源文件

  vim /var/lib/lxc/centos6-muban/rootfs/etc/yum.repos.d/CentOS-Base.repo

  

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
# [base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

  安装ssh

  安装ssh

   yum install openssh-server -y

  ssh远程连接lxc

  

  lxc常用命令:

   lxc -ls 查看lxc容器列表

   lxc-destroy 删除一个容器

   lxc-start 启动   lxc-start -n centos6-muban

   lxc-stop 停止一个容器 lxc-stop -n centos6-muban

     lxc-clone 克隆lxc   lxc-clone centos6-muban web
    

 

     

 

lxc 容器基础配置篇的更多相关文章

  1. 深入浅出 webpack 之基础配置篇

    前言 前端工程化经历过很多优秀的工具,例如 Grunt.Gulp.webpack.rollup 等等,每种工具都有自己适用的场景,而现今应用最为广泛的当属 webpack 打包了,因此学习好 webp ...

  2. webpack3.x版本实战案例【基础配置篇】(一)

    本文旨在通过一个一个实战例子来学习webpack如何配置,更加深入的学习webpack在实战项目中如何配置. 我们学习哪些配置呢? [基础配置] 打包JS 编译ES6 编译typeScript 打包公 ...

  3. 提高开发效率之VS Code基础配置篇

    背景 之前一直是只用WebStorm作为IDE来编写代码,但是由于: 手中的这台Mac接了两个显示器以后,使用WebStorm会有卡顿. WebStorm需要付费(虽然可以通过某方法和谐). 所以需要 ...

  4. 从零开始用electron整个跨平台桌面应用---基础配置篇

    1.安装node.npm node以及npm都需要是最新版本(版本过低有坑) 2.安装淘宝镜像cnpm(建议,下载较快) npm install -g cnpm --registry=https:// ...

  5. 阿里云ECS服务器Linux环境下配置php服务器(一)--基础配置篇

    开始安装软件了,我们需要安装的软件有apache,php和MySQL. ps:如果你购买的是北京的服务器,有个安全组需要设置,我全部用的默认设置,暂时还没发现会有什么影响. 首先关闭SELINUX(S ...

  6. 【MM系列】SAP MM模块-基础配置第一篇

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP MM模块-基础配置第一篇   ...

  7. 【Cocos2d-Js基础教学(1)JS -Mac配置篇】

    一.准备工作 Windows配置篇请见 http://cn.cocos2d-x.org/tutorial/show?id=1396 1.安装python 2.下载Android SDK Android ...

  8. 【串线篇】spring boot嵌入式Servlet容器自动配置原理

    EmbeddedServletContainerAutoConfiguration:嵌入式的Servlet容器自动配置? @AutoConfigureOrder(Ordered.HIGHEST_PREC ...

  9. SpringMVC基础配置(通过注解配置,非xml配置)

    SpringMVC是什么,有多火,我这里就不再啰嗦了,SpringMVC比Struts2好用太多,我在学校的时候私下里两种都接触过,对比之后果断选择了SpringMVC,后来在做Android应用开发 ...

随机推荐

  1. MySQL性能调优与架构设计——第3章 MySQL存储引擎简介

    第3章 MySQL存储引擎简介 3.1 MySQL 存储引擎概述 MyISAM存储引擎是MySQL默认的存储引擎,也是目前MySQL使用最为广泛的存储引擎之一.他的前身就是我们在MySQL发展历程中所 ...

  2. jquery中attr和prop的区别(转)

    在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别?这些问题就出现了. 关于它们两个的区别,网上的答案很多.这里谈谈我的心得,我的心得很简单: ...

  3. 函数LEN()使用方法

    string pro_sql = string.Format("select pr_bianma from tb_products where pr_bianma like '%120201 ...

  4. C# Socket 发送&接收&返回

    因为工作比较忙,好久没有写过博客了,最近因项目需求,需要用到Socket来进行通信,简单写了几个例子,记录一下,代码很简单,无非就是接收与发送,以及接收到数据后返回一个自定义信息,也可以说是发送. 先 ...

  5. Unity本地持久化类Playerprefs使用详解

    一.PlayerPrefs是什么? PlayerPrefs是Unity3d提供了一个用于数据本地持久化保存与读取的类.工作原理十分简单,就是以key-value的形式将数据保存在本地,然后在代码中可以 ...

  6. C#上位机中ZedGraph控件的使用

    上位机程序控制PLC模拟量通道输出周期性正弦波信号,并采集所造成改变的模拟量输入信号,并绘制数据变化曲线. 界面如图: 最后测试效果如图: 代码: using System; using System ...

  7. linux上的那些查找的命令

    由于工作的需要,少不得要在linux系统上查找各种各样的文件,关于在linux查找的命令有不少,这里小小的总结下. 简单介绍下各个命令的用途: find:实际搜索硬盘查询文件名称: whereis:查 ...

  8. 浅谈PHP的Public、Protected、Private三种方法的区别

    public:权限是最大的,可以内部调用,实例调用等.protected: 受保护类型,用于本类和继承类调用.private: 私有类型,只有在本类中使用. <?php error_report ...

  9. Hadoop Hive概念学习系列之什么是Hive?

    参考  <Hadoop大数据分析与挖掘实战>的在线电子书阅读                   http://yuedu.baidu.com/ebook/d128cf8e33687e21 ...

  10. shell-001:记录每天的磁盘情况

    # shell-100只是为了练习!!适合新手! #!/bin/bash # 此脚本是记录每天的磁盘情况,记录保存30天! # 当前的日期 current_time=$(date +%F) # 保存的 ...