KVM Iniciar máquinas virtuais

De Wiki do Bernardino
Ir para: navegação, pesquisa

1. Use virsh to connect to the local KVM host:

$ sudo virsh --connect qemu:///system
Connecting to uri: qemu:///system
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
      'quit' to quit

virsh #

2. List all the virtual machines to make sure it is being managed by virsh

virsh # list --all
 Id Name                 State
----------------------------------
  1 dns                  running
  2 webserver            running
  3 webserver2           running

2a. If the virtual machine is not currently in virsh, then define it.

virsh define /etc/libvirt/qemu/<vm-name>.xml

3. Start machine.

virsh # start <vm-name>

4. Set it to autostart.

virsh # autostart <vm-name>