X-osadminの自留地
  • 博客主页 HomePage
  • 技术小絮 Tech
  • 作品发布 Works
  • 软件专题 Softs
    • proxmox
    • openwrt
    • chromebook
    • Zerotier
    • 虚拟化
  • 友情链接 Following

xosadmin

BGPlayer / Codes learner / Love Linux
Posts
77
Comments
0

友情链接 – Friendly Links

  • Add your site here…
xosadmin
7 years ago

如何在Linux(CentOS)上安装OpenVZ

近日,有一位朋友向我请教如何在其自己的CentOS服务器上安装OpenVZ虚拟化。所谓OpenVZ,官方对其的定义如下:

“OpenVZ is a container-based virtualization for Linux. OpenVZ creates multiple secure, isolated Linux containers (otherwise known as VEs or VPSs) on a single physical server enabling better server utilization and ensuring that applications do not conflict. Each container performs and executes exactly like a stand-alone server; a container can be rebooted independently and have root access, users, IP addresses, memory, processes, files, applications, system libraries and configuration files.”

由于是调用母鸡的系统内核,所以会导致openvz的虚拟机部分功能默认是不可使用或者是默认关闭的,如ppp和tun功能。(之后将讲述如何在母鸡上为虚拟机开启本功能)

话不多说,进入教程~

 

一、环境配置

采用的服务器操作系统:CentOS 6.9 X86_64

** 这里注意:32位的操作系统可能会提示无法找到openvz相关的安装包,所以,认为64为操作系统为宜

 

二、安装前的准备阶段

1.关闭SeLinux,命令:

setenforce 0

2.更新系统软件包

yum -y update

 

三、正式安装

1.载入OpenVZ的yum key并安装OpenVZyum源

# wget -O /etc/yum.repos.d/openvz.repo http://download.openvz.org/openvz.repo
# rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ

2. 安装VZKernel

# yum -y install vzkernel

3. 确保在grub中,vzkernel是首选启动项,查看title Openvz所处位置,若是第一个,请确保title上一行的启动顺序为0

# vi /boot/grub/menu.lst

4. 安装OpenVZ工具
# yum install vzctl vzquota ploop -y

5. 更改系统内核,并将内核文件改为下面附上的形式

# vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1
6. 重启系统

# reboot

重启后,通过以上步骤,您已经成功安装了openvz框架。

** 扩展:安装OpenVZ Web Panel

请使用以下命令:

wget http://downs1.x-osadmin.com/ai.sh && sh ai.sh

若提示wget: command not found,请执行yum -y install wget。
  • 技术小絮
  • 虚拟化
等 人表示很赞
2,257
0

📮Comments

No Comment.
xosadmin
xosadmin
5 years ago
推荐 ZeroTier内网主机互ping时出现destination host unreachable的解决方案
ZeroTier是一个十分好用的组内网软件。但是,部分主机虽然成功连接了ZeroTier并且获得了IP,但是内网中其他主机在ping此IP时,可能会提示Destination host unreachable,可能还伴有端口无法访问等问题, ...
  • 技术小絮
6,674 0
xosadmin
xosadmin
2 months ago
推荐 HPE Microserver系列降低噪音的一种办法
部分HPE Microserver Gen10+和Gen11用户反映,安装了Debian/Proxmox或者更换了硬盘后出现风扇声音很大的问题。经过搜索和研究,发现其中一种解决方法,即在系统中安装HPE的amsd及smad组件。具体方式如下 ...
  • 技术小絮
19 0
xosadmin
xosadmin
2 years ago
推荐 在OpenVZ或LXC下使用Zerotier
众所周知,Zerotier是一个十分方便的p2p组网方式,OpenVZ和LXC是一种容器式的虚拟化。因此,OpenVZ和LXC的ppp和tun功能默认处于关闭状态。这也导致Zerotier在OpenVZ或者LXC架构下的虚拟机默认无法使用( ...
  • 技术小絮
397 0
xosadmin
xosadmin
2 years ago
推荐 如何使用Directadmin借助Let’s Encrypt签发Wildcard SSL证书
Directadmin是一个由加拿大JBMC开发的强大的虚拟主机面板。在新版本中,Directadmin支持通过Let’s Encrypt签发Wildcard证书(泛域证书)。该证书的签发方式为DNS验证。在本篇文章中,将以Cl ...
  • 技术小絮
293 0
xosadmin
xosadmin
6 years ago
推荐 借助树莓派将IP2780变网络打印机
近日,因为一些方面的需求,X-osadmin购入了iP2780喷墨打印机。但是iP2780的设计使其无法使用网络功能。换句话说,无法通过网络发现该台打印机,也无法通过网络发送打印指令使其开始打印,仅能使用USB连接计算机进行打印操作。但是 ...
  • 技术小絮
1,821 0
  • HPE Microserver系列降低噪音的一种办法
  • Debian 13 Trixie安装Proxmox VE
  • Windows FTP服务器通过PASV模式无法获取目录的解决方法
  • Proxmox日志出现大量lxcfs truncated错误的解决方案
  • Proxmox通过CLI向LXC挂载已有虚拟磁盘的方法
  • LXC上安装Gitlab时sysctl报错的解决方法

文章聚合

  • Debian 13 Trixie安装Proxmox VE
  • Proxmox日志出现大量lxcfs truncated错误的解决方案
  • Proxmox通过CLI向LXC挂载已有虚拟磁盘的方法
  • Proxmox VE通过全盘方式直通硬盘
  • Proxmox为KVM VNC启用剪贴板支持
  • Proxmox报出RRDC/RRD update error的解决方法

Multilangual Translator

Copyright © 2016-2025 X-osadminの自留地. All rights reserved. 萌ICP备20258855号
  • 博客主页 HomePage
  • 技术小絮 Tech
  • 作品发布 Works
  • 软件专题 Softs
    • proxmox
    • openwrt
    • chromebook
    • Zerotier
    • 虚拟化
  • 友情链接 Following
Welcome
Forgot password?
Welcome
Forgot password?
Social Login
Login with WeChat QR Code
Unregistered WeChat IDs will be automatically used to create an account.
Scan and Reply with Keywords「登录」Get Verification Code
Social Login
Free registration
Social Login
Reset password
Back to Login