{"id":9,"date":"2026-01-26T01:18:01","date_gmt":"2026-01-25T17:18:01","guid":{"rendered":"https:\/\/fslbr.cn\/?p=9"},"modified":"2026-01-26T01:18:02","modified_gmt":"2026-01-25T17:18:02","slug":"ubuntu20-04-%e5%ae%89%e8%a3%85-kvm-qemu","status":"publish","type":"post","link":"https:\/\/fslbr.cn\/?p=9","title":{"rendered":"ubuntu20.04 \u5b89\u88c5 KVM\/QEMU"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1.\u67e5\u770b\u5904\u7406\u5668\u662f\u5426\u652f\u6301\u786c\u4ef6\u865a\u62df\u5316\uff1a<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -Eoc '(vmx|svm)' \/proc\/cpuinfo<\/code><\/pre>\n\n\n\n<p>\u5982\u679cCPU\u652f\u6301\u786c\u4ef6\u865a\u62df\u5316\uff0c\u5219\u8be5\u547d\u4ee4\u5c06\u8f93\u51fa\u4e00\u4e2a\u5927\u4e8e\u96f6\u7684\u6570\u5b57\uff0c\u5373CPU\u6838\u5fc3\u7684\u6570\u91cf\u3002\u5426\u5219\uff0c\u5982\u679c\u8f93\u51fa\u662f\uff0c0\u5219\u8868\u793aCPU\u4e0d\u652f\u6301\u786c\u4ef6\u865a\u62df\u5316\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2.\u9a8c\u8bc1BIOS\u4e2d\u662f\u5426\u7981\u7528\u865a\u62df\u6280\u672f<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update -y\nsudo apt install cpu-checker -y\nkvm-ok<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u672a\u5728BIOS\u4e2d\u7981\u7528\u5904\u7406\u5668\u865a\u62df\u5316\u529f\u80fd\uff0c\u5219\u8f93\u51fa\u5c06\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>INFO: \/dev\/kvm exists<br>KVM acceleration can be used<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">3.\u6ee1\u8db3\u4ee5\u4e0a\u540e\u53ef\u4ee5\u5f00\u59cb\u88c5KVM\u548c\u5176\u4ed6\u865a\u62df\u5316\u7ba1\u7406\u8f6f\u4ef6\u5305<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virtinst virt-manager<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-code\"><code>qemu-kvm -\u4e3aKVM\u7ba1\u7406\u7a0b\u5e8f\u63d0\u4f9b\u786c\u4ef6\u4eff\u771f\u7684\u8f6f\u4ef6\u3002\nlibvirt-daemon-system -\u7528\u4e8e\u5c06libvirt\u5b88\u62a4\u7a0b\u5e8f\u4f5c\u4e3a\u7cfb\u7edf\u670d\u52a1\u8fd0\u884c\u7684\u914d\u7f6e\u6587\u4ef6\u3002\nlibvirt-clients -\u7528\u4e8e\u7ba1\u7406\u865a\u62df\u5316\u5e73\u53f0\u7684\u8f6f\u4ef6\u3002\nbridge-utils -\u4e00\u7ec4\u7528\u4e8e\u914d\u7f6e\u4ee5\u592a\u7f51\u6865\u7684\u547d\u4ee4\u884c\u5de5\u5177\u3002\nvirtinst -\u4e00\u7ec4\u7528\u4e8e\u521b\u5efa\u865a\u62df\u673a\u7684\u547d\u4ee4\u884c\u5de5\u5177\u3002\nvirt-manager -\u6613\u4e8e\u4f7f\u7528\u7684GUI\u754c\u9762\u548c\u652f\u6301\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u4e8e\u901a\u8fc7libvirt\u7ba1\u7406\u865a\u62df\u673a\u3002<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u8f6f\u4ef6\u5305\u540e\uff0clibvirt\u5b88\u62a4\u7a0b\u5e8f\u5c06\u81ea\u52a8\u542f\u52a8\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u952e\u5165\u4ee5\u4e0b\u5185\u5bb9\u8fdb\u884c\u9a8c\u8bc1\uff1a<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl is-active libvirtd<\/code><\/pre>\n\n\n\n<p>\u8f93\u51fa\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>active<\/p>\n<\/blockquote>\n\n\n\n<p>\u4e3a\u4e86\u80fd\u591f\u521b\u5efa\u548c\u7ba1\u7406\u865a\u62df\u673a\uff0c\u60a8\u9700\u8981\u5c06\u7528\u6237\u6dfb\u52a0\u5230\u201c libvirt\u201d\u548c\u201c kvm\u201d\u7ec4\u4e2d\u3002\u4e3a\u6b64\uff0c\u8bf7\u8f93\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -aG libvirt $USER\nsudo usermod -aG kvm $USER<\/code><\/pre>\n\n\n\n<p>$USER \u662f\u4e00\u4e2a\u73af\u5883\u53d8\u91cf\uff0c\u5176\u4e2d\u5305\u542b\u5f53\u524d\u767b\u5f55\u7528\u6237\u7684\u540d\u79f0\u3002<\/p>\n\n\n\n<p>\u6ce8\u9500\u5e76\u91cd\u65b0\u767b\u5f55\uff0c\u4ee5\u4fbf\u5237\u65b0\u7ec4\u6210\u5458\u8eab\u4efd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u67e5\u770b\u5904\u7406\u5668\u662f\u5426\u652f\u6301\u786c\u4ef6\u865a\u62df\u5316\uff1a \u5982\u679cCPU\u652f\u6301\u786c\u4ef6\u865a\u62df\u5316\uff0c\u5219\u8be5\u547d\u4ee4\u5c06\u8f93\u51fa\u4e00\u4e2a\u5927\u4e8e\u96f6\u7684\u6570\u5b57\uff0c\u5373CPU\u6838\u5fc3\u7684\u6570 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/fslbr.cn\/index.php?rest_route=\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fslbr.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fslbr.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fslbr.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fslbr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9"}],"version-history":[{"count":1,"href":"https:\/\/fslbr.cn\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":10,"href":"https:\/\/fslbr.cn\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions\/10"}],"wp:attachment":[{"href":"https:\/\/fslbr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fslbr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fslbr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}