今天在linux服务器上编译安装升级了下qemu,升级命令如下:

root@ubuntu:/opt/qemu-2.0.# ./configure  --prefix=/usr/local/ --target-list=x86_64-softmmu
root@ubuntu:/opt/qemu-2.0.# make
root@ubuntu:/opt/qemu-2.0.# make install

顺利编译安装后,去define了一个虚拟机,结果报了如下错误:

root@ubuntu:~# virsh define test.xml
error: Failed to define domain from test.xml
error: unknown OS type hvm

好奇怪,便查看了下domain capabilities,命令:

root@ubuntu:~# virsh capabilities
<capabilities> <host>
<uuid>44454c4c-4e00---b2c04f5a3258</uuid>
<cpu>
<arch>x86_64</arch>
<model>Nehalem</model>
<vendor>Intel</vendor>
<topology sockets='' cores='' threads=''/>
<feature name='rdtscp'/>
<feature name='dca'/>
<feature name='xtpr'/>
<feature name='tm2'/>
<feature name='est'/>
<feature name='vmx'/>
<feature name='ds_cpl'/>
<feature name='monitor'/>
<feature name='pbe'/>
<feature name='tm'/>
<feature name='ht'/>
<feature name='ss'/>
<feature name='acpi'/>
<feature name='ds'/>
<feature name='vme'/>
</cpu>
<power_management/>
<migration_features>
<live/>
<uri_transports>
<uri_transport>tcp</uri_transport>
</uri_transports>
</migration_features>
<topology>
<cells num=''>
<cell id=''>
<cpus num=''>
<cpu id=''/>
<cpu id=''/>
<cpu id=''/>
<cpu id=''/>
</cpus>
</cell>
<cell id=''>
<cpus num=''>
<cpu id=''/>
<cpu id=''/>
<cpu id=''/>
<cpu id=''/>
</cpus>
</cell>
</cells>
</topology>
</host> </capabilities>

跟正常情况下相比,发现少了<guest> 段落,下面贴下正常情况下的domain capabilities的情况:

<capabilities>

  <host>
