title: Redirect Qemu console to a file or the host terminal?
body: <h3>Background:</h3>
  <p>My system is an x86-based kernel and <a href="https://en.wikipedia.org/wiki/List_of_RAM_drive_software#Tmpfs_and_ramfs" rel="nofollow noreferrer">ramfs</a>-based root filesystem. I have made the ramfs-based on the cpio archive (which will use boot=/dev/ram0 as the RAM device), and I am having some issues with the init. The whole intention is to optimise the ramfs to the minimum to fit in a really small system. I am trying to debug the problem in the init. I start <a href="http://en.wikipedia.org/wiki/QEMU" rel="nofollow noreferrer">QEMU</a> in <a href="http://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Ubuntu_12.10_.28Quantal_Quetzal.29" rel="nofollow noreferrer">Ubuntu 12.10</a> (Quantal Quetzal) using the command:</p>
  <pre><code>qemu-system-x86_64 -kernel linux-3.9.2/arch/x86/boot/bzImage -serial stdio \
      -append &quot;root=/dev/ram0 console=tty1&quot;
  </code></pre>
  <p>And as expected the system goes to OOPS.</p>
  <h3>Question:</h3>
  <p>I would like to see the logs to investigate the reason for the crash, but I cannot navigate in the QEMU console using the <kbd>Shift</kbd> key and <kbd>Page Up</kbd>/<kbd>Page Down</kbd>. So I tried redirecting the output to the host terminal using curses by the command:</p>
  <pre><code>qemu-system-x86_64 -kernel linux-3.9.2/arch/x86/boot/bzImage -serial stdio \
      -append &quot;root=/dev/ram0 console=tty1&quot; -curses
  </code></pre>
  <p>But here again I am unable to navigate and find the problem.</p>
  <p>P.S. If my system boots fine (using the correct rootfs) then I am able to navigate and see the messages.</p>
  <p>How do I redirect the messages to the terminal or to a file?</p>