I've configured some virtual machine under Xen on Debian Squeeze using libvirt with virsh. Now I want to get rid of the libvirt layer, because I need to configure some specific parameters on the DomUs that are not supported by libvirt.

  1. How can I export my config ?
  2. How can I import the native config file to Xen ?

Thank you for any suggestion !

  • How does the current configuration look like? Can you post it?
    – Nils
    Jan 17, 2012 at 21:15
  • What do you want to know ? I use sudo virsh list to list domaind and sudo virsh edit vmname to edit DomUs configuration. I want to export libvirt xml config, uninstall libvirt, and after convert xml xonfig to native Xen and use it. Please ask whatever you want to know.
    – GabrieleV
    Jan 17, 2012 at 21:24
  • I don`t know how a libvirt config looks like, but I know that xen understands XML format quite well. So post your libvirt xml config here. I suspect you can use it with XEN right away (btw - which xen version?)
    – Nils
    Jan 17, 2012 at 21:43

3 Answers 3


You would export the xml config and then convert it to XEN Configs:

virsh -c xen:/// domxml-to-native xen-xm rhel5pv.xml



An update: Newer versions of Xen have a new toolstack: xen-light, so from xen 4.1 onwards the xm command is superceded by xl.

While xl's domain configuration files are backwards compatible, to make sure all domain parameters are correctly mapped into the latest configuration during conversion I would suggest to use:

virsh -c xen:/// domxml-to-native --format xen-xl \
    /path/to/libvirt/vm.domxml.cfg > vm.xenxl.cfg

(note the use of xen-xl instead of xen-xm).

Then, you can create the vm directly on Xen using the generated file:

xl create -f vm.xenxl.cfg

(Documenting it here, as the virsh command reference section for domxml-to-native says "Options: Needs to be written")


If u just want to edit domU's configuration, try below,

virsh edit vm-name

It will use vi to open xml by default

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.