Chapter 28. The xm command quick reference


The xm command can manage the Xen hypervisor. Most operations can be performed with the libvirt tools, virt-manager application or the virsh command. The xm command does not have the error checking capacity of the libvirt tools and should not be used for tasks the libvirt tools support.
There are a few operations which currently can not be performed using virt-manager. Some options for other Xen implementations of the xm command do not work in Red Hat Enterprise Linux 5. The list below provides an overview of command options available and unavailable.

Warning

It is advised to use virsh or virt-manager instead of xm. The xm command does not handle error checking or configuration file errors very well and mistakes can lead to system instability or errors in virtual machines. Editing Xen configuration files manually is dangerous and should be avoided. Use this chapter at your own risk.
Basic management options

The following are basic and commonly used xm commands:

  • xm help [--long]: view available options and help text.
  • use the xm list command to list active domains:
    $ xm list
    Name                                ID  Mem(MiB)   VCPUs      State      Time(s)
    Domain-0                            0     520       2         r-----     1275.5
    r5b2-mySQL01                       13     500       1         -b----       16.1
    
    Copy to Clipboard Toggle word wrap
  • xm create [-c] DomainName/ID: start a virtual machine. If the -c option is used, the start up process will attach to the guest's console.
  • xm console DomainName/ID: attach to a virtual machine's console.
  • xm destroy DomainName/ID: terminates a virtual machine , similar to a power off.
  • xm reboot DomainName/ID: reboot a virtual machine, runs through the normal system shut down and start up process.
  • xm shutdown DomainName/ID: shut down a virtual machine, runs a normal system shut down procedure.
  • xm pause
  • xm unpause
  • xm save
  • xm restore [-p] DomainName/ID: resume the state, and the execution of the domain. If the -p option is used, the domain will not be unpaused after restoring it.
  • xm migrate
Resource management options

Use the following xm commands to manage resources:

  • xm mem-set
  • use the xm vcpu-list to list virtualized CPU affinities:
    $ xm vcpu-list
    Name                          ID  VCPUs   CPU State  Time(s)  CPU Affinity
    Domain-0                       0    0      0    r--   708.9    any cpu
    Domain-0                       0    1      1   -b-    572.1    any cpu
    r5b2-mySQL01                  13    0      1   -b-     16.1    any cpu
    
    Copy to Clipboard Toggle word wrap
  • xm vcpu-pin
  • xm vcpu-set
  • use the xm sched-credit command to display scheduler parameters for a given domain:
    $ xm sched-credit -d 0
    {'cap': 0, 'weight': 256}
    $ xm sched-credit -d 13
    {'cap': 25, 'weight': 256}
    
    Copy to Clipboard Toggle word wrap
Monitoring and troubleshooting options

Use the following xm commands for monitoring and troubleshooting:

  • xm top
  • xm dmesg
  • xm info
  • xm log
  • use the xm uptime to display the uptime of guests and hosts:
    $ xm uptime
    Name                       ID  Uptime
    Domain-0                    0  3:42:18
    r5b2-mySQL01               13  0:06:27
    
    Copy to Clipboard Toggle word wrap
  • xm sysrq
  • xm dump-core
  • xm rename
  • xm domid
  • xm domname
Currently unsupported options

The xm vnet-list is currently unsupported.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat