Command-line tool to connect to a VirtualBox guest console

remote desktopvirtualbox

Is there a tool or library to connect to a VirtualBox guest console (such as XM console) for Xen? A few requirements include:

  • Tools different than SSH
  • Other than PHPvVrtualBox
  • Not a GUI client (I’m connecting from the command-line)
  • It should require making as few changes to guest settings as possible

Best Answer

To my knowledge, there is no equivalent to Xen xm console for VirtualBox, so you need to tweak it.

If you want to access the guest console from any host, you first need to configure VirtualBox to use the serial port and then redirect this serial port in some way. On a UNIX system, VirtualBox makes the serial port available through a socket (not really a pipe).

From the VirtualBox host, you can either transform this socket in a pty, allowing to connect with a tool like screen or you can transform the UNIX socket in a TCP socket, then allowing remote connections with a tool like telnet.

Depending on the OS running on the guest, you need to tell it to actually put the console on the serial port. This is usually possible through the boot loader or even the first screen of the installation manager. Here is such an example with a Solaris installation. So this can work before any network is available on the guest and you can see the full boot sequence like if you were in front of the guest machine.

Here is another example to debug a booting linux kernel.

Related Question