{"id":38742,"date":"2023-01-24T22:04:39","date_gmt":"2023-01-24T14:04:39","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=38742"},"modified":"2023-01-24T22:04:39","modified_gmt":"2023-01-24T14:04:39","slug":"kvm-console-ok","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/kvm-console-ok.html","title":{"rendered":"\u8ba9KVM\u865a\u62df\u673a\u652f\u6301console\u529f\u80fd"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728\u5de5\u4f5c\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u90fd\u4f1a\u63a5\u89e6\u5230 KVM \u865a\u62df\u673a\uff0c\u5e76\u4e14\u516c\u53f8\u7684\u5f88\u591a\u5e94\u7528\u4e5f\u90fd\u4f1a\u8dd1\u5728 KVM \u865a\u62df\u673a\u4e0a\u3002\u56e0\u6b64\uff0c\u5bf9 KVM\u7684\u719f\u7ec3\u5e94\u7528\uff0c\u4e5f\u662f\u8fd0\u7ef4\u5fc5\u4e0d\u53ef\u5c11\u7684\u80fd\u529b\u4e4b\u4e00\u3002\u90a3\u4e48\u5728 KVM \u7684\u5b9e\u8df5\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u80af\u5b9a\u4f1a\u7ecf\u5e38\u53bb\u601d\u8003\u5982\u4f55\u80fd\u591f\u66f4\u6df1\u5165\u3001\u66f4\u6807\u51c6\u7684\u5b9e\u8df5\u597d KVM\u3002\u7531\u6b64\uff0c\u5c31\u5f15\u53d1\u4e86\u5f88\u591a\u4f7f\u7528\u7ecf\u9a8c\uff08\u6280\u5de7\uff09\u3002\u4eca\u5929\u5c06\u4f1a\u4ecb\u7ecd\u7684\u662f\uff0c\u5982\u4f55\u4f7f\u7528 KVM \u7684 console \u63a5\u53e3\u529f\u80fd\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5e38\u89c4\u60c5\u51b5\u4e0b\uff0c\u5b89\u88c5\u5b8c KVM \u4e4b\u540e\uff0c\u53ef\u80fd\u90fd\u4f1a\u901a\u8fc7 VNC \u8fde\u63a5\u5230 KVM \u865a\u62df\u673a\u91cc\u9762\u53bb\u8bbe\u7f6e\u76f8\u5e94\u7684 IP \u7b49\u4fe1\u606f\u3002\u4f46\u662f\u8fd9\u6837\u5b50\uff0c\u4e00\u65b9\u9762\u53ef\u80fd\u4f1a\u56e0\u4e3a\u6253\u5f00\u8fc7\u591a\u7684\u7aef\u53e3\u9020\u6210\u5b89\u5168\u95ee\u9898\uff0c\u53e6\u4e00\u65b9\u9762\u4e5f\u4e0d\u662f\u4f1a\u4fbf\u6377\u3002\u9488\u5bf9\u6b64\u79cd\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 KVM \u4e3a\u6211\u4eec\u63d0\u4f9b\u7684 console \u63a5\u53e3\u529f\u80fd\uff0c\u5b83\u53ef\u4ee5\u91c7\u7528\u5b57\u7b26\u754c\u9762\u8fdb\u884c linux \u865a\u62df\u673a\u63a7\u5236\u53f0\u8fde\u63a5\u3002\u8fd9\u6837\u5b50\uff0c\u53ca\u65f6 KVM\u00a0\u865a\u62df\u673a\u6ca1\u6709 IP \u5730\u5740\uff0c\u53c8\u6216\u8005 KVM\u00a0\u865a\u62df\u673a\u51fa\u73b0\u4e86\u95ee\u9898\u901a\u8fc7 IP \u8fde\u63a5\u4e0d\u8fdb\u53bb\u4e86\uff0c\u90fd\u53ef\u4ee5\u5f88\u4fbf\u6377\u7684\u5feb\u901f\u8fdb\u5165\u5230 KVM \u865a\u62df\u673a\u91cc\u9762\u53bb\u6392\u67e5\u95ee\u9898\u3002<\/p>\n

KVM \u865a\u62df\u673a\u7684 console \u63a5\u53e3\u8fde\u63a5\u5e94\u7528\u7684\u6548\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n

\"11\"<\/p>\n

\u4e0b\u9762\u6765\u770b\u5982\u4f55\u4f7f\u7528\u8fd9\u4e2a\u529f\u80fd\uff01<\/p>\n

\u5982\u4e0a\u56fe\u6240\u793a\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4 \" virsh console \u865a\u62df\u673a\u540d\u5b57\" \u7684\u5f62\u5f0f\uff0c\u4ee5\u5b57\u7b26\u754c\u9762\u7684\u5f62\u5f0f\u53bb\u8fde\u63a5\u4f60\u6240\u6307\u5b9a\u540d\u5b57\u7684\u90a3\u53f0 KVM \u865a\u62df\u673a\u3002\u6b64\u65f6\u4f1a\u51fa\u73b0\u5982\u4e0b\u7684\u63d0\u793a\uff1a<\/p>\n

\"12\"<\/p>\n

\u5728\u8fd9\u79cd\u63d0\u793a\u4e0b\uff0c\u4f60\u9700\u8981\u56de\u8f66\u4e00\u4e0b\uff0c\u5982\u679c\u56de\u8f66\u4e4b\u540e\uff0c\u6ca1\u6709\u4efb\u4f55\u53cd\u5e94\uff0c\u90a3\u5c31\u8bf4\u660e\u4f60\u6307\u5b9a\u7684\u8fd9\u53f0 KVM \u865a\u62df\u673a\u6ca1\u6709\u6253\u5f00 console \u529f\u80fd\u3002<\/p>\n

\u5982\u679c\u51fa\u73b0\u5982\u4e0b\u60c5\u51b5\u5c31\u8868\u793a\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 console \u529f\u80fd\u3002<\/p>\n

\"13\"<\/p>\n

\u5982\u679c\u6ca1\u6709\u6253\u5f00\u7684 console \u8fd9\u4e2a\u529f\u80fd\u7684\u8bdd\uff0c\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u64cd\u4f5c\u8fdb\u884c\u4eba\u4e3a\u6253\u5f00\u3002<\/p>\n

1\u3001\u4fee\u6539 grub.conf \u6587\u4ef6<\/strong><\/span><\/div>\n

\u901a\u8fc7\u4e3a\u5185\u6838\u4f20\u9012\u53c2\u6570 console=ttyS0\uff0c\u6765\u8ba9\u5185\u6838\u628a\u8f93\u51fa\u5b9a\u5411\u81f3 ttyS0<\/p>\n

[root@test01-kvm-jz test01-kvm-jz.btr \/root] \r\n# vim \/etc\/grub.conf<\/pre>\n
2\u3001\u4fee\u6539 \/etc\/inittab \u6587\u4ef6<\/strong><\/span><\/div>\n

\u901a\u8fc7\u5728 inittab \u91cc\u52a0\u4e00\u4e2a ttyS0 \uff0c\u6765\u4f7f\u5f97\u7cfb\u7edf\u542f\u52a8\u65f6\u80fd\u591f\u751f\u6210\u4e00\u4e2a ttyS0 \u6765\u63a5\u6536\u6765\u81ea\u5185\u6838\u7684\u6570\u636e<\/p>\n

[root@test01-kvm-jz test01-kvm-jz.btr \/root] \r\n# echo \"S0:12345:respawn:\/sbin\/agetty ttyS0 115200\" >> \/etc\/inittab\r\n[root@test01-kvm-jz test01-kvm-jz.btr \/root] \r\n# tail -1 \/etc\/inittab \r\nS0:12345:respawn:\/sbin\/agetty ttyS0 115200<\/pre>\n
3\u3001\u4fee\u6539 \/etc\/securetty \u6587\u4ef6<\/strong><\/span><\/div>\n

\u7531\u4e8e\u00a0\/etc\/securetty\u00a0\u6587\u4ef6\u5141\u8bb8\u4f60\u89c4\u5b9a root \u7528\u6237\u53ef\u4ee5\u4ece\u54ea\u4e2a TTY \u8bbe\u5907\u767b\u5f55\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u6dfb\u52a0 ttyS0 \u7684\u5b89\u5168\u8bb8\u53ef\uff0c\u5373\u5c06 ttyS0 \u6dfb\u52a0\u81f3\u8be5\u6587\u4ef6\uff0c\u6765\u5141\u8bb8\u6211\u4eec\u7684 root \u7528\u6237\u767b\u5f55\u3002<\/p>\n

root@test01-kvm-jz test01-kvm-jz.btr \/root] \r\n# echo \"ttyS0\" >> \/etc\/securetty<\/pre>\n

