{"id":502,"date":"2012-06-09T13:12:04","date_gmt":"2012-06-09T05:12:04","guid":{"rendered":"http:\/\/ykyi.net\/?p=502"},"modified":"2012-06-09T13:12:04","modified_gmt":"2012-06-09T05:12:04","slug":"kvm%e4%bd%a0%e9%97%ae%e6%88%91%e7%ad%94faq-%e4%b8%80","status":"publish","type":"post","link":"https:\/\/ykyi.net\/?p=502","title":{"rendered":"KVM\u4f60\u95ee\u6211\u7b54FAQ (\u4e00)"},"content":{"rendered":"<h3 dir=\"ltr\">\u4f7f\u7528KVM\u9700\u8981\u54ea\u4e9b\u51c6\u5907\uff1f<\/h3>\n<p><strong><strong>\u4f60\u9700\u8981\u4e00\u53f0\u8fd0\u884cLinux\u7684x86\u7684\u673a\u5668\u3002\u5b83\u7684CPU\u662f\u6709VT\u6280\u672f\u652f\u6301\u7684\u82f1\u7279\u5c14cpu\u6216\u8005\u6709SVM\uff08\u53c8\u5e38\u88ab\u79f0\u4e3aAMD-V\uff09\u652f\u6301\u7684AMD\u7684CPU.<br \/>\n<\/strong><\/strong><\/p>\n<hr \/>\n<p><strong><strong><br \/>\n<\/strong><\/strong><\/p>\n<h3 dir=\"ltr\">KVM\u652f\u630164\u4f4d\u7684\u5904\u7406\u5668\u5417\uff1f<\/h3>\n<p><strong><strong>KVM\u652f\u630164\u4f4d\u7684\u5904\u7406\u5668\uff01\u6b64\u65f6\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c32\u4f4d\u6216\u800564\u4f4d\u7684\u5ba2\u6237\u673a\u3002<br \/>\n<\/strong><\/strong><\/p>\n<hr \/>\n<p><strong><strong><br \/>\n<\/strong><\/strong><\/p>\n<h3 dir=\"ltr\">What is Intel VT \/ AMD-V \/ hvm?<\/h3>\n<p><strong><strong>\u82f1\u7279\u5c14VT\uff0c\u662f\u4ec0\u4e48\uff1fAMD-V\u53c8\u662f\u4ec0\u4e48\uff1fhvm\u662f\u4ec0\u4e48\uff1f<\/strong><\/strong><\/p>\n<p><a href=\"http:\/\/www.intel.com\/technology\/itj\/2006\/v10i3\/1-hardware\/6-vt-x-vt-i-solutions.htm\">Intel VT<\/a> \u548c<a href=\"http:\/\/www.amd.com\/us-en\/Processors\/ProductInformation\/0,,30_118_8826_14287,00.html\">AMD&#8217;s AMD-V<\/a> \u90fd\u6307\u7684\u662f\u6307\u4ee4\u96c6\u6269\u5c55\u3002\u5b83\u4eec\u5728\u786c\u4ef6\u5c42\u9762\u5e2e\u52a9\u5b9e\u73b0\u865a\u62df\u673a\u7ba1\u7406\u6280\u672f\u3002\u8fd9\u79cd\u6280\u672f\u4f7f\u5f97\u5728\u865a\u62df\u673a\u4e0a\u8fd0\u884c\u7684\u901f\u5ea6\u63a5\u8fd1\u76f4\u63a5\u5728\u771f\u5b9e\u673a\u5668\u4e0a\u8fd0\u884c\u7684\u901f\u5ea6\u3002HVM\u662f\u786c\u4ef6\u865a\u62df\u673a\u7684\u7f29\u5199(Hardware Virtual Machine )\u5219\u662f\u4e00\u4e2a\u751f\u4ea7\u5546\u4e2d\u7acb\u7684\u8bcd\u6c47(vendor-neutral term)\uff0c\u5b83\u5e38\u5e38\u7528\u6765\u6307\u4ee3x86\u6307\u5b9a\u96c6\u6269\u5c55\u3002<\/p>\n<hr \/>\n<p><strong><strong><br \/>\n<\/strong><\/strong><\/p>\n<h3 dir=\"ltr\">\u4ece\u54ea\u91cc\u5f97\u5230KVM\u5185\u6838\u6a21\u5757\u5462\uff1f<\/h3>\n<p><strong><strong>\u53ef\u4ee5\u4ece\u8fd9\u91cc\u83b7\u5f97 <a href=\"http:\/\/www.linux-kvm.org\/page\/Getting_the_kvm_kernel_modules\">http:\/\/www.linux-kvm.org\/page\/Getting_the_kvm_kernel_modules<\/a> \u3002<br \/>\n<\/strong><\/strong><\/p>\n<hr \/>\n<p><strong><strong><br \/>\n<\/strong><\/strong><\/p>\n<h3 dir=\"ltr\">\u6211\u5982\u4f55\u77e5\u9053\u6211\u7684CPU\u652f\u6301Intel VT\u6280\u672f\u6216\u8005AMD-V\u6280\u672f\u5462\uff1f<\/h3>\n<p><strong><strong>\u5982\u679c\u4f60\u7684Linux\u64cd\u4f5c\u7cfb\u7edf\u6bd4\u8f83\u65b0\uff0c\u5c1d\u8bd5\u4ee5\u4e0b\u7684\u6307\u4ee4\uff1a<br \/>\n. egrep &#8216;^flags.*(vmx|svm)&#8217; \/proc\/cpuinfo<\/strong><\/strong><\/p>\n<p>\u5982\u679c\u51fa\u73b0\u4e00\u4e9b\u6587\u5b57\uff0c\u90a3\u8bf4\u8bf4\u4f60\u7684CPU\u652f\u6301\u865a\u62df\u5316\u3002\u4f60\u4e5f\u53ef\u4ee5\u5728\/proc\/cpuinfo\u6587\u4ef6\u4e2d\u627e\u5230\u5904\u7406\u5668\u6a21\u5757\u7684\u540d\u5b57\uff0c\u7136\u540e\u5230\u4f9b\u5e94\u5546\u7684\u7f51\u7ad9\u4e0a\u67e5\u8be2\u3002<br \/>\n\u6ce8\u610f\uff1a<br \/>\n1. \u5982\u679c\u5b89\u88c5\u4e86Xen hypervisor\uff0c\u4e3a\u4e86\u9632\u6b62\u88ab\u52ab\u6301\uff0c\u4f60\u5728dom0\u548cdomU\u4e2d\u90fd\u5f97\u4e0d\u5230\u8fd9\u4e9b\u8f93\u51fa\u3002dom0\u548cdomU\u662fXen hypervisor\u7684\u672f\u8bed\u3002\u5982\u679c\u4f60\u6ca1\u6709\u5b89\u88c5Xen\uff0c\u76f4\u63a5\u5ffd\u7565\u3002<br \/>\n2. \u4e00\u4e9b\u4ea7\u5546\u9ed8\u8ba4\u5728BIOS\u5b9a\u8bbe\u4e2d\u7981\u7528\u4e86CPU\u7684\u865a\u62df\u5316\u652f\u6301\u3002\u4f60\u9700\u8981\u5148\u5728BIOS\u4e2d\u6253\u5f00\u865a\u62df\u5316\u652f\u6301\u3002<br \/>\n3. \u5982\u679c\u4f60\u7528\u7684\u662fintel cpu\uff0c\u5bf9\u4e8e\u5185\u6838\u7248\u672c2.6.15\u4ee5\u524d\u7684Linux\uff0c\u4f60\u5f97\u4e0d\u5230\u8fd9\u6837\u7684\u8f93\u51fa\u3002\u5982\u679c\u4f60\u7528\u7684\u662famd cpu\uff0c\u5bf9\u4e8e\u5185\u6838\u7248 \u672c2.6.16\u4ee5\u524d\u7684linux\uff0c\u4f60\u5f97\u4e0d\u5230\u8fd9\u6837\u7684\u8f93\u51fa\u3002\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u4f60\u7684Linux\u5185\u6838\u7248\u672c\uff0c\u7528#uname -r \u547d\u4ee4\u67e5\u770b\u3002<\/p>\n<hr \/>\n<p><strong><strong><br \/>\n<\/strong><\/strong><\/p>\n<h3 dir=\"ltr\">\u51fa\u73b0 &#8220;KVM: disabled by BIOS&#8221; error \u9519\u8bef<\/h3>\n<p><strong><strong>Check if there is an option to enable it in the BIOS. If not, look for a more recent BIOS on the vendor&#8217;s web site.<br \/>\n\u5728BIOS\u8bbe\u5b9a\u5728\u627e\u627e\u770b\u6709\u6ca1\u6709\u542f\u7528cpu\u865a\u62df\u5316\u7684\u9009\u9879\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u53bb\u5230\u4e3b\u677f\u5382\u5546\u7684\u7f51\u7ad9\u4e0a\u9762\u770b\u770b\u6709\u6ca1\u6709\u65b0\u7684BIOS\u53d1\u5e03\u5e76\u652f\u6301\u6253\u5f00cpu\u865a\u62df\u5316\uff0c\u90a3\u4e48\u4f60\u9700\u8981\u5237\u65b0BIOS.<br \/>\n\u6ce8\u610f\uff1a<br \/>\n1.\u5bf9\u4e8e\u90e8\u5206\u786c\u4ef6(\u5982 HP nx 6320)\uff0c\u4f60\u9700\u8981\u5148\u5173\u6389\u4e3b\u673a\u7535\u6e90\uff0c\u518d\u6253\u5f00\u4e3b\u673a\u7535\u6e90\u624d\u80fd\u4f7fBIOS\u4e2d\u542f\u7528cpu\u865a\u62df\u5316\u652f\u6301\u751f\u6548\u3002<br \/>\n2.BIOS\u7684\u90e8\u5206\u8bbe\u5b9a\u6709\u53ef\u80fd\u4e0e\u542f\u7528CPU\u865a\u62df\u5316\u51b2\u7a81\u3002\u6bd4\u5982\u5728Thinkpad T500\u4e0a\uff0c\u542f\u7528Intel AMT\u6280\u672f\u4f1a\u51fa\u73b0\u51b2\u7a81\u3002\u8fd9\u6837kvm-intel\u5728\u8f7d\u5165\u65f6\u4f1a\u62b1\u6028\u201ddisabled by bios\u201d\u9519\u8bef\u3002<br \/>\n3. \u5728\u4e00\u4e9bDell\u7684\u786c\u4ef6\u4e2d\uff0c\u4f60\u8fd8\u9700\u8981\u7981\u7528\u201dTrusted Execution\u201d\uff0c\u5426\u5219\u4e0d\u80fd\u6253\u5f00VT\u3002<\/strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><strong><strong><br \/>\n<\/strong><\/strong><\/p>\n<h3 dir=\"ltr\">\u4f60\u8be5\u600e\u4e48\u4f7f\u7528AMD-V\u6269\u5c55\u5462\uff1f<\/h3>\n<p><strong><strong>\u5728\u6839\u7528\u6237\u6743\u9650\u4e0b\u6572\u5165\uff1amodprobe kvm-amd<\/strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><strong><strong><br \/>\n<\/strong><\/strong><\/p>\n<h3 dir=\"ltr\">KVM\u4f7f\u7528\u4ec0\u4e48\u6837\u7684\u7528\u6237\u7a7a\u95f4\u5de5\u5177\u3002(User space tools)<\/h3>\n<p><strong><strong>KVM\u4f7f\u7528\u7a0d\u7a0d\u4fee\u6539\u8fc7\u7684QEMU\u4f5c\u4e3a\u7528\u6237\u7a7a\u95f4\u5de5\u5177\u6765\u7ba1\u7406\u521b\u5efa\u7684\u865a\u62df\u673a\u3002\u6267\u884cQEMU\u4ee5\u540e\uff0c\u4ecelinux\u5185\u6838\u7684\u89c6\u89d2\u6765\u770b\uff0c\u6bcf\u4e2a\u865a\u62df\u673a\u4ec5\u4ec5\u662f\u4e00\u4e2a\u666e\u901a\u7684\u8fdb\u7a0b\u3002\u4f60\u53ef\u4ee5\u7528\u7ecf\u5178\u7684Unix\u547d\u4ee4\uff0c\u5982top, kill, taskset\u7b49\u7b49\u6765\u64cd\u4f5c\u865a\u62df\u673a\u3002<br \/>\n<\/strong><\/strong><\/p>\n<hr \/>\n<p><strong><strong><br \/>\n<\/strong><\/strong><\/p>\n<h3 dir=\"ltr\">KVM\u4f7f\u7528\u4f55\u79cd\u7c7b\u578b\u7684\u865a\u62df\u78c1\u76d8\u3002<\/h3>\n<p><strong><strong>QEMU\u652f\u6301\u7684\u591a\u79cd\u78c1\u76d8\u683c\u5f0f\u5982raw images\uff0cqcow2(QEMU\u539f\u751f\u78c1\u76d8\u683c\u5f0f)\uff0cVMWARE format,\u7b49\u7b49\uff0cKVM\u90fd\u652f\u6301\uff08KVM inherits a wealth of disk formats support from QEMU\uff09\u3002<br \/>\n<\/strong><\/strong><\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528KVM\u9700\u8981\u54ea\u4e9b\u51c6\u5907\uff1f \u4f60\u9700\u8981\u4e00\u53f0\u8fd0\u884cLinux\u7684x86\u7684\u673a\u5668\u3002\u5b83\u7684CPU\u662f\u6709VT\u6280\u672f\u652f\u6301\u7684\u82f1\u7279\u5c14cpu\u6216\u8005\u6709SVM\uff08\u53c8\u5e38\u88ab\u79f0\u4e3aAMD-V\uff09\u652f\u6301\u7684AMD\u7684CPU. KVM\u652f\u630164\u4f4d\u7684\u5904\u7406\u5668\u5417\uff1f KVM\u652f\u630164\u4f4d\u7684\u5904\u7406\u5668\uff01\u6b64\u65f6\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c32\u4f4d\u6216\u800564\u4f4d\u7684\u5ba2\u6237\u673a\u3002 What is Intel VT \/ AMD-V \/ hvm? \u82f1\u7279\u5c14VT\uff0c\u662f\u4ec0\u4e48\uff1fAMD-V\u53c8\u662f\u4ec0\u4e48\uff1fhvm\u662f\u4ec0\u4e48\uff1f Intel VT \u548cAMD&#8217;s AMD-V \u90fd\u6307\u7684\u662f\u6307\u4ee4\u96c6\u6269\u5c55\u3002\u5b83\u4eec\u5728\u786c\u4ef6\u5c42\u9762\u5e2e\u52a9\u5b9e\u73b0\u865a\u62df\u673a\u7ba1\u7406\u6280\u672f\u3002\u8fd9\u79cd\u6280\u672f\u4f7f\u5f97\u5728\u865a\u62df\u673a\u4e0a\u8fd0\u884c\u7684\u901f\u5ea6\u63a5\u8fd1\u76f4\u63a5\u5728\u771f\u5b9e\u673a\u5668\u4e0a\u8fd0\u884c\u7684\u901f\u5ea6\u3002HVM\u662f\u786c\u4ef6\u865a\u62df\u673a\u7684\u7f29\u5199(Hardware Virtual Machine )\u5219\u662f\u4e00\u4e2a\u751f\u4ea7\u5546\u4e2d\u7acb\u7684\u8bcd\u6c47(vendor-neutral term)\uff0c\u5b83\u5e38\u5e38\u7528\u6765\u6307\u4ee3x86\u6307\u5b9a\u96c6\u6269\u5c55\u3002 \u4ece\u54ea\u91cc\u5f97\u5230KVM\u5185\u6838\u6a21\u5757\u5462\uff1f \u53ef\u4ee5\u4ece\u8fd9\u91cc\u83b7\u5f97 http:\/\/www.linux-kvm.org\/page\/Getting_the_kvm_kernel_modules \u3002 \u6211\u5982\u4f55\u77e5\u9053\u6211\u7684CPU\u652f\u6301Intel VT\u6280\u672f\u6216\u8005AMD-V\u6280\u672f\u5462\uff1f \u5982\u679c\u4f60\u7684Linux\u64cd\u4f5c\u7cfb\u7edf\u6bd4\u8f83\u65b0\uff0c\u5c1d\u8bd5\u4ee5\u4e0b\u7684\u6307\u4ee4\uff1a . egrep &#8216;^flags.*(vmx|svm)&#8217; \/proc\/cpuinfo \u5982\u679c\u51fa\u73b0\u4e00\u4e9b\u6587\u5b57\uff0c\u90a3\u8bf4\u8bf4\u4f60\u7684CPU\u652f\u6301\u865a\u62df\u5316\u3002\u4f60\u4e5f\u53ef\u4ee5\u5728\/proc\/cpuinfo\u6587\u4ef6\u4e2d\u627e\u5230\u5904\u7406\u5668\u6a21\u5757\u7684\u540d\u5b57\uff0c\u7136\u540e\u5230\u4f9b\u5e94\u5546\u7684\u7f51\u7ad9\u4e0a\u67e5\u8be2\u3002 \u6ce8\u610f\uff1a 1. \u5982\u679c\u5b89\u88c5\u4e86Xen hypervisor\uff0c\u4e3a\u4e86\u9632\u6b62\u88ab\u52ab\u6301\uff0c\u4f60\u5728dom0\u548cdomU\u4e2d\u90fd\u5f97\u4e0d\u5230\u8fd9\u4e9b\u8f93\u51fa\u3002dom0\u548cdomU\u662fXen hypervisor\u7684\u672f\u8bed\u3002\u5982\u679c\u4f60\u6ca1\u6709\u5b89\u88c5Xen\uff0c\u76f4\u63a5\u5ffd\u7565\u3002 2. \u4e00\u4e9b\u4ea7\u5546\u9ed8\u8ba4\u5728BIOS\u5b9a\u8bbe\u4e2d\u7981\u7528\u4e86CPU\u7684\u865a\u62df\u5316\u652f\u6301\u3002\u4f60\u9700\u8981\u5148\u5728BIOS\u4e2d\u6253\u5f00\u865a\u62df\u5316\u652f\u6301\u3002 3. \u5982\u679c\u4f60\u7528\u7684\u662fintel cpu\uff0c\u5bf9\u4e8e\u5185\u6838\u7248\u672c2.6.15\u4ee5\u524d\u7684Linux\uff0c\u4f60\u5f97\u4e0d\u5230\u8fd9\u6837\u7684\u8f93\u51fa\u3002\u5982\u679c\u4f60\u7528\u7684\u662famd cpu\uff0c\u5bf9\u4e8e\u5185\u6838\u7248 \u672c2.6.16\u4ee5\u524d\u7684linux\uff0c\u4f60\u5f97\u4e0d\u5230\u8fd9\u6837\u7684\u8f93\u51fa\u3002\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u4f60\u7684Linux\u5185\u6838\u7248\u672c\uff0c\u7528#uname -r \u547d\u4ee4\u67e5\u770b\u3002 \u51fa\u73b0 &#8220;KVM: disabled by BIOS&#8221; error \u9519\u8bef &hellip; <a href=\"https:\/\/ykyi.net\/?p=502\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;KVM\u4f60\u95ee\u6211\u7b54FAQ (\u4e00)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7,8],"tags":[48,52,122],"class_list":["post-502","post","type-post","status-publish","format-standard","hentry","category-tech_articles","category-unix_linux","category-virtualization","tag-kvm","tag-linux-kernel","tag--virtulization"],"_links":{"self":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=502"}],"version-history":[{"count":0,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/502\/revisions"}],"wp:attachment":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}