Connecting a Console to DomU's

From Xen
(Redirected from DomUConsoleConnect)
Jump to navigationJump to search


This article describes the common guest console operations.

Connect to guest console

From dom0:

# xm console <domid>

It will invoke /usr/lib/xen/bin/xenconsole.

Instead, you can use this shell xenconsole.sh (require socat):

# #!/bin/sh

domid=$1
tty=$(xenstore-read /local/domain/${domid}/console/tty)
socat - ${tty},IGNBRK=0,BRKINT=0,PARMRK=0,ISTRIP=0,INLCR=0,IGNCR=0,ICRNL=0,IXON=0,OPOST=0,ECHO=0,ECHONL=0,ICANON=0,ISIG=0,IEXTEN=0,CSIZE=0,PARENB=0,CS8


Invoke it by:

# xenconsole.sh <domid>


Connect two guest consoles

Some times useful to connect two guest consoles, eg. debugging a guest from another by emulated serial console.

You can use this shell connect.sh (require socat):

#!/bin/sh

src=$1
dst=$2
srctty=$(xenstore-read /local/domain/${src}/console/tty)
dsttty=$(xenstore-read /local/domain/${dst}/console/tty)
socat ${srctty} ${dsttty}


Invoke it by:

# connect.sh <domid1> <domid2> 


Reference