4\u3001\u91cd\u542f KVM \u865a\u62df\u673a<\/strong><\/span><\/p>\n

[root@test01-kvm-jz test01-kvm-jz.btr \/root] \r\n# reboot\r\n<\/pre>\n

5\u3001\u767b\u5f55\u9a8c\u8bc1<\/strong><\/span><\/p>\n

\"14\"<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/nolinux.blog.51cto.com\/4824967\/1589488<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/kvm-console-ok.html<\/a>\u7f16\u8f91\uff1a\u9676\u6b66\u6770\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u632f\u534e<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u5728\u5de5\u4f5c\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u90fd\u4f1a\u63a5\u89e6\u5230 KVM \u865a\u62df\u673a\uff0c\u5e76\u4e14\u516c\u53f8\u7684\u5f88\u591a\u5e94\u7528\u4e5f\u90fd\u4f1a\u8dd1\u5728 KVM \u865a\u62df\u673a\u4e0a\u3002\u56e0\u6b64\uff0c\u5bf9 […]<\/p>\n","protected":false},"author":63,"featured_media":38748,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-38742","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/38742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=38742"}],"version-history":[{"count":11,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/38742\/revisions"}],"predecessor-version":[{"id":262730,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/38742\/revisions\/262730"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/38748"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=38742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=38742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=38742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}