[libvirt-users] SSH console for qemu

Hello, I'm using qemu with libvirt and I want to create SSH emergency console to linux/unix guests, same way as it is realized in qemu VNC. Maybe someone could help me to determine a place to dive in this question. I think the best way to make it - extend qemu API. But if this could be made with libvirt - this will be also fine. -- Nikita A Menkovich http://libc6.org/ JID: menkovich@gmail.com

On Wed, Jul 6, 2011 at 3:08 PM, Nikita A Menkovich <menkovich@gmail.com> wrote:
I'm using qemu with libvirt and I want to create SSH emergency console to linux/unix guests, same way as it is realized in qemu VNC. Maybe someone could help me to determine a place to dive in this question.
I think the best way to make it - extend qemu API. But if this could be made with libvirt - this will be also fine.
Serial console and the "virsh console" command? Stefan

Seems no, I think, that the best way is running some kind of ssh daemon, that connects to console (/dev/vcsa1 for example), that listen on port and send to output console events on boot, and allow to work with server with simple ssh client. Also important feature will be saving history of output. On 6 July 2011 19:27, Stefan Hajnoczi <stefanha@gmail.com> wrote:
On Wed, Jul 6, 2011 at 3:08 PM, Nikita A Menkovich <menkovich@gmail.com> wrote:
I'm using qemu with libvirt and I want to create SSH emergency console to linux/unix guests, same way as it is realized in qemu VNC. Maybe someone could help me to determine a place to dive in this question.
I think the best way to make it - extend qemu API. But if this could be made with libvirt - this will be also fine.
Serial console and the "virsh console" command?
Stefan
-- Nikita A Menkovich http://libc6.org/ JID: menkovich@gmail.com Tel: +7 (921) 423-96-48

On 07/07/2011 02:36 AM, Nikita A Menkovich wrote:
Seems no, I think, that the best way is running some kind of ssh daemon, that connects to console (/dev/vcsa1 for example), that listen on port and send to output console events on boot, and allow to work with server with simple ssh client. Also important feature will be saving history of output.
If you're trying to capture boot events, then you have to have an SGA (serial graphics adaptor) capable BIOS that can output boot events on the serial console. There's recent work underway to add that feature to qemu, and to expose that feature from libvirt: https://www.redhat.com/archives/libvir-list/2011-July/msg00174.html Setting up an ssh daemon in the guest is too late - the daemon won't be set up until the guest has already booted, so there's no way to have that daemon forward boot messages back to the host in a timely manner. I think you're trying too hard - 'virsh console' really is the way to read all messages output to the guest's console, and your only missing piece is that you also appear to want BIOS to output to the console. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

I want to launch very minimal ssh daemon (that listen on selected port and allows only input commands and read output from console) that launch when guest started, and this not run inside a guest. Thanks to the link for patch On 7 July 2011 22:19, Eric Blake <eblake@redhat.com> wrote:
On 07/07/2011 02:36 AM, Nikita A Menkovich wrote:
Seems no, I think, that the best way is running some kind of ssh daemon, that connects to console (/dev/vcsa1 for example), that listen on port and send to output console events on boot, and allow to work with server with simple ssh client. Also important feature will be saving history of output.
If you're trying to capture boot events, then you have to have an SGA (serial graphics adaptor) capable BIOS that can output boot events on the serial console. There's recent work underway to add that feature to qemu, and to expose that feature from libvirt:
https://www.redhat.com/archives/libvir-list/2011-July/msg00174.html
Setting up an ssh daemon in the guest is too late - the daemon won't be set up until the guest has already booted, so there's no way to have that daemon forward boot messages back to the host in a timely manner. I think you're trying too hard - 'virsh console' really is the way to read all messages output to the guest's console, and your only missing piece is that you also appear to want BIOS to output to the console.
-- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
-- Nikita A Menkovich http://libc6.org/ JID: menkovich@gmail.com Tel: +7 (921) 423-96-48

On Thu, Jul 7, 2011 at 9:36 AM, Nikita A Menkovich <menkovich@gmail.com> wrote:
Seems no, I think, that the best way is running some kind of ssh daemon, that connects to console (/dev/vcsa1 for example), that listen on port and send to output console events on boot, and allow to work with server with simple ssh client. Also important feature will be saving history of output.
If you configure an ssh daemon properly you can have it invoke "virsh console <domain>" as the shell. Remember to lock down port forwarding and sftp. Stefan
participants (3)
-
Eric Blake
-
Nikita A Menkovich
-
Stefan Hajnoczi