All of lore.kernel.org
 help / color / mirror / Atom feed
* Howto connect to a terminal in an emalated linux-livecd?
@ 2014-09-11 11:48 Oliver Rath
  2014-09-12 12:43 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Rath @ 2014-09-11 11:48 UTC (permalink / raw)
  To: kvm

Hi list,

after hours for searching in google-world, i didnt find any appropriate
for this problem:

I want to boot a live-cd (i.e. ubuntu 14.04.1-desktop) in qemu, which
starts with an graphical interface, done i.e. by

qemu-system-x86_64 -m 3G -smp 2 -drive
file=ubuntu-14.04.1-desktop-i386.iso,media=cdrom,if=virtio --enable-kvm

Now i want to access to the console of the ubuntu-livecd. At the moment
i can do this over changing to text mode via

sendkey ctrl-alt-f1

in qemu-console (Alt-2), then switching back to qemu-window (alt-1). Now
i have access to tty1 of my livecd.

But IMHO there should be a more simple way to access to such a console
with qemu, i.e. through a pipe, a serial console etc., but i didnt found
anything working. The best i got was with -chardev pty,id=myid, which
resulted in a "char device redirected to /dev/pts/0 (label myid)".  But
with a "screen /dev/pts/0" i wasnt able to see any input or output.

ssh is unfortunatly not available at this time on the livecd (so i could
connect i.e. via -net user,hostfwd:tcp:10022-:22)

Any hints to connect directly to a console in an emulated linux?

Tfh!
Oliver



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Howto connect to a terminal in an emalated linux-livecd?
  2014-09-11 11:48 Howto connect to a terminal in an emalated linux-livecd? Oliver Rath
@ 2014-09-12 12:43 ` Stefan Hajnoczi
  2014-09-12 14:44   ` Kashyap Chamarthy
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-09-12 12:43 UTC (permalink / raw)
  To: Oliver Rath; +Cc: kvm

[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

On Thu, Sep 11, 2014 at 01:48:51PM +0200, Oliver Rath wrote:
> after hours for searching in google-world, i didnt find any appropriate
> for this problem:
> 
> I want to boot a live-cd (i.e. ubuntu 14.04.1-desktop) in qemu, which
> starts with an graphical interface, done i.e. by
> 
> qemu-system-x86_64 -m 3G -smp 2 -drive
> file=ubuntu-14.04.1-desktop-i386.iso,media=cdrom,if=virtio --enable-kvm
> 
> Now i want to access to the console of the ubuntu-livecd. At the moment
> i can do this over changing to text mode via
> 
> sendkey ctrl-alt-f1
> 
> in qemu-console (Alt-2), then switching back to qemu-window (alt-1). Now
> i have access to tty1 of my livecd.
> 
> But IMHO there should be a more simple way to access to such a console
> with qemu, i.e. through a pipe, a serial console etc., but i didnt found
> anything working. The best i got was with -chardev pty,id=myid, which
> resulted in a "char device redirected to /dev/pts/0 (label myid)".  But
> with a "screen /dev/pts/0" i wasnt able to see any input or output.
> 
> ssh is unfortunatly not available at this time on the livecd (so i could
> connect i.e. via -net user,hostfwd:tcp:10022-:22)
> 
> Any hints to connect directly to a console in an emulated linux?

I use the serial console:

  $ qemu-system-x86_64 -serial stdio ...

Make sure the guest has console=ttyS0 on the kernel command-line.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Howto connect to a terminal in an emalated linux-livecd?
  2014-09-12 12:43 ` Stefan Hajnoczi
@ 2014-09-12 14:44   ` Kashyap Chamarthy
  0 siblings, 0 replies; 3+ messages in thread
From: Kashyap Chamarthy @ 2014-09-12 14:44 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Oliver Rath, kvm

On Fri, Sep 12, 2014 at 01:43:18PM +0100, Stefan Hajnoczi wrote:
> On Thu, Sep 11, 2014 at 01:48:51PM +0200, Oliver Rath wrote:
> > after hours for searching in google-world, i didnt find any appropriate
> > for this problem:
> > 
> > I want to boot a live-cd (i.e. ubuntu 14.04.1-desktop) in qemu, which
> > starts with an graphical interface, done i.e. by
> > 
> > qemu-system-x86_64 -m 3G -smp 2 -drive
> > file=ubuntu-14.04.1-desktop-i386.iso,media=cdrom,if=virtio --enable-kvm
> > 
> > Now i want to access to the console of the ubuntu-livecd. At the moment
> > i can do this over changing to text mode via
> > 
> > sendkey ctrl-alt-f1
> > 
> > in qemu-console (Alt-2), then switching back to qemu-window (alt-1). Now
> > i have access to tty1 of my livecd.
> > 
> > But IMHO there should be a more simple way to access to such a console
> > with qemu, i.e. through a pipe, a serial console etc., but i didnt found
> > anything working. The best i got was with -chardev pty,id=myid, which
> > resulted in a "char device redirected to /dev/pts/0 (label myid)".  But
> > with a "screen /dev/pts/0" i wasnt able to see any input or output.
> > 
> > ssh is unfortunatly not available at this time on the livecd (so i could
> > connect i.e. via -net user,hostfwd:tcp:10022-:22)
> > 
> > Any hints to connect directly to a console in an emulated linux?
> 
> I use the serial console:
> 
>   $ qemu-system-x86_64 -serial stdio ...
> 
> Make sure the guest has console=ttyS0 on the kernel command-line.

Just to add a little more to what Stefan wrote, here's a working CLI
(not be the most optimal) I use w/ serial console:

  $ /usr/bin/qemu-system-x86_64 -m 2048 \
      -nographic -nodefconfig -nodefaults \
      -machine accel=kvm -m 2048 \
      -drive file=./snap1-f20vm.qcow2,if=ide,format=qcow2 \
      -serial stdio

And, a little more info here[1] 

  [1]  http://rwmj.wordpress.com/2011/07/08/setting-up-a-serial-console-in-qemu-and-libvirt/

--
/kashyap

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-12 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11 11:48 Howto connect to a terminal in an emalated linux-livecd? Oliver Rath
2014-09-12 12:43 ` Stefan Hajnoczi
2014-09-12 14:44   ` Kashyap Chamarthy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.