Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #201631

Re: qemu redirecting guest output in terminal

From Reco <recoverym4n@enotuniq.net>
Newsgroups linux.debian.user
Subject Re: qemu redirecting guest output in terminal
Date 2018-10-25 21:00 +0200
Message-ID <wMT1n-2o5-7@gated-at.bofh.it> (permalink)
References <wMPKa-zx-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


	Hi.

On Thu, Oct 25, 2018 at 05:20:46PM +0200, john doe wrote:
> Hi,
> 
> I'm trying to install Debian, it works if I do use the below command:
> 
> qemu -hda debian.img -cdrom debian-9.5.0-amd64-netinst.iso -boot d -m 1024
> 
> I'd like to redirect the output of the guest (Debian) to the terminal so
> I have added '-nographic':
> 
> qemu -hda debian.img -cdrom debian-9.5.0-amd64-netinst.iso -boot d -m
> 1024 -nographic
> 
> The guest is running but I don't see any Debian output in the terminal.
> 
> What argument(s) should I use to redirect the output of the guest in the
> terminal?
> 
> I appriciate any input.

That's tricky one.
-nographic means you discard VGA/keyboard/mouse emulation and the only
means of user interaction is RS232 emulation.

And that means that now you have three problems:

1) All x86 bootloaders in Debian are configured for VGA/keyboard
input/output.
That includes GRUB2 in a conventional install, and syslinux that's used
in installer.

2) Linux kernel built for x86 use VGA for output by default.
RS232 means appending something like 'console=ttyS0,115200n8' to
kernel's commandline.

3) Systemd respects console= from kernel's commandline, but I cannot say
the same for other init systems.


But, you're using QEMU and that means you're in luck.
Unpack netinst image, extract vmlinux and initrd.gz from it. You won't
need anything else from it anyway.

Run QEMU this way:

qemu -hda debian.img -m 1024 -nographic \
	-kernel vmlinux -append 'console=ttyS0,115200n8' \
	-initrd initrd.gz

Replace -kernel, -initrd and -append with '-boot c' after the
installation.
Also consider using '-M q35' instead of old '-M pc' you're using now.

Reco

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

qemu redirecting guest output in terminal john doe <johndoe65534@mail.com> - 2018-10-25 17:30 +0200
  Re: qemu redirecting guest output in terminal Reco <recoverym4n@enotuniq.net> - 2018-10-25 21:00 +0200
    Re: qemu redirecting guest output in terminal john doe <johndoe65534@mail.com> - 2018-10-26 09:20 +0200
      Re: qemu redirecting guest output in terminal john doe <johndoe65534@mail.com> - 2018-10-26 15:40 +0200
        Re: qemu redirecting guest output in terminal Reco <recoverym4n@enotuniq.net> - 2018-10-26 16:50 +0200
          Re: qemu redirecting guest output in terminal john doe <johndoe65534@mail.com> - 2018-10-28 18:00 +0100
            Re: qemu redirecting guest output in terminal Reco <recoverym4n@enotuniq.net> - 2018-10-28 18:40 +0100
              Re: qemu redirecting guest output in terminal john doe <johndoe65534@mail.com> - 2018-10-28 20:20 +0100

csiph-web