User Tools

Site Tools


Sidebar

unix:virtualization:virtlib:quickreference

virt-lib Quick Reference

virt-top

This is not always installed by default. When run, it will bring up a full console window that shows all virtuals running on a system, similar to the top command.

virsh

The main controller for virt-lib. The basic format of the command is

virsh command parameters

. man virsh or simply virsh –help are your friends.

Some common commands are:

  • list –all - list all domains virt-lib knows about and show their state (running, off, whatever)
  • start name - starts the domain named name (name from list –all)
  • reboot name
  • shutdown name
  • dumpxml name dumps the config to STDOUT
  • list –autostart - list all domains which will autostart
  • autostart domain - set domain to be autostarted in the future
  • autostart –disable domain - unset autostart flag for domain
  • console domain - attaches to the serial console of domain assuming the port has been set up.
    • attach-interface –domain pxe –type bridge –source br1 –model virtio –config –live
    • detach-interface –domain pxe –type bridge –mac 52:54:00:47:2f:eb –config

Remove a network from the entire system

virsh net-list --all
virsh net-destroy br1
virsh net-undefine br1
virsh net-list --all

convert config file to native

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

domxml to native

unix/virtualization/virtlib/quickreference.txt · Last modified: 2020/10/17 02:45 by rodolico