<uuid>01192eea--cb11-a16c-f9dcbe14b1ee</uuid>
<cpu>
<arch>x86_64</arch>
<model>Westmere</model>
<vendor>Intel</vendor>
<topology sockets='' cores='' threads=''/>
<feature name='invpcid'/>
<feature name='erms'/>
<feature name='bmi2'/>
<feature name='smep'/>
<feature name='avx2'/>
<feature name='bmi1'/>
<feature name='fsgsbase'/>
<feature name='abm'/>
<feature name='rdtscp'/>
<feature name='pdpe1gb'/>
<feature name='rdrand'/>
<feature name='f16c'/>
<feature name='avx'/>
<feature name='osxsave'/>
<feature name='xsave'/>
<feature name='tsc-deadline'/>
<feature name='movbe'/>
<feature name='pcid'/>
<feature name='pdcm'/>
<feature name='xtpr'/>
<feature name='fma'/>
<feature name='tm2'/>
<feature name='est'/>
<feature name='vmx'/>
<feature name='ds_cpl'/>
<feature name='monitor'/>
<feature name='dtes64'/>
<feature name='pclmuldq'/>
<feature name='pbe'/>
<feature name='tm'/>
<feature name='ht'/>
<feature name='ss'/>
<feature name='acpi'/>
<feature name='ds'/>
<feature name='vme'/>
</cpu>
<power_management>
<suspend_mem/>
<suspend_disk/>
<suspend_hybrid/>
</power_management>
<migration_features>
<live/>
<uri_transports>
<uri_transport>tcp</uri_transport>
</uri_transports>
</migration_features>
<topology>
<cells num=''>
<cell id=''>
<memory unit='KiB'></memory>
<cpus num=''>
<cpu id='' socket_id='' core_id='' siblings='0-1'/>
<cpu id='' socket_id='' core_id='' siblings='0-1'/>
<cpu id='' socket_id='' core_id='' siblings='2-3'/>
<cpu id='' socket_id='' core_id='' siblings='2-3'/>
</cpus>
</cell>
</cells>
</topology>
<secmodel>
<model>none</model>
<doi></doi>
</secmodel>
<secmodel>
<model>dac</model>
<doi></doi>
<baselabel type='kvm'>+:+</baselabel>
<baselabel type='qemu'>+:+</baselabel>
</secmodel>
</host> <guest>
<os_type>hvm</os_type>
<arch name='i686'>
<wordsize>32</wordsize>
<emulator>/usr/bin/qemu-system-i386</emulator>
<machine canonical='pc-i440fx-trusty' maxCpus='255'>pc</machine>
<machine maxCpus='255'>pc-0.12</machine>
<machine maxCpus='255'>pc-1.3</machine>
<machine maxCpus='255'>pc-q35-1.6</machine>
<machine canonical='pc-1.0-qemu-kvm' maxCpus='255'>pc-1.0-precise</machine>
<machine maxCpus='255'>pc-q35-1.5</machine>
<machine maxCpus='1'>xenpv</machine>
<machine maxCpus='255'>pc-i440fx-1.6</machine>
<machine maxCpus='255'>pc-i440fx-1.7</machine>
<machine maxCpus='255'>pc-0.11</machine>
<machine maxCpus='255'>pc-0.10</machine>
<machine maxCpus='255'>pc-1.2</machine>
<machine maxCpus='1'>isapc</machine>
<machine maxCpus='255'>pc-q35-1.4</machine>
<machine maxCpus='128'>xenfv</machine>
<machine maxCpus='255'>pc-0.15</machine>
<machine maxCpus='255'>pc-0.14</machine>
<machine maxCpus='255'>pc-i440fx-1.5</machine>
<machine canonical='pc-q35-2.0' maxCpus='255'>q35</machine>
<machine maxCpus='255'>pc-i440fx-1.4</machine>
<machine maxCpus='255'>pc-1.1</machine>
<machine maxCpus='255'>pc-q35-1.7</machine>
<machine canonical='pc-1.0' maxCpus='255'>pc-1.0-qemu-kvm</machine>
<machine maxCpus='255'>pc-i440fx-2.0</machine>
<machine maxCpus='255'>pc-0.13</machine>
<domain type='qemu'>
</domain>
<domain type='kvm'>
<emulator>/usr/bin/qemu-system-i386</emulator>
</domain>
</arch>
<features>
<cpuselection/>
<deviceboot/>
<acpi default='on' toggle='yes'/>
<apic default='on' toggle='no'/>
<pae/>
<nonpae/>
</features>
</guest> <guest>
<os_type>hvm</os_type>
<arch name='x86_64'>
<wordsize>64</wordsize>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<machine canonical='pc-i440fx-trusty' maxCpus='255'>pc</machine>
<machine maxCpus='255'>pc-1.3</machine>
<machine maxCpus='255'>pc-0.12</machine>
<machine maxCpus='255'>pc-q35-1.6</machine>
<machine canonical='pc-1.0-qemu-kvm' maxCpus='255'>pc-1.0-precise</machine>
<machine maxCpus='255'>pc-q35-1.5</machine>
<machine maxCpus='1'>xenpv</machine>
<machine maxCpus='255'>pc-i440fx-1.6</machine>
<machine maxCpus='255'>pc-i440fx-1.7</machine>
<machine maxCpus='255'>pc-0.11</machine>
<machine maxCpus='255'>pc-1.2</machine>
<machine maxCpus='255'>pc-0.10</machine>
<machine maxCpus='1'>isapc</machine>
<machine maxCpus='255'>pc-q35-1.4</machine>
<machine maxCpus='128'>xenfv</machine>
<machine maxCpus='255'>pc-0.15</machine>
<machine maxCpus='255'>pc-0.14</machine>
<machine maxCpus='255'>pc-i440fx-1.5</machine>
<machine maxCpus='255'>pc-i440fx-1.4</machine>
<machine canonical='pc-q35-2.0' maxCpus='255'>q35</machine>
<machine maxCpus='255'>pc-1.1</machine>
<machine maxCpus='255'>pc-q35-1.7</machine>
<machine canonical='pc-1.0' maxCpus='255'>pc-1.0-qemu-kvm</machine>
<machine maxCpus='255'>pc-i440fx-2.0</machine>
<machine maxCpus='255'>pc-0.13</machine>
<domain type='qemu'>
</domain>
<domain type='kvm'>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
</domain>
</arch>
<features>
<cpuselection/>
<deviceboot/>
<acpi default='on' toggle='yes'/>
<apic default='on' toggle='no'/>
</features>
</guest> </capabilities>

这时问题就很明显了,肯定是升级qemu时哪里出现了问题,经过多次尝试,终于发现了原因:我们需要将 qemu-system-x86_64 安装在 /usr/bin/ 目录下才能正常define虚拟机

然后再次重新编译升级qemu,指定 prefix=/usr/即可,命令如下:

root@ubuntu:/opt/qemu-2.0.# ./configure  --prefix=/usr/ --target-list=x86_64-softmmu
root@ubuntu:/opt/qemu-2.0.# make
root@ubuntu:/opt/qemu-2.0.# make install

然后删除原来/usr/local/bin/目录下残留的qemu-*文件即可。

