Editing Virsh console
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
− | <code>[[virsh]] console YOUR_MACHINE</code> | + | * <code>[[virsh]] console YOUR_MACHINE</code> |
− | + | == Connecting == | |
− | + | virsh console MACHINE_NAME | |
− | |||
− | |||
− | == | ||
− | |||
− | virsh console | ||
Connected to domain MACHINE_NAME | Connected to domain MACHINE_NAME | ||
Escape character is ^] | Escape character is ^] | ||
error: operation failed: Active console session exists for this domain | error: operation failed: Active console session exists for this domain | ||
− | |||
− | |||
− | |||
− | |||
virsh console | virsh console | ||
error: command 'console' requires <[[domain]]> option | error: command 'console' requires <[[domain]]> option | ||
== [[Enable serial console]] == | == [[Enable serial console]] == | ||
− | + | First you need to enable [[serial]] console in your VM Machine.<ref>https://www.cyberciti.biz/faq/how-to-enable-kvm-virsh-console-access-for-ubuntu-linux-vm/</ref> | |
− | |||
− | |||
− | + | * <code>sudo [[systemctl enable]] [[serial-getty]]@[[ttyS0]].service</code> | |
+ | * <code>sudo [[systemctl start]] [email protected]</code> | ||
− | + | * <code>[[virsh]] [[console]] MACHINE</code> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Kill old console == | == Kill old console == | ||
− | + | ps -ef | grep console | |
[[kill -9]] {PID} | [[kill -9]] {PID} | ||
− | == Related == | + | == Related commands == |
− | |||
* <code>[[virsh list]]</code> | * <code>[[virsh list]]</code> | ||
* <code>[[virsh start]]</code> | * <code>[[virsh start]]</code> | ||
Line 56: | Line 30: | ||
* <code>[[virsh vncdisplay]] VM_NAME</code> | * <code>[[virsh vncdisplay]] VM_NAME</code> | ||
* <code>[[/var/log/libvirt/]]qemu/</code> | * <code>[[/var/log/libvirt/]]qemu/</code> | ||
− | * <code>[[virsh | + | * <code>[[virsh ttyconsole]]</code> |
− | |||
− | |||
== See also == | == See also == | ||
Line 64: | Line 36: | ||
* {{virsh}} | * {{virsh}} | ||
− | [[Category: | + | |
+ | [[Category:Linux]] | ||
[[Category:KVM]] | [[Category:KVM]] |
Advertising: