{"id":5771,"date":"2021-06-03T23:48:36","date_gmt":"2021-06-03T23:48:36","guid":{"rendered":"https:\/\/www.geekdecoder.com\/?p=5771"},"modified":"2021-06-03T23:48:36","modified_gmt":"2021-06-03T23:48:36","slug":"how-to-enable-virsh-console-access-for-kvm-guests","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2021\/06\/03\/how-to-enable-virsh-console-access-for-kvm-guests\/","title":{"rendered":"How To Enable Virsh Console Access For KVM Guests"},"content":{"rendered":"<p>This articles describes how to enable virsh console on KVM Guests<\/p>\n<p>List Virtual Machines<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo virsh list --all\n Id   Name               State\n-----------------------------------\n 13   debian10-server3   running\n<\/pre>\n<p>After installing KVM and trying to console, all I see is below and no access to machine:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo virsh console debian10-server3\nConnected to domain centos8\nEscape character is ^]\n<\/pre>\n<p><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2021\/06\/sky1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5853\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2021\/06\/sky1.png\" alt=\"\" width=\"546\" height=\"84\" srcset=\"https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2021\/06\/sky1.png 546w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2021\/06\/sky1-300x46.png 300w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/a><\/p>\n<p>Type the following to exit:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ Ctrl+]\n<\/pre>\n<p>Enable Virsh Console Access For KVM Guests<\/p>\n<p>Log in via ssh or kvm virtual machine manager to the KVM guest system (virtual machine), not in the KVM host.<\/p>\n<p>Run the following:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo systemctl enable serial-getty@ttyS0.service\nCreated symlink \/etc\/systemd\/system\/getty.target.wants\/serial-getty@ttyS0.service \u2192 \/lib\/systemd\/system\/serial-getty@.service.\n<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo systemctl start serial-getty@ttyS0.service\n<\/pre>\n<p>verify it by looking into the VM&#8217;s configuration XML file from the Host:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo virsh edit debian10-server3\n<\/pre>\n<p>Scroll to see the following lines&#8230;<br \/>\n<a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2021\/06\/sky2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5862\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2021\/06\/sky2.png\" alt=\"\" width=\"443\" height=\"160\" srcset=\"https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2021\/06\/sky2.png 443w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2021\/06\/sky2-300x108.png 300w\" sizes=\"auto, (max-width: 443px) 100vw, 443px\" \/><\/a><\/p>\n<p>Now start the virsh console of the guest system from the host using command:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo virsh console debian10-server3\nConnected to domain centos8\nEscape character is ^]\n<\/pre>\n<p>Press ENTER again and type your user name and password to connect to the guest machine. To exit, type Ctrl+]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This articles describes how to enable virsh console on KVM Guests List Virtual Machines $ sudo virsh list &#8211;all Id Name State &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; 13 debian10-server3 running After installing KVM and trying to console, all I see is below and no access to machine: $ sudo virsh console debian10-server3 Connected to domain centos8 Escape character is &#8230; <a title=\"How To Enable Virsh Console Access For KVM Guests\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2021\/06\/03\/how-to-enable-virsh-console-access-for-kvm-guests\/\" aria-label=\"Read more about How To Enable Virsh Console Access For KVM Guests\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"class_list":["post-5771","post","type-post","status-publish","format-standard","hentry","category-kvm"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/5771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=5771"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/5771\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=5771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=5771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=5771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}