17.3. Starting and Controlling Xen Domains with xm

Xen automatically reduces the amount of memory of Domain-0 to meet the requirements of the newly started guest domain. If there is not enough memory available, the guest is not started. You can always check the available memory of Domain-0 with the command free.

It is always possible to detach a console or reattach it from another terminal. To detach, use Ctrl-]. To reattach, first check the ID of the needed guest with xm list and attach to that ID with xm console ID.

The xm tool of Xen has many possible parameters. View a list with a short explanation by entering xm help. Table 17.1, “xm Commands” provides some of the most important commands as a starting point.

Table 17.1. xm Commands

xm help

Print a list of commands that are available for the xm tool.

xm console ID

Connect to the first console (tty1) of the guest with ID ID.

xm mem-set ID Mem

Set the memory size of the domain with ID ID to Mem in MB.

xm create domname [-c]

Start the domain with configuration file domname. The optional -c links the current terminal to the first tty of the new guest.

xm shutdown ID

Do a normal shutdown of the guest with ID ID.

xm destroy ID

Terminate the guest with ID ID immediately.

xm list

Print a list of all running domains with their respective ID, memory, and CPU time values.

xm info

Display information about the Xen host, including CPU and memory information.