centos6 升级libvirt qemu

简介:

前言:libvirt和qemu 在centos6 的版本太老,需要升级

一、libvirt rpm安装,相关包可以去url下载。(行尾提供)。另外,老外已经做了个repo 源,直接用也可以。

https://copr.fedorainfracloud.org/coprs/mclarkson/libvirt-1.2.18/ 

1
2
3
curl -o  /etc/yum .repos.d /libvirt-1 .2.18.repo \
     https: //copr .fedoraproject.org /coprs/mclarkson/libvirt-1 .2.18 /repo/epel-6/mclarkson-libvirt-1 .2.18-epel-6.repo
yum  install  libvirt-1.2.18

libvirt.repo

1
2
3
4
5
6
7
8
[mclarkson-libvirt-1.2.18]
name=Copr repo  for  libvirt-1.2.18 owned by mclarkson
baseurl=https: //copr-be .cloud.fedoraproject.org /results/mclarkson/libvirt-1 .2.18 /epel-6- $basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https: //copr-be .cloud.fedoraproject.org /results/mclarkson/libvirt-1 .2.18 /pubkey .gpg
enabled=1
enabled_metadata=1

rpm 下载URL:http://down.51cto.com/data/2196150


二、升级qemu版本

原因:升级libvirt后,启用虚拟机会报错,主要是qemu版本太低

报错:

unable to execute QEMU command 'qom-list'

qemu 需要编译安装

2.1 去官方下载qemu源码


编译前要安装依赖库

1
yum  install  glib-devel glibc-devel glib2-devel


1
2
3
4
5
6
wget http: //wiki .qemu-project.org /download/qemu-1 .5.3. tar .bz2
tar  -jxf qemu-1.5.3. tar .bz2
cd  qemu-1.5.3
. /configure  -- enable -kvm -- enable -user -- enable -linux-user -- enable -guest-base -- enable -vnc -- enable -guest-agent 
make  -j 10
make  install

2.2 qemu编译参数说明:

只支持x86_64架构:--target-list=x86_64-softmmu

如果不添加,默认编译所有平台

参数可以通过命令查看 ./confiugre --help

多cpu同时编译  : make -j 10


2.3 软链命令

原因:从1.3开始,qemu-kvm功能全部整合到qemu。

1
ln  -s  /usr/local/bin/qemu-system-x86_64  /usr/libexec/qemu-kvm

  


2.4 如何兼容已有kvm:

centos本身自带的qemu已经修改了支持的机器类型:

1
2
3
4
5
6
7
8
9
10
11
12
13
/usr/libexec/qemu-kvm  -M ?
Supported machines are:
pc         RHEL 6.6.0 PC ( alias  of rhel6.6.0)
rhel6.6.0  RHEL 6.6.0 PC (default)
rhel6.5.0  RHEL 6.5.0 PC
rhel6.4.0  RHEL 6.4.0 PC
rhel6.3.0  RHEL 6.3.0 PC
rhel6.2.0  RHEL 6.2.0 PC
rhel6.1.0  RHEL 6.1.0 PC
rhel6.0.0  RHEL 6.0.0 PC
rhel5.5.0  RHEL 5.5.0 PC
rhel5.4.4  RHEL 5.4.4 PC
rhel5.4.0  RHEL 5.4.0 PC

但是自己编译的qemu 类型如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/usr/libexec/qemu-kvm  -M ?
Supported machines are:
pc                   Standard PC ( alias  of pc-1.2)
pc-1.2               Standard PC (default)
pc-1.1               Standard PC
pc-1.0               Standard PC
pc-0.15              Standard PC
pc-0.14              Standard PC
pc-0.13              Standard PC
pc-0.12              Standard PC
pc-0.11              Standard PC, qemu 0.11
pc-0.10              Standard PC, qemu 0.10
isapc                ISA-only PC
none                 empty machine

这要修改qemu的源码,去添加RHEL,否则旧有的kvm会启动报错

1
libvirtError: internal error: process exited  while  connecting to monitor: qemu-kvm: -machine rhel6.4.0,accel=kvm,usb=off: Unsupported machine  type

ps:本人技术有限,源码没找到哪里改。哪位大神能告知??


2.5 曲线救国

修改已有的kvm.xml,去掉machine='rhel****',或者替换为pc-1.2

1
  < type  arch= 'x86_64'  machine= 'pc-1.2' >hvm< /type >
本文转自银狐博客51CTO博客,原文链接http://blog.51cto.com/foxhound/1751331如需转载请自行联系原作者

战狐
相关文章
|
3月前
|
安全 Linux
CentOS7下快速升级至OpenSSH9.4p1安全版本
CentOS7下快速升级至OpenSSH9.4p1安全版本
130 1
|
3月前
|
安全 Linux Shell
CentOS7下快速升级至OpenSSH9.3p2安全版本
CentOS7下快速升级至OpenSSH9.3p2安全版本
147 0
|
9月前
|
Linux
Linux Centos7 下升级openssh1.1.1u版本
Linux Centos7 下升级openssh1.1.1u版本
237 0
|
7月前
|
安全 Linux
Centos 7.x 升级内核
千万不要小瞧这操作。
179 0
|
2月前
|
SQL Linux Shell
centos yum 升级 glibc
在 CentOS 上使用 YUM 升级 GLIBC 库需要谨慎操作,因为 GLIBC 库是系统的基础组件,错误的升级可能导致系统不稳定或与现有应用程序不兼容。 以下是升级 GLIBC 库的步骤: 1. 备份重要数据:在执行任何系统级更改之前,请确保备份重要的数据和配置文件,以防止数据丢失或配置错误。 2. 更新系统:使用 YUM 更新系统软件包,确保系统是最新的稳定版本。可以使用以下命令进行更新: ```sql sudo yum update ``` 3. 备份 GLIBC 库:在升级之前,建议备份当前的 GLIBC 库。可以使用以下命令进行备份: ```bash sudo cp
564 0
|
7月前
|
Linux
百度搜索:蓝易云【Centos8升级到Centos 8 stream教程。】
CentOS 8 stream 是 CentOS 8 的下一代版本,它采用的是“滚动发布”的方式,即在 CentOS 8.4 发布后,每个组件的更新都将立即推送给用户,而不是等到下一个大版本发布。
101 1
|
3月前
Centos7.6 cmake版本升级至3.21.0
Centos7.6 cmake版本升级至3.21.0
|
3月前
|
C语言
Centos7.6 gcc 4.8升级至7.3
Centos7.6 gcc 4.8升级至7.3
|
8月前
|
Linux Anolis 芯片
centos升级龙蜥
centos升级龙蜥
484 0
|
9月前
|
Java Linux Shell
centos7内网离线安装face_recognition、python、pip、CMake、dlib,离线升级gcc/切换gcc,文末有face_recognition的docker版本
公司项目需要人脸识别,本来app自带人脸识别,结果api支持的设备试了一圈就一个同事的华为Mate40Pro可以,所以使用无望。接着找了一下免费的java离线人脸识别sdk,发现虹软的确实简单好用,一会就在linux上弄好并测试通过了,然而在准备集成进去开写代码时,不小心看到了一眼首次激活需联网,后续方可离线使用,好吧,我们内网机器首次都不可能的,接着看了下离线激活方法,首先需要企业认证,这一步我们肯定没法做的,毕竟不是之前的小公司了,营业执照啥的随便给我肯定不行,直接放弃了。后来在同事推荐下看了下face_recognition这个项目,之前基本没用过python,于是有了漫长的踩坑之旅。
347 1

热门文章

最新文章