[virsh] error: unknown OS type hvm解决办法的更多相关文章

  1. error: unkown OS type hvm 解决方法 kvm libvirtd 重新加载已有虚拟机信息

    想验证下最新版本的qemu的一些功能,于是将其从qemu-0.12升级到了qemu-1.4,编译安装一切都很顺利,但是当创建virtual machine时,报错如下: [root@compute-- ...

  2. adb无法使用,提示error: unknown host service的解决办法

    此时,需要辨别电脑的5037端口被哪个应用程序占用的方法:(使用adb时需要5037端口是空闲的) 1. 打开命令行,输入命令:netstat -ano |findstr "5037&quo ...

  3. Ubuntu urllib2.URLError:<urlopen error unknown url type:https>

    描述: python中urllib2 下载网页时,出现错误urllib2.URLError:<urlopen error unknown url type:https> 解决方法: pyt ...

  4. CAS (10) —— JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法

    CAS (10) -- JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法 jboss版本: jb ...

  5. VS2010出现FileTracker : error FTK1011编译错误的解决办法

    VS2010出现FileTracker : error FTK1011不知道是不是vs2010的一个bug,反正有人提交了. FileTracker : error FTK1011编译错误的解决办法有 ...

  6. 安装程序无法打开注册表项 UNKNOWN\Components\…的简单解决办法(转)

    安装程序无法打开注册表项 UNKNOWN\Components\…的简单解决办法 2018年04月16日 16:41:32 super_star_贤 阅读数:7193   在安装软件时(比如安装SQL ...

  7. fatal: read error: Connection reset by peer解决办法

    标签(空格分隔): ceph源码安装,git 问题描述: 源码安装ceph,克隆代码时提示如下错误: [root@localhost ~]# git clone git://github.com/ce ...

  8. GitHub提示 Error: Key already in use解决办法

    GitHub提示 Error: Key already in use解决办法GitHub提示 Error: Key already in use解决办法2014年09月05日 ⁄ 综合 ⁄ 共 290 ...

  9. Attribute "not-null" must be declared for element type "property"解决办法

    Attribute "not-null" must be declared for element type "property"解决办法 在hiberante ...

随机推荐

  1. 当进入log文件后就卡机

     问题:一个目录打开,终端就卡死不动了 Ctrl+c也没用,cat一样没用? 解决办法:用的时间或用的数量删除(时间已经否决掉) ls -t |tail -1000 |xargs rm 原因: log ...

  2. C/S端开发问题汇总

    0.先推荐几款工具,连接远程客户端DameWare Mini Remote Control,搜索本地文件Everything,以及sysinternals的系列工具: FileMon-监视所有文件修改 ...

  3. 【第40套模拟题】【noip2011_mayan】解题报告【map】【数论】【dfs】

    目录:1.潜伏者 [map] 2.Hankson的趣味题[数论]3.mayan游戏[dfs] 题目: 1. 潜伏者(spy.pas/c/cpp)[问题描述]R 国和S 国正陷入战火之中,双方都互派间谍 ...

  4. bzoj 1036 Tree Count

    题目大意:给出一棵树,每个点有一个权值,要求三种操作:1.修改某个点的权值,2.询问x到y路径上各点的权值最大值,3.询问x到y路径上各点的权值之和. #include <cstdio> ...

  5. 单位服务器发布tomcat的项目外网访问

    首先 要有 外网IP  路由器做设置  开放端口(netstat -nao) 首先你要确定你有一个外网ip地址.如果你分配到的是一个局域网IP地址需要经过一系列的转换为外网ip地址 跟部署tomcat ...

  6. 企业需要k2来解放孤岛危机

    当我谈孤岛危机时,我谈些什么?你以为我要说的是一款风靡的游戏?那恐怕要让你失望了,今天要谈的是“企业管理体系孤岛”,但更多人甚至都没意识到这是危机. 下面的场景,也许你会觉得似曾相识. 场景一 某制鞋 ...

  7. Android 插入图片到媒体库

    今天介绍一下在Android中怎么插入图片到媒体库,下面看代码: final String titleName = Function.md5(imageUri.toLowerCase()) + &qu ...

  8. C语言中动态分配数组

    如何动态的定义及使用数组呢?记得一般用数组的时候都是先指定大小的.当时问老师,老师说是不可以的.后来又问了一位教C++的老师,他告诉我在C++里用new可以做到,一直不用C++,所以也不明白.今天在逛 ...

  9. Volatile vs VolatileRead/Write?

    You should never use Thread.VolatileRead/Write(). It was a design mistake in .NET 1.1, it uses a ful ...

  10. IOS界面切换

    好吧!表示这几天要实现  phonegap 打开IOS原生界面,因此也查询了一些方案. 有如下几种: 第一种:navigationcontroller //进入下层 [self.navigationC ...