0

How do I recover the console of the first guest when itself is connected to a guest of which it is the host?

Host1:~$ virsh console Guest1

...

Connected to domain 'Guest1'
Escape character is ^] (Ctrl + ])

Guest2 login: 

Guest1 has been connected to Guest2 using the virsh console Guest2 command.

Guest2 runs on Guest1 with the same KVM and LIBVIRT packages as Guest1 does on Host1.

I do not want to reboot any machine.

I possess the credentials of all machines.

1 Answer 1

1

Reading the documentation for virsh (see man virsh) we find,

-e, --escape string Set alternative escape sequence for console command. By default, telnet's ^] is used. Allowed characters when using hat notation are: alphabetic character, @, [, ], ^, _.

Using this information you can use ^] to disconnect from the first session, change the escape character to something like ^a, reconnect, and then use ^] as a pass-through this time to disconnect the second session:

virsh -e '^a' console guest1
2
  • Thank your for the explanation including a source and examples. Commented May 4, 2024 at 17:43
  • @viator I figure that if I give a reference then it helps people understand how I arrived at my answer. Otherwise it's just "I said so..." Commented May 4, 2024 at 17:58

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.