首页 技术 正文
技术 2022年11月15日
0 收藏 330 点赞 4,913 浏览 2637 个字

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

  lxc 容器基础配置篇

  吧eth0复制一份变为br0

  配置br0

    lxc 容器基础配置篇

  配置eth0

    lxc 容器基础配置篇

 重启网卡

  /etc/init.d/network restart

 安装lxc软件 需要epel源—

  yum install  lxc* libcgroup* -y

 安装完成过后:

  lxc 容器基础配置篇

  启动lxc

 lxc 容器基础配置篇

  配置lxc源

  lxc 容器基础配置篇

  lxc 容器基础配置篇

  lxc 容器基础配置篇

  复制内容 到命令行擦做

  lxc 容器基础配置篇

  lxc 容器基础配置篇

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

  主要

    ppc的话事IBM的

    arm64手机那种

    amd63  X64

    i386     X32

  查看下载的文件内容

  lxc 容器基础配置篇

  下载一个模板

  lxc 容器基础配置篇

  查看模板信息

  lxc 容器基础配置篇

  启动lxc

  lxc 容器基础配置篇

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

  新建一个连接

  lxc 容器基础配置篇

  

  

  进去啦…

  lxc 容器基础配置篇

  发现没有网

  

  lxc配置网络

  新建一个连接配置文件

  lxc 容器基础配置篇

  重启服务:

  新开连接

  lxc 容器基础配置篇

  在启动lxc

  更改容器的DNS

    resolve.conf

  新建连接配置容器

    lxc 容器基础配置篇

  容器中查看已经同步 

    lxc 容器基础配置篇

  cnetos6 配置地址

  lxc 容器基础配置篇

  lxc 容器基础配置篇

  在容器中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 容器基础配置篇

 

     

 

下一篇: flask综合整理2
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,909
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,434
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,249
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,060
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,692
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,730