{"id":32671,"date":"2025-04-24T23:06:10","date_gmt":"2025-04-24T15:06:10","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/32671.html"},"modified":"2025-04-24T23:06:10","modified_gmt":"2025-04-24T15:06:10","slug":"%e9%93%b6%e6%b2%b3%e9%ba%92%e9%ba%9f%e9%ab%98%e7%ba%a7%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%ef%bc%88%e9%80%9a%e7%94%a8%ef%bc%89%e5%ae%89%e8%a3%85kvm%e5%92%8c%e5%88%9b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/32671.html","title":{"rendered":"\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a"},"content":{"rendered":"<\/p>\n<h4>\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf&#xff08;\u901a\u7528&#xff09;\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a<\/h4>\n<ul>\n<li>\n<ul>\n<li>\u4e00 KVM\u6982\u5ff5<\/li>\n<li>\u4e8c \u5b89\u88c5KVM\u7ec4\u4ef6<\/li>\n<li>\n<ul>\n<li>\n<ul>\n<li>2.1 \u5b89\u88c5KVM\u524d\u63d0<\/li>\n<li>2.2 KVM\u7ba1\u7406\u5de5\u5177<\/li>\n<li>2.3 KVM\u5b89\u88c5<\/li>\n<li>\n<ul>\n<li>2.3.1 \u5b89\u88c5kvm\u7ec4\u4ef6<\/li>\n<li>2.3.2 \u542f\u52a8\u670d\u52a1\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09 \u521b\u5efa&amp;\u7ba1\u7406\u865a\u62df\u673a<\/li>\n<li>\n<ul>\n<li>\n<ul>\n<li>3.1 \u521b\u5efa\u865a\u62df\u673a<\/li>\n<li>3.2 \u5b89\u88c5\u8fc7\u7a0b<\/li>\n<li>\n<ul>\n<li>3.2.1 \u9009\u62e9\u5b89\u88c5\u65b9\u5f0f<\/li>\n<li>3.2.2 \u9009\u62e9\u5b89\u88c5ISO\u6587\u4ef6<\/li>\n<li>3.2.3\u9009\u62e9\u5185\u5b58\u548cCPU\u8bbe\u7f6e<\/li>\n<li>3.2.4 \u914d\u7f6e\u5b58\u50a8\u6c60<\/li>\n<li>3.2.5 \u8bbe\u7f6e\u865a\u62df\u673a\u540d\u79f0\u53ca\u7f51\u7edc<\/li>\n<li>3.2.6 \u5b89\u88c5\u524d\u914d\u7f6e<\/li>\n<li>3.2.7 \u5f00\u59cb\u5b89\u88c5<\/li>\n<\/ul>\n<\/li>\n<li>3.3 \u901a\u8fc7virt-install\u8fdb\u884c\u5b89\u88c5<\/li>\n<li>\n<ul>\n<li>\n<ul>\n<li>3.3.1 \u53c2\u6570\u4ecb\u7ecd<\/li>\n<li>3.3.2 raw\u683c\u5f0f\u548cqcow2\u78c1\u76d8\u7c7b\u578b\u4ecb\u7ecd<\/li>\n<li>3.3.3 virt-install\u5b89\u88c5<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u4e00 KVM\u6982\u5ff5<\/h3>\n<p>\u200b Linux Kernel-based Virtual Machine (KVM) \u662f\u4e00\u6b3e Linux \u5f00\u653e\u6e90\u7801\u865a\u62df\u5316\u8f6f\u4ef6&#xff0c;\u57fa\u4e8e\u786c\u4ef6\u865a\u62df\u5316\u6269\u5c55&#xff08;Intel VT- X \u548c AMD-V&#xff09;\u548c QEMU \u7684\u4fee\u6539\u7248\u3002KVM \u7684\u5b9e\u73b0\u6a21\u5757\u53c8\u4e24\u4e2a&#xff0c;\u5206\u522b\u662f&#xff1a; kvm.ko\u662f\u63d0\u4f9b\u6838\u5fc3\u865a\u62df\u5316\u7684\u57fa\u7840\u67b6\u6784&#xff1b;\u7279\u5b9a\u4e8e\u5904\u7406\u5668\u7684\u6a21\u5757 kvm-intel.ko \u548c kvm-amd.ko \u3002\u5176\u8bbe\u8ba1\u76ee\u6807\u662f\u5728\u9700\u8981\u5f15\u5bfc\u591a\u4e2a\u672a\u6539\u52a8\u7684 PC \u64cd\u4f5c\u7cfb\u7edf\u65f6\u652f\u6301\u5b8c\u6574\u7684\u786c\u4ef6\u6a21\u62df\u3002 \u4e00\u4e2a\u666e\u901a\u7684linux\u8fdb\u7a0b\u6709\u4e24\u79cd\u8fd0\u884c\u6a21\u5f0f&#xff1a;\u5185\u6838\u548c\u7528\u6237\u3002\u800cKVM\u589e\u52a0\u4e86\u7b2c\u4e09\u79cd\u6a21\u5f0f&#xff1a;\u5ba2\u6237\u6a21\u5f0f&#xff08;\u6709\u81ea\u5df1\u7684\u5185\u6838\u548c\u7528\u6237\u6a21\u5f0f&#xff09;\u3002\u5728kvm\u6a21\u578b\u4e2d&#xff0c;\u6bcf\u4e00\u4e2a\u865a\u62df\u673a\u90fd\u662f\u7531linux\u8c03\u5ea6\u7a0b\u5e8f\u7ba1\u7406\u7684\u6807\u51c6\u8fdb\u7a0b\u3002<\/p>\n<p>kvm\u7531\u4e24\u4e2a\u90e8\u5206\u7ec4\u6210&#xff1a;\u4e00\u4e2a\u662f\u7ba1\u7406\u865a\u62df\u786c\u4ef6\u7684\u8bbe\u5907\u9a71\u52a8&#xff0c;\u8be5\u9a71\u52a8\u4f7f\u7528\u5b57\u7b26\u8bbe\u5907\/dev\/kvm\u4f5c\u4e3a\u7ba1\u7406\u63a5\u53e3&#xff1b;\u53e6\u4e00\u4e2a\u662f\u6a21\u62dfPC\u786c\u4ef6\u7684\u7528\u6237\u7a7a\u95f4\u7ec4\u4ef6&#xff0c;\u8fd9\u662f\u4e00\u4e2a\u7a0d\u4f5c\u4fee\u6539\u7684qemu\u8fdb\u7a0b\u3002 KVM \u6240\u652f\u6301\u7684\u529f\u80fd\u5305\u62ec&#xff1a; \u652f\u6301CPU \u548c memory \u8d85\u5206&#xff08;Overcommit&#xff09; \u652f\u6301\u534a\u865a\u62df\u5316I\/O &#xff08;virtio&#xff09; \u652f\u6301\u70ed\u63d2\u62d4&#xff08;cpu&#xff0c;\u5757\u8bbe\u5907\u3001\u7f51\u7edc\u8bbe\u5907\u7b49&#xff09; \u652f\u6301\u5bf9\u79f0\u591a\u5904\u7406&#xff08;Symmetric Multi-Processing&#xff0c;\u7f29\u5199\u4e3a SMP &#xff09; \u652f\u6301 PCI \u8bbe\u5907\u76f4\u63a5\u5206\u914d\u548c \u5355\u6839I\/O \u865a\u62df\u5316 &#xff08;SR-IOV&#xff09; \u652f\u6301 \u5185\u6838\u540c\u9875\u5408\u5e76 &#xff08;KSM &#xff09; \u652f\u6301 NUMA &#xff08;Non-Uniform Memory Access&#xff0c;\u975e\u4e00\u81f4\u5b58\u50a8\u8bbf\u95ee\u7ed3\u6784 &#xff09;<\/p>\n<h3>\u4e8c \u5b89\u88c5KVM\u7ec4\u4ef6<\/h3>\n<h5>2.1 \u5b89\u88c5KVM\u524d\u63d0<\/h5>\n<p>\u5728BIOS\u9700\u8981\u5f00\u542f\u865a\u62df\u673a\u652f\u6301<\/p>\n<h5>2.2 KVM\u7ba1\u7406\u5de5\u5177<\/h5>\n<p>Virt-manager \u56fe\u5f62\u5316\u7ba1\u7406\u5de5\u5177<\/p>\n<p>Virsh \u547d\u4ee4\u884c\u7ba1\u7406\u5de5\u5177<\/p>\n<p>Virt-clone \u514b\u9686\u5de5\u5177<\/p>\n<p>Virt-install \u5b89\u88c5\u5de5\u5177<\/p>\n<h5>2.3 KVM\u5b89\u88c5<\/h5>\n<h6>2.3.1 \u5b89\u88c5kvm\u7ec4\u4ef6<\/h6>\n<p>\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5<\/p>\n<p>yum <span class=\"token function\">install<\/span> libvirt* qemu* virt-manager <span class=\"token parameter variable\">-y<\/span><\/p>\n<h6>2.3.2 \u542f\u52a8\u670d\u52a1\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/h6>\n<p>\u542f\u52a8\u670d\u52a1&#xff1a;<br \/>\nsystemctl start libvirtd<br \/>\n\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8&#xff1a;<br \/>\nsystemctl <span class=\"token builtin class-name\">enable<\/span> libvirtd<\/p>\n<h3>\u4e09 \u521b\u5efa&amp;\u7ba1\u7406\u865a\u62df\u673a<\/h3>\n<h5>3.1 \u521b\u5efa\u865a\u62df\u673a<\/h5>\n<p>*\u540e\u7eed\u6b65\u9aa4\u5f88\u91cd\u8981&#xff0c;\u5426\u5219\u53ef\u80fd\u4f1a\u65e0\u6cd5\u521b\u5efa\u6210\u529f*<\/p>\n<p>\u6267\u884c\u547d\u4ee4virt-manager\u6253\u5f00KVM\u56fe\u5f62\u5316\u7ba1\u7406\u5de5\u5177<\/p>\n<h5>3.2 \u5b89\u88c5\u8fc7\u7a0b<\/h5>\n<h6>3.2.1 \u9009\u62e9\u5b89\u88c5\u65b9\u5f0f<\/h6>\n<p>\u8fd9\u91cc\u9009\u62e9\u672c\u5730\u6309\u5b89\u88c5 \u70b9\u51fb\u6587\u4ef6\u2013&gt;\u65b0\u5efa\u865a\u62df\u673a\u2013&gt;\u9009\u62e9\u672c\u5730\u5b89\u88c5\u4ecb\u8d28\u2013&gt;\u524d\u8fdb\u3002\u5982\u4e0b\u56fe1\u6240\u793a\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150608-680a536020235.png\" alt=\"\u56fe1 \u9009\u62e9\u5b89\u88c5\u65b9\u5f0f\" \/><\/p>\n<h6>3.2.2 \u9009\u62e9\u5b89\u88c5ISO\u6587\u4ef6<\/h6>\n<p>\u70b9\u51fb\u6d4f\u89c8&#xff0c;\u9009\u62e9ISO\u6587\u4ef6\u2013&gt;\u524d\u8fdb\u3002\u5982\u4e0b\u56fe2\u6240\u793a&#xff1b;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150608-680a536054ffd.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h6>3.2.3\u9009\u62e9\u5185\u5b58\u548cCPU\u8bbe\u7f6e<\/h6>\n<p>\u8bbe\u7f6e\u5206\u914d\u7ed9\u865a\u62df\u673a\u7684\u5185\u5b58\u5927\u5c0f\u548cCPU\u4e2a\u6570\u2013&gt;\u524d\u8fdb\u3002\u5982\u4e0b\u56fe3\u6240\u793a&#xff1b;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150608-680a53608715d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h6>3.2.4 \u914d\u7f6e\u5b58\u50a8\u6c60<\/h6>\n<p>\u65b9\u5f0f\u4e00&#xff1a;\u4e3a\u865a\u62df\u673a\u542f\u7528\u5b58\u50a8\u2013&gt;\u4e3a\u865a\u62df\u673a\u521b\u5efa\u78c1\u76d8\u955c\u50cf&#xff08;\u8bbe\u7f6e\u78c1\u76d8\u7a7a\u95f4\u5927\u5c0f&#xff0c;\u9ed8\u8ba4\u7684\u5b58\u50a8\u8def\u5f84\u4e3a\/var\/lib\/libvirt\/images&#xff09;\u2013&gt;\u524d\u8fdb&#xff1b;<\/p>\n<p>\u65b9\u5f0f\u4e8c&#xff1a;\u4e3a\u865a\u62df\u673a\u542f\u7528\u5b58\u50a8\u2013&gt;\u9009\u62e9\u6216\u521b\u5efa\u81ea\u5b9a\u4e49\u5b58\u50a8\u2013&gt;\u7ba1\u7406\u2013&gt;\u9009\u62e9default\u5b58\u50a8\u6c60\u2013&gt;\u6dfb\u52a0\u5377&#xff08;\u8bbe\u7f6e\u5377\u540d&#xff0c;\u5377\u5927\u5c0f&#xff0c;\u78c1\u76d8\u683c\u5f0f&#xff09;\u2013&gt;\u9009\u62e9\u5377\u2013&gt;\u524d\u8fdb&#xff1b;<\/p>\n<p>\u4e0b\u9762\u793a\u4f8b\u91c7\u7528\u65b9\u5f0f\u4e8c\u8fdb\u884c\u914d\u7f6e\u3002\u5982\u4e0b\u56fe4\u6240\u793a&#xff1b;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150608-680a5360bd3bc.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h6>3.2.5 \u8bbe\u7f6e\u865a\u62df\u673a\u540d\u79f0\u53ca\u7f51\u7edc<\/h6>\n<p>\u8bbe\u7f6e\u865a\u62df\u673a\u540d\u79f0\u2013&gt;\u9009\u62e9\u5728\u5b89\u88c5\u524d\u81ea\u5b9a\u4e49\u914d\u7f6e\u2013\u300b\u9009\u62e9\u7f51\u7edc\u4e3a\u6865\u63a5\u6216\u8005NAT&#xff08;\u793a\u4f8b\u9009\u62e9\u6865\u63a5&#xff09;\u2013&gt;\u5b8c\u6210\u3002\u5982\u4e0b\u56fe5\u6240\u793a&#xff1b;<\/p>\n<p>KVM\u865a\u62df\u673a\u7f51\u7edc\u914d\u7f6e\u7684\u4e24\u79cd\u65b9\u5f0f&#xff1a;<\/p>\n<p>NAT\u65b9\u5f0f\u548cBridge\u65b9\u5f0f\u3002Bridge\u65b9\u5f0f\u9002\u7528\u4e8e\u670d\u52a1\u5668\u4e3b\u673a\u7684\u865a\u62df\u5316\u3002NAT\u65b9\u5f0f\u9002\u7528\u4e8e\u684c\u9762\u4e3b\u673a\u7684\u865a\u62df\u5316\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150609-680a536104e17.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h6>3.2.6 \u5b89\u88c5\u524d\u914d\u7f6e<\/h6>\n<p>&#xff08;1&#xff09;\u6dfb\u52a0\u786c\u4ef6\u2013\u8f93\u5165\u2013\u901a\u7528USB Keyboard&#xff0c;\u4e0d\u6dfb\u52a0\u952e\u76d8\u65e0\u6cd5\u4f7f\u7528\u3002\u5982\u4e0b\u56fe6\u6240\u793a&#xff1b;<\/p>\n<p>&#xff08;2&#xff09;\u6dfb\u52a0\u786c\u4ef6\u2013\u8f93\u5165\u2013\u901a\u7528EvTouch USB\u56fe\u5f62\u6570\u4f4d\u677f&#xff0c;\u4e0d\u6dfb\u52a0\u9f20\u6807\u65e0\u6cd5\u4f7f\u7528\u3002\u56fe\u4e0b\u56fe6\u6240\u793a&#xff1b;<\/p>\n<p>&#xff08;3&#xff09;\u6dfb\u52a0\u786c\u4ef6\u2013\u56fe\u5f62\u2013\u7c7b\u578b\u9009\u62e9Spice\u670d\u52a1\u5668 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150609-680a53614340b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h6>3.2.7 \u5f00\u59cb\u5b89\u88c5<\/h6>\n<p>\u70b9\u51fb\u5f00\u59cb\u5b89\u88c5&#xff0c;\u5373\u53ef\u8fdb\u5165\u5230\u7cfb\u7edf\u5b89\u88c5\u5f15\u5bfc\u754c\u9762\u3002\u5982\u4e0b\u56fe8\u3001\u56fe9\u6240\u793a&#xff1b;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150609-680a5361827a9.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150609-680a5361b91a2.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u56fe9 \u9009\u62e9\u5b89\u88c5\u5f15\u5bfc\u83dc\u5355\u8fdb\u884c\u7cfb\u7edf\u5b89\u88c5<\/p>\n<h5>3.3 \u901a\u8fc7virt-install\u8fdb\u884c\u5b89\u88c5<\/h5>\n<h6>3.3.1 \u53c2\u6570\u4ecb\u7ecd<\/h6>\n<p>*\u53c2\u6570\u8bf4\u660e&#xff1a;*<\/p>\n<p>\u2013name\u6307\u5b9a\u865a\u62df\u673a\u540d\u79f0<\/p>\n<p>\u2013ram\u5206\u914d\u5185\u5b58\u5927\u5c0f<\/p>\n<p>\u2013vcpus\u5206\u914dCPU\u6838\u5fc3\u6570&#xff0c;\u6700\u5927\u4e0e\u7269\u7406\u673aCPU\u6838\u5fc3\u6570\u76f8\u540c<\/p>\n<p>\u2013disk\u6307\u5b9a\u865a\u62df\u673a\u955c\u50cf&#xff0c;size\u6307\u5b9a\u5206\u914d\u5927\u5c0f\u5355\u4f4d\u4e3aG<\/p>\n<p>\u2013network\u7f51\u7edc\u7c7b\u578b&#xff0c;\u6b64\u5904\u7528\u7684\u662f\u9ed8\u8ba4&#xff0c;\u4e00\u822c\u7528\u662fbridge\u6865\u63a5<\/p>\n<p>\u2013accelerate\u52a0\u901f<\/p>\n<p>\u2013cdrom\u6307\u5b9a\u5b89\u88c5\u955c\u50cfiso<\/p>\n<p>\u2013vnc\u542f\u7528VNC\u8fdc\u7a0b\u7ba1\u7406&#xff0c;\u4e00\u822c\u7cfb\u7edf\u90fd\u8981\u542f\u7528\u3002<\/p>\n<p>\u2013vncport\u6307\u5b9aVNC\u76d1\u63a7\u7aef\u53e3&#xff0c;\u9ed8\u8ba4\u7aef\u53e3\u4e3a5900&#xff0c;\u4e0d\u80fd\u91cd\u590d<\/p>\n<p>\u2013vnclisten\u6307\u5b9aVNC\u7ed1\u5b9aIP&#xff0c;\u9ed8\u8ba4\u7ed1\u5b9a127.0.0.1&#xff0c;\u6539\u4e3a0.0.0.0<\/p>\n<p>*\u4e00\u822c\u9009\u9879&#xff1a;\u6307\u5b9a\u865a\u62df\u673a\u7684\u540d\u79f0\u3001\u5185\u5b58\u5927\u5c0f\u3001VCPU\u4e2a\u6570\u53ca\u7279\u6027\u7b49&#xff1b;*<\/p>\n<p>\u200b -n NAME, &#8211;name&#061;NAME&#xff1a;\u865a\u62df\u673a\u540d\u79f0&#xff0c;\u9700\u3010\u5168\u5c40\u60df\u4e00\u3011&#xff1b;<\/p>\n<p>\u200b -r MEMORY, &#8211;ram&#061;MEMORY&#xff1a;\u865a\u62df\u673a\u5185\u5728\u5927\u5c0f&#xff0c;\u5355\u4f4d\u4e3aMB&#xff1b;<\/p>\n<p>\u200b &#8211;vcpus&#061;VCPUS[,maxvcpus&#061;MAX][,sockets&#061;#][,cores&#061;#][,threads&#061;#]&#xff1a;VCPU\u4e2a\u6570\u53ca\u76f8\u5173\u914d\u7f6e&#xff1b;<\/p>\n<p>\u200b &#8211;cpu&#061;CPU&#xff1a;CPU\u6a21\u5f0f\u53ca\u7279\u6027&#xff0c;\u5982coreduo\u7b49&#xff1b;\u53ef\u4ee5\u4f7f\u7528qemu-kvm -cpu ?\u6765\u83b7\u53d6\u652f\u6301\u7684CPU\u6a21\u5f0f&#xff1b;<\/p>\n<p>*\u5b89\u88c5\u65b9\u6cd5&#xff1a;\u6307\u5b9a\u5b89\u88c5\u65b9\u6cd5\u3001GuestOS\u7c7b\u578b\u7b49&#xff1b;*<\/p>\n<p>\u200b -c CDROM, &#8211;cdrom&#061;CDROM&#xff1a;\u5149\u76d8\u5b89\u88c5\u4ecb\u8d28&#xff1b;<\/p>\n<p>\u200b -l LOCATION, &#8211;location&#061;LOCATION&#xff1a;\u5b89\u88c5\u6e90URL&#xff0c;\u652f\u6301FTP\u3001HTTP\u53caNFS\u7b49&#xff1b;<\/p>\n<p>\u200b \u5982&#xff1a;http:\/\/mirror.centos.org\/centos\/6.9\/os\/x86_64\/<\/p>\n<p>\u200b &#8211;pxe&#xff1a;\u57fa\u4e8ePXE\u5b8c\u6210\u5b89\u88c5&#xff1b;<\/p>\n<p>\u200b &#8211;livecd: \u628a\u5149\u76d8\u5f53\u4f5cLiveCD&#xff1b;<\/p>\n<p>\u200b &#8211;os-type&#061;DISTRO_TYPE&#xff1a;\u64cd\u4f5c\u7cfb\u7edf\u7c7b\u578b&#xff0c;\u5982linux\u3001unix\u6216windows\u7b49&#xff1b;<\/p>\n<p>\u200b &#8211;os-variant&#061;DISTRO_VARIANT&#xff1a;\u67d0\u7c7b\u578b\u64cd\u4f5c\u7cfb\u7edf\u7684\u53d8\u4f53&#xff0c;\u5982rhel5\u3001fedora8\u7b49&#xff1b;<\/p>\n<p>\u200b -x EXTRA, &#8211;extra-args&#061;EXTRA&#xff1a;\u6839\u636e\u2013location\u6307\u5b9a\u7684\u65b9\u5f0f\u5b89\u88c5GuestOS\u65f6&#xff0c;\u7528\u4e8e\u4f20\u9012\u7ed9\u5185\u6838\u7684\u989d\u5916\u9009\u9879&#xff1b;<\/p>\n<p>\u200b \u4f8b\u5982\u6307\u5b9akickstart\u6587\u4ef6\u7684\u4f4d\u7f6e&#xff0c;\u2013extra-args \u201cks&#061;http:\/\/172.16.0.1\/ks.cfg\u201d<\/p>\n<p>\u200b &#8211;boot&#061;BOOTOPTS&#xff1a;\u6307\u5b9a\u5b89\u88c5\u8fc7\u7a0b\u5b8c\u6210\u540e\u7684\u914d\u7f6e\u9009\u9879&#xff1b;<\/p>\n<p>\u200b \u5982\u6307\u5b9a\u5f15\u5bfc\u8bbe\u5907\u6b21\u5e8f\u3001\u4f7f\u7528\u6307\u5b9a\u7684\u800c\u975e\u5b89\u88c5\u7684kernel\/initrd\u6765\u5f15\u5bfc\u7cfb\u7edf\u542f\u52a8\u7b49&#xff1b;<\/p>\n<p>\u200b &#8211;boot cdrom,hd,network&#xff1a;\u6307\u5b9a\u5f15\u5bfc\u6b21\u5e8f&#xff1b;<\/p>\n<p>\u200b &#8211;boot kernel&#061;KERNEL,initrd&#061;INITRD,kernel_args&#061;\u201dconsole&#061;\/dev\/ttyS0\u201d&#xff1a;\u6307\u5b9a\u542f\u52a8\u7cfb\u7edf\u7684\u5185\u6838\u53cainitrd\u6587\u4ef6&#xff1b;<\/p>\n<p>\u200b \u5728\u534a\u865a\u62df\u5316\u6a21\u5f0f\u4e2d\u8f83\u4e3a\u5e38\u89c1&#xff0c;\u5176\u4ed6\u6a21\u5f0f\u8f83\u5c11&#xff1b;<\/p>\n<p>\u200b<\/p>\n<p>*\u5b58\u50a8\u914d\u7f6e&#xff1a;\u6307\u5b9a\u5b58\u50a8\u7c7b\u578b\u3001\u4f4d\u7f6e\u53ca\u5c5e\u6027\u7b49&#xff1b;*<\/p>\n<p>\u200b &#8211;disk&#061;DISKOPTS&#xff1a;\u6307\u5b9a\u5b58\u50a8\u8bbe\u5907\u53ca\u5176\u5c5e\u6027&#xff1b;\u683c\u5f0f\u4e3a\u2013disk \/some\/storage\/path,opt1&#061;val1,opt2&#061;val2\u7b49&#xff1b;\u5e38\u7528\u7684\u9009\u9879\u6709&#xff1a;<\/p>\n<p>\u200b device&#xff1a;\u8bbe\u5907\u7c7b\u578b&#xff0c;\u5982cdrom\u3001disk\u6216floppy\u7b49&#xff0c;\u9ed8\u8ba4\u4e3adisk&#xff1b;<\/p>\n<p>\u200b bus&#xff1a;\u78c1\u76d8\u603b\u7ebf\u7c7b\u578b&#xff0c;\u5176\u503c\u53ef\u4ee5\u4e3aide\u3001scsi\u3001usb\u3001virtio\u6216xen&#xff1b;<\/p>\n<p>\u200b perms&#xff1a;\u8bbf\u95ee\u6743\u9650&#xff0c;\u5982rw\u3001ro\u6216sh&#xff08;\u5171\u4eab\u7684\u53ef\u8bfb\u5199&#xff09;&#xff0c;\u9ed8\u8ba4\u4e3arw&#xff1b;<\/p>\n<p>\u200b size&#xff1a;\u65b0\u5efa\u78c1\u76d8\u6620\u50cf\u7684\u5927\u5c0f&#xff0c;\u5355\u4f4d\u4e3aGB&#xff1b;<\/p>\n<p>\u200b cache&#xff1a;\u7f13\u5b58\u6a21\u578b&#xff0c;\u5176\u503c\u6709none\u3001writethrouth&#xff08;\u7f13\u5b58\u8bfb&#xff09;\u53cawriteback&#xff08;\u7f13\u5b58\u8bfb\u5199&#xff09;&#xff1b;<\/p>\n<p>\u200b format&#xff1a;\u78c1\u76d8\u6620\u50cf\u683c\u5f0f&#xff0c;\u5982raw\u3001qcow2\u3001vmdk\u7b49&#xff1b;<\/p>\n<p>\u200b sparse&#xff1a;\u78c1\u76d8\u6620\u50cf\u4f7f\u7528\u7a00\u758f\u683c\u5f0f&#xff0c;\u5373\u4e0d\u7acb\u5373\u5206\u914d\u6307\u5b9a\u5927\u5c0f\u7684\u7a7a\u95f4&#xff1b;<\/p>\n<p>\u200b &#8211;nodisks&#xff1a;\u4e0d\u4f7f\u7528\u672c\u5730\u78c1\u76d8&#xff0c;\u5728LiveCD\u6a21\u5f0f\u4e2d\u5e38\u7528&#xff1b;<\/p>\n<p>*\u7f51\u7edc\u914d\u7f6e&#xff1a;\u6307\u5b9a\u7f51\u7edc\u63a5\u53e3\u7684\u7f51\u7edc\u7c7b\u578b\u53ca\u63a5\u53e3\u5c5e\u6027\u5982MAC\u5730\u5740\u3001\u9a71\u52a8\u6a21\u5f0f\u7b49&#xff1b;*<\/p>\n<p>\u200b -w NETWORK, &#8211;network&#061;NETWORK,opt1&#061;val1,opt2&#061;val2&#xff1a;\u5c06\u865a\u62df\u673a\u8fde\u5165\u5bbf\u4e3b\u673a\u7684\u7f51\u7edc\u4e2d&#xff0c;\u5176\u4e2dNETWORK\u53ef\u4ee5\u4e3a&#xff1a;<\/p>\n<p>\u200b bridge&#061;BRIDGE&#xff1a;\u8fde\u63a5\u81f3\u540d\u4e3a\u201cBRIDEG\u201d\u7684\u6865\u8bbe\u5907&#xff1b;<\/p>\n<p>\u200b network&#061;NAME&#xff1a;\u8fde\u63a5\u81f3\u540d\u4e3a\u201cNAME\u201d\u7684\u7f51\u7edc&#xff1b;<\/p>\n<p>\u200b \u5176\u5b83\u5e38\u7528\u7684\u9009\u9879\u8fd8\u6709&#xff1a;<\/p>\n<p>\u200b model&#xff1a;GuestOS\u4e2d\u770b\u5230\u7684\u7f51\u7edc\u8bbe\u5907\u578b\u53f7&#xff0c;\u5982e1000\u3001rtl8139\u6216virtio\u7b49&#xff1b;<\/p>\n<p>\u200b mac&#xff1a;\u56fa\u5b9a\u7684MAC\u5730\u5740&#xff1b;\u7701\u7565\u6b64\u9009\u9879\u65f6\u5c06\u4f7f\u7528\u3010\u968f\u673a\u3011\u5730\u5740&#xff0c;\u4f46\u65e0\u8bba\u4f55\u79cd\u65b9\u5f0f&#xff0c;\u5bf9\u4e8eKVM\u6765\u8bf4&#xff0c;\u5176\u524d\u4e09\u6bb5\u5fc5\u987b\u4e3a52:54:00&#xff1b;<\/p>\n<p>\u200b \u6700\u597d\u4e0d\u8981\u4f7f\u7528\u968f\u673a\u5730\u5740&#xff0c;\u800c\u662f\u4f7f\u7528\u6211\u4eec\u81ea\u5df1\u63d0\u4f9b\u7684\u968f\u673a\u6570\u751f\u6210\u5668&#xff0c;\u6309\u987a\u5e8f\u7ed9\u865a\u62df\u673a\u751f\u6210&#xff0c;\u4fdd\u8bc1\u4e0d\u4f1a\u91cd\u590d\u3002<\/p>\n<p>\u200b \u53ef\u7528\u968f\u673a\u6570\u67091600\u591a\u4e07\u4e2a&#xff08;2^24&#xff09;&#xff0c;\u5e94\u8be5\u591f\u7528\u4e86\u3002\u3002\u3002<\/p>\n<p>\u200b &#8211;nonetworks&#xff1a;\u865a\u62df\u673a\u4e0d\u4f7f\u7528\u7f51\u7edc\u529f\u80fd&#xff1b;<\/p>\n<p>*\u56fe\u5f62\u914d\u7f6e&#xff1a;\u5b9a\u4e49\u865a\u62df\u673a\u663e\u793a\u529f\u80fd\u76f8\u5173\u7684\u914d\u7f6e&#xff0c;\u5982VNC\u76f8\u5173\u914d\u7f6e&#xff1b;*<\/p>\n<p>\u200b &#8211;graphics TYPE,opt1&#061;val1,opt2&#061;val2&#xff1a;\u6307\u5b9a\u56fe\u5f62\u663e\u793a\u76f8\u5173\u7684\u914d\u7f6e;<\/p>\n<p>\u200b \u6b64\u9009\u9879\u4e0d\u4f1a\u914d\u7f6e\u4efb\u4f55\u663e\u793a\u786c\u4ef6&#xff08;\u5982\u663e\u5361&#xff09;&#xff0c;\u800c\u662f\u4ec5\u6307\u5b9a\u865a\u62df\u673a\u542f\u52a8\u540e\u5bf9\u5176\u8fdb\u884c\u8bbf\u95ee\u7684\u63a5\u53e3&#xff1b;<\/p>\n<p>\u200b TYPE&#xff1a;\u6307\u5b9a\u663e\u793a\u7c7b\u578b&#xff0c;\u53ef\u4ee5\u4e3avnc\u3001sdl\u3001spice\u6216none\u7b49&#xff0c;\u9ed8\u8ba4\u4e3avnc&#xff1b;<\/p>\n<p>\u200b port&#xff1a;TYPE\u4e3avnc\u6216spice\u65f6\u5176\u76d1\u542c\u7684\u7aef\u53e3&#xff1b;<\/p>\n<p>\u200b listen&#xff1a;TYPE\u4e3avnc\u6216spice\u65f6\u6240\u76d1\u542c\u7684IP\u5730\u5740&#xff0c;\u9ed8\u8ba4\u4e3a127.0.0.1&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\/etc\/libvirt\/qemu.conf\u5b9a\u4e49\u65b0\u7684\u9ed8\u8ba4\u503c&#xff1b;<\/p>\n<p>\u200b password&#xff1a;TYPE\u4e3avnc\u6216spice\u65f6&#xff0c;\u4e3a\u8fdc\u7a0b\u8bbf\u95ee\u76d1\u542c\u7684\u670d\u52a1\u8fdb\u6307\u5b9a\u8ba4\u8bc1\u5bc6\u7801&#xff1b;<\/p>\n<p>\u200b &#8211;noautoconsole&#xff1a;\u7981\u6b62\u81ea\u52a8\u8fde\u63a5\u81f3\u865a\u62df\u673a\u7684\u63a7\u5236\u53f0&#xff1b;<\/p>\n<p>*\u8bbe\u5907\u9009\u9879&#xff1a;\u6307\u5b9a\u6587\u672c\u63a7\u5236\u53f0\u3001\u58f0\u97f3\u8bbe\u5907\u3001\u4e32\u884c\u63a5\u53e3\u3001\u5e76\u884c\u63a5\u53e3\u3001\u663e\u793a\u63a5\u53e3\u7b49&#xff1b;*<\/p>\n<p>\u200b &#8211;serial&#061;CHAROPTS&#xff1a;\u9644\u52a0\u4e00\u4e2a\u4e32\u884c\u8bbe\u5907\u81f3\u5f53\u524d\u865a\u62df\u673a&#xff1b;<\/p>\n<p>\u200b \u6839\u636e\u8bbe\u5907\u7c7b\u578b\u7684\u4e0d\u540c&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u9009\u9879&#xff0c;\u683c\u5f0f\u4e3a\u201c\u2013serial type,opt1&#061;val1,opt2&#061;val2,\u2026\u201d<\/p>\n<p>\u200b &#8211;serial pty&#xff1a;\u521b\u5efa\u4f2a\u7ec8\u7aef&#xff1b;<\/p>\n<p>\u200b &#8211;serial dev,path&#061;HOSTPATH&#xff1a;\u9644\u52a0\u4e3b\u673a\u8bbe\u5907\u81f3\u6b64\u865a\u62df\u673a&#xff1b;<\/p>\n<p>\u200b &#8211;video&#061;VIDEO&#xff1a;\u6307\u5b9a\u663e\u5361\u8bbe\u5907\u6a21\u578b&#xff0c;\u53ef\u7528\u53d6\u503c\u4e3acirrus\u3001vga\u3001qxl\u6216vmvga&#xff1b;<\/p>\n<p>*\u865a\u62df\u5316\u5e73\u53f0&#xff1a;*<\/p>\n<p>\u200b \u865a\u62df\u5316\u6a21\u578b&#xff08;hvm\u6216paravirt&#xff09;\u3001\u6a21\u62df\u7684CPU\u5e73\u53f0\u7c7b\u578b\u3001\u6a21\u62df\u7684\u4e3b\u673a\u7c7b\u578b\u3001hypervisor\u7c7b\u578b&#xff08;\u5982kvm\u3001xen\u6216qemu\u7b49&#xff09;\u4ee5\u53ca\u5f53\u524d\u865a\u62df\u673a\u7684UUID\u7b49&#xff1b;<\/p>\n<p>\u200b -v, &#8211;hvm&#xff1a;\u5f53\u7269\u7406\u673a\u540c\u65f6\u652f\u6301\u5b8c\u5168\u865a\u62df\u5316\u548c\u534a\u865a\u62df\u5316\u65f6&#xff0c;\u6307\u5b9a\u4f7f\u7528\u5b8c\u5168\u865a\u62df\u5316&#xff1b;<\/p>\n<p>\u200b -p, &#8211;paravirt&#xff1a;\u6307\u5b9a\u4f7f\u7528\u534a\u865a\u62df\u5316&#xff1b;<\/p>\n<p>\u200b &#8211;virt-type&#xff1a;\u4f7f\u7528\u7684hypervisor&#xff0c;\u5982kvm\u3001qemu\u3001xen\u7b49&#xff1b;\u6240\u6709\u53ef\u7528\u503c\u53ef\u4ee5\u4f7f\u7528\u2019virsh capabilities\u2019\u547d\u4ee4\u83b7\u53d6&#xff1b;<\/p>\n<p>*\u5176\u5b83&#xff1a;*<\/p>\n<p>\u200b &#8211;autostart&#xff1a;\u6307\u5b9a\u865a\u62df\u673a\u662f\u5426\u5728\u7269\u7406\u542f\u52a8\u540e\u81ea\u52a8\u542f\u52a8&#xff1b;<\/p>\n<p>\u200b &#8211;print-xml&#xff1a;\u5982\u679c\u865a\u62df\u673a\u4e0d\u9700\u8981\u5b89\u88c5\u8fc7\u7a0b(\u2013import\u3001\u2013boot)&#xff0c;\u5219\u663e\u793a\u751f\u6210\u7684XML\u800c\u4e0d\u662f\u521b\u5efa\u6b64\u865a\u62df\u673a&#xff1b;<\/p>\n<p>\u200b \u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;\u6b64\u9009\u9879\u4ecd\u4f1a\u521b\u5efa\u78c1\u76d8\u6620\u50cf&#xff1b;<\/p>\n<p>\u200b &#8211;force&#xff1a;\u7981\u6b62\u547d\u4ee4\u8fdb\u5165\u4ea4\u4e92\u5f0f\u6a21\u5f0f&#xff0c;\u5982\u679c\u6709\u9700\u8981\u56de\u7b54yes\u6216no\u9009\u9879&#xff0c;\u5219\u81ea\u52a8\u56de\u7b54\u4e3ayes&#xff1b;<\/p>\n<p>\u200b &#8211;dry-run&#xff1a;\u6267\u884c\u521b\u5efa\u865a\u62df\u673a\u7684\u6574\u4e2a\u8fc7\u7a0b&#xff0c;\u4f46\u4e0d\u771f\u6b63\u521b\u5efa\u865a\u62df\u673a\u3001\u6539\u53d8\u4e3b\u673a\u4e0a\u7684\u8bbe\u5907\u914d\u7f6e\u4fe1\u606f\u53ca\u5c06\u5176\u521b\u5efa\u7684\u9700\u6c42\u901a\u77e5\u7ed9libvirt&#xff1b;<\/p>\n<p>\u200b -d, &#8211;debug&#xff1a;\u663e\u793adebug\u4fe1\u606f&#xff1b;<\/p>\n<p>\u5c3d\u7ba1virt-install\u547d\u4ee4\u6709\u7740\u7c7b\u4f3c\u4e0a\u8ff0\u7684\u4f17\u591a\u9009\u9879&#xff0c;\u4f46\u5b9e\u9645\u4f7f\u7528\u4e2d&#xff0c;\u5176\u5fc5\u987b\u63d0\u4f9b\u7684\u9009\u9879\u4ec5\u5305\u62ec\u2013name\u3001\u2013ram\u3001\u2013disk&#xff08;\u4e5f\u53ef\u662f\u2013nodisks&#xff09;\u53ca\u5b89\u88c5\u8fc7\u7a0b\u76f8\u5173\u7684\u9009\u9879\u3002\u6b64\u5916&#xff0c;\u6709\u65f6\u8fd8\u9700\u8981\u4f7f\u7528\u62ec\u2013connect&#061;CONNCT\u9009\u9879\u6765\u6307\u5b9a\u8fde\u63a5\u81f3\u4e00\u4e2a\u975e\u9ed8\u8ba4\u7684hypervisor\u3002\u8fde&#034;\u2013vcpus&#034;\u53c2\u6570\u90fd\u4e0d\u7528\u7ed9&#xff0c;\u9ed8\u8ba4\u4e3a1\u3002<\/p>\n<h6>3.3.2 raw\u683c\u5f0f\u548cqcow2\u78c1\u76d8\u7c7b\u578b\u4ecb\u7ecd<\/h6>\n<p>&#xff08;1&#xff09;raw\u683c\u5f0f<\/p>\n<p>raw\u683c\u5f0f\u662f\u6700\u7b80\u5355&#xff0c;\u4ec0\u4e48\u90fd\u6ca1\u6709&#xff0c;\u6240\u4ee5\u53ebraw\u683c\u5f0f\u3002\u8fde\u5934\u6587\u4ef6\u90fd\u6ca1\u6709&#xff0c;\u5c31\u662f\u4e00\u4e2a\u76f4\u63a5\u7ed9\u865a\u62df\u673a\u8fdb\u884c\u8bfb\u5199\u7684\u6587\u4ef6\u3002raw\u4e0d\u652f\u6301\u52a8\u6001\u589e\u957f\u7a7a\u95f4&#xff0c;\u5fc5\u987b\u4e00\u5f00\u59cb\u5c31\u6307\u5b9a\u7a7a\u95f4\u5927\u5c0f\u3002\u6240\u4ee5\u76f8\u5f53\u7684\u8017\u8d39\u78c1\u76d8\u7a7a\u95f4\u3002<\/p>\n<p>raw\u955c\u50cf\u683c\u5f0f\u662f\u865a\u62df\u673a\u79cdI\/O\u6027\u80fd\u6700\u597d\u7684\u4e00\u79cd\u683c\u5f0f&#xff0c;\u5927\u5bb6\u5728\u4f7f\u7528\u65f6\u90fd\u4f1a\u548craw\u8fdb\u884c\u53c2\u7167&#xff0c;\u6027\u80fd\u8d8a\u63a5\u8fd1raw\u7684\u8d8a\u597d\u3002\u4f46\u662fraw\u6ca1\u6709\u4efb\u4f55\u5176\u4ed6\u529f\u80fd\u3002\u5bf9\u4e8e\u7a00\u758f\u6587\u4ef6\u7684\u51fa\u73b0&#xff0c;\u50cfqcow\u8fd9\u4e00\u7c7b\u7684\u8fd0\u884c\u65f6\u5206\u914d\u7a7a\u95f4\u7684\u955c\u50cf\u5c31\u6ca1\u6709\u4efb\u4f55\u4f18\u52bf\u4e86\u3002<\/p>\n<p>&#xff08;2&#xff09;qcow2\u683c\u5f0f<\/p>\n<p>qcow2 \u955c\u50cf\u683c\u5f0f\u662f QEMU \u6a21\u62df\u5668\u652f\u6301\u7684\u4e00\u79cd\u78c1\u76d8\u955c\u50cf\u3002\u5b83\u4e5f\u662f\u53ef\u4ee5\u7528\u4e00\u4e2a\u6587\u4ef6\u7684\u5f62\u5f0f\u6765\u8868\u793a\u4e00\u5757\u56fa\u5b9a\u5927\u5c0f\u7684\u5757\u8bbe\u5907\u78c1\u76d8\u3002\u4e0e\u666e\u901a\u7684 raw \u683c\u5f0f\u7684\u955c\u50cf\u76f8\u6bd4&#xff0c;\u6709\u4ee5\u4e0b\u7279\u6027&#xff1a;<\/p>\n<p>\u66f4\u5c0f\u7684\u7a7a\u95f4\u5360\u7528&#xff0c;\u5373\u4f7f\u6587\u4ef6\u7cfb\u7edf\u4e0d\u652f\u6301\u7a7a\u6d1e(holes)&#xff1b;<\/p>\n<p>\u652f\u6301\u5199\u65f6\u62f7\u8d1d&#xff08;COW, copy-on-write&#xff09;&#xff0c;\u955c\u50cf\u6587\u4ef6\u53ea\u53cd\u6620\u5e95\u5c42\u78c1\u76d8\u7684\u53d8\u5316&#xff1b;<\/p>\n<p>\u652f\u6301\u5feb\u7167&#xff08;snapshot&#xff09;&#xff0c;\u955c\u50cf\u6587\u4ef6\u80fd\u591f\u5305\u542b\u591a\u4e2a\u5feb\u7167\u7684\u5386\u53f2&#xff1b;<\/p>\n<p>\u53ef\u9009\u62e9\u57fa\u4e8e zlib \u7684\u538b\u7f29\u65b9\u5f0f&#xff1b;<\/p>\n<p>\u53ef\u4ee5\u9009\u62e9 AES \u52a0\u5bc6&#xff1b;<\/p>\n<p>qcow2\u662f\u96c6\u5404\u79cd\u6280\u672f\u4e3a\u4e00\u4f53\u7684\u8d85\u7ea7\u955c\u50cf\u683c\u5f0f&#xff0c;\u652f\u6301\u5185\u90e8\u5feb\u7167&#xff0c;\u52a0\u5bc6&#xff0c;\u538b\u7f29\u7b49\u4e00\u7cfb\u5217\u529f\u80fd&#xff0c;\u8bbf\u95ee\u6027\u80fd\u4e5f\u5728\u4e0d\u65ad\u63d0\u9ad8\u3002\u4f46qcow2\u7684\u95ee\u9898\u5c31\u662f\u8fc7\u4e8e\u81c3\u80bf&#xff0c;\u628a\u4ec0\u4e48\u529f\u80fd\u90fd\u96c6\u4e8e\u4e00\u8eab\u3002<\/p>\n<h6>3.3.3 virt-install\u5b89\u88c5<\/h6>\n<p>&#xff08;1&#xff09;\u521b\u5efa\u6865\u63a5\u7f51\u5361<\/p>\n<p>\u5982\u679c\u662f\u865a\u62df\u673a\u7f51\u5361\u662fNAT\u6a21\u5f0f&#xff0c;\u5219\u4e0d\u7528\u521b\u5efa<\/p>\n<p>1&#xff09;\u5728\u7f51\u5361\u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u6dfb\u52a0BRIDGE&#061;&#034;br0&#034;\u53c2\u6570\u3002\u5176\u4e2dNAME,UUID,DEVICE\u53c2\u6570\u8bf7\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u914d\u7f6e&#xff0c;\u4ee5\u4e0b\u793a\u4f8b\u4ec5\u4f9b\u53c2\u8003\u3002<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/sysconfig\/network-scripts\/ifcfg-ens33<\/span><br \/>\n<span class=\"token assign-left variable\">TYPE<\/span><span class=\"token operator\">&#061;<\/span>Ethernet<br \/>\n<span class=\"token assign-left variable\">BOOTPROTO<\/span><span class=\"token operator\">&#061;<\/span>static<br \/>\n<span class=\"token assign-left variable\">DEFROUTE<\/span><span class=\"token operator\">&#061;<\/span>yes<br \/>\n<span class=\"token assign-left variable\">IPV4_FAILURE_FATAL<\/span><span class=\"token operator\">&#061;<\/span>no<br \/>\n<span class=\"token assign-left variable\">NAME<\/span><span class=\"token operator\">&#061;<\/span>ens33<br \/>\n<span class=\"token assign-left variable\">UUID<\/span><span class=\"token operator\">&#061;<\/span>e0d11a2f-6c67-4ead-a36a-847712934acf<br \/>\n<span class=\"token assign-left variable\">DEVICE<\/span><span class=\"token operator\">&#061;<\/span>ens33<br \/>\n<span class=\"token assign-left variable\">ONBOOT<\/span><span class=\"token operator\">&#061;<\/span>yes<br \/>\n<span class=\"token assign-left variable\">BRIDGE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;br0&#034;<\/span><\/p>\n<p>2&#xff09;\u521b\u5efabr0\u7f51\u5361&#xff0c;\u5177\u4f53\u53c2\u6570\u8bf7\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u4fee\u6539&#xff0c;\u4ee5\u4e0b\u793a\u4f8b\u4ec5\u4f9b\u53c2\u8003\u3002<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># cat \/etc\/sysconfig\/network-scripts\/ifcfg-br0<\/span><br \/>\n<span class=\"token assign-left variable\">NAME<\/span><span class=\"token operator\">&#061;<\/span>br0<br \/>\n<span class=\"token assign-left variable\">TYPE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;Bridge&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">BOOTPROTO<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;static&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">DEVICE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;br0&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">ONBOOT<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;yes&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">IPADDR<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">192.168<\/span>.146.137<br \/>\n<span class=\"token assign-left variable\">NETMASK<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">255.255<\/span>.255.0<br \/>\n<span class=\"token assign-left variable\">GATEWAY<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">192.168<\/span>.146.2<\/p>\n<p>&#xff08;2&#xff09;\u521b\u5efa\u78c1\u76d8<\/p>\n<p>\u4ee5\u4e0b\u793a\u4f8b&#xff0c;\u5728 \/var\/lib\/libvirt\/images\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3akylin.img\u768430G qcow2\u7684\u78c1\u76d8\u6587\u4ef6\u3002<\/p>\n<p>\u6267\u884c\u547d\u4ee4&#xff1a;qemu-img create -f qcow2 \/var\/lib\/libvirt\/images\/kylin.img 30G<\/p>\n<p>&#xff08;3&#xff09;\u521b\u5efa\u865a\u62df\u673a<\/p>\n<p>\u5177\u4f53\u53c2\u6570\u8bf7\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u4fee\u6539&#xff0c;\u4ee5\u4e0b\u793a\u4f8b\u4ec5\u4f9b\u53c2\u8003\u3002<\/p>\n<p>\u6267\u884c\u547d\u4ee4&#xff1a;virt-install &#8211;name&#061;kylin-test &#8211;ram 2048 &#8211;vcpus&#061;2 &#8211;disk path&#061;\/var\/lib\/libvirt\/images\/kylin.img,format&#061;qcow2,size&#061;30,bus&#061;ide &#8211;accelerate &#8211;cdrom \/root\/Kylin-Server-10-SP2-Release-Build09-20210524-x86_64.iso &#8211;vnc &#8211;vncport&#061;5920 &#8211;vnclisten&#061;0.0.0.0 &#8211;network bridge&#061;br0,model&#061;virtio &#8211;noautoconsole<\/p>\n<p>\u6267\u884c\u5b8c\u6210\u4e4b\u540e\u6253\u5f00\u865a\u62df\u7cfb\u7edf\u7ba1\u7406\u5668&#xff0c;\u9009\u62e9\u5b89\u88c5\u5f15\u5bfc\u83dc\u5355\u8fdb\u884c\u7cfb\u7edf\u5b89\u88c5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3w\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf94\u6b21\u3002\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a_\u94f6\u6cb3\u9e92\u9e9f\u5b89\u88c5kvm<\/p>\n","protected":false},"author":2,"featured_media":32663,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[322,58,43,44],"topic":[],"class_list":["post-32671","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-kylin","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/32671.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3w\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf94\u6b21\u3002\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a_\u94f6\u6cb3\u9e92\u9e9f\u5b89\u88c5kvm\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/32671.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-24T15:06:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150608-680a536020235.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/32671.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/32671.html\",\"name\":\"\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-24T15:06:10+00:00\",\"dateModified\":\"2025-04-24T15:06:10+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/32671.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/32671.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/32671.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/32671.html","og_locale":"zh_CN","og_type":"article","og_title":"\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3w\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf94\u6b21\u3002\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a_\u94f6\u6cb3\u9e92\u9e9f\u5b89\u88c5kvm","og_url":"https:\/\/www.wsisp.com\/helps\/32671.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-24T15:06:10+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250424150608-680a536020235.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/32671.html","url":"https:\/\/www.wsisp.com\/helps\/32671.html","name":"\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-24T15:06:10+00:00","dateModified":"2025-04-24T15:06:10+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/32671.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/32671.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/32671.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u94f6\u6cb3\u9e92\u9e9f\u9ad8\u7ea7\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\uff08\u901a\u7528\uff09\u5b89\u88c5KVM\u548c\u521b\u5efaKVM\u865a\u62df\u673a"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/32671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=32671"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/32671\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/32663"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=32671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=32671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=32671"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=32671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}