Tuesday, November 5, 2013

How to redirect console output of Virtualbox VM to host?


After I started using Ubuntu VM in VirtualBox, I needed my ubuntu VM's console output to be redirected so that I can see panic output that spans multiple screens. The way to achieve such redirection is by creating a serial interface in the VM & then enabling redirection in boot options of the VM. 

Let me provide the steps I used to achieve this redirection:
  • I opened VirtualBox, selected my VM, clicked "Settings".
  • Next, selected my VM & clicked on "Settings" in VirtualBox top menu.
  • Next, clicked on "Ports" tab:
                         
  • Next, checked "Enable Serial Port" & provided file path & name to which redirection should happen:
                          
  • Next, started the VM & edited boot options during linux booting to add "console=ttyS0 console=tty0 ignore_loglevel"
  • Then, in the host, tail-ed /tmp/file. As the console output of virtualbox VM is configured to be redirected to serial console (which is in turn a host file), this file contains the console messages redirected to serial console in virtualbox VM.

Reference:
https://www.virtualbox.org/wiki/Serial_redirect

No comments:

UA-48797665-1