今天在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. Linux创建LVM

    ###########format disk############ 格式化磁盘,将其SystemId修改为8e fdisk /dev/sdb n p 1 [enter] [enter] t 8e w ...

  2. Jquery.Page.js 分页插件的使用

    1.简单直接贴代码 需要引用以下样式和脚本 <link href="~/Scripts/Page/pager.css" rel="stylesheet" ...

  3. GUID

    前言 全局唯一标识符,简称GUID(发音为 /ˈɡuːɪd/或/ˈɡwɪd/),是一种由算法生成的唯一标识,通常表示成32个16进制数字(0-9,A-F)组成的字符串,如:{21EC2020-3AEA ...

  4. JS访问剪切板中的图片

    google出来一个html2canvas,它利用canvas来渲染读取的DOM树,也就是说它只能截取document里的内容,如果要像qq截图那样,应该怎么做?用过百度的Ueditor编辑器的朋友都 ...

  5. ubuntu 14.04 安装 foxit pdf阅读器

    1.官网下载 http://www.foxitsoftware.cn/downloads/ 2.安装 tar -zxvf FoxitReader1.01.0925_Server_x64_enu_Set ...

  6. jquery判断多选框是否选中

    if($("#xieyi").is(":checked")){ alert('选中'); }else{ alert('没有选中') }

  7. 1、ViewModel类的构建和INoyifyPropertyChanged的应用

    public class SampleItem : INotifyPropertyChanged { public SampleItem() { } private string title; pub ...

  8. HDU 5382 莫比乌斯反演

    题目大意: 求S(n)的值 n<=1000000 这是官方题解给出的推导过程,orz,按这上面说的来写,就不难了 这里需要思考的就是G(n)这个如何利用积性函数的性质线性筛出来 作为一个质数,那 ...

  9. Dom事件初步了解

    1.事件流 事件流可以分为两种:事件冒泡和事件捕获 1. 事件冒泡就是从目标元素一直冒泡到根元素html(IE和DOM浏览器都有) 2. 事件捕获就是从根元素到目标元素(DOM浏览器支持) 2.事件处 ...

  10. Twitter CEO:有望进军中国 不会改变原则

    新浪科技讯 8月12日下午消息,据台湾“中央社”报道,Twitter CEO科斯特洛(Dick Costolo)日前接受<日经新闻>专访时指出,Twitter有望进军中国大陆,科斯特洛表示 ...