LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Starting a VM in KVM (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/starting-a-vm-in-kvm-4175465208/)

RickCheung 06-08-2013 03:10 AM

Starting a VM in KVM
 
I installed a VM on KVM by using virt-install --name NAME ... command. Then, I can use virsh start NAME to start this VM. After that, I used virsh undefine NAME. Then, when I tried to use virsh start NAME command to start the VM again, but it showed that there is no VM with name NAME existing. Anybody know how to fix this and start the VM again? Thank you!

dyasny 06-08-2013 11:39 AM

undefine deletes the VM definitions. virsh will no longer have a reference to the VM you created. You need to create a new VM, and if the old disk image is still intact, you might be able to attach it to the new VM, and have the old data there

crudo 06-17-2013 03:08 PM

Just to complement what @RickCheung said, to stop your virtual machine in kvm you need to type:
virsh shutdown <vmname>

dt64 07-29-2013 09:29 AM

Quote:

Originally Posted by crudo (Post 4973670)
Just to complement what @RickCheung said, to stop your virtual machine in kvm you need to type:
virsh shutdown <vmname>

just to ad another little bit in case the VM doesn't shutdown properly (sometimes happens e.g. with Windows guests):

virsh destroy <vmname>

This works like pulling the power cord from a physical machine.


All times are GMT -5. The time now is 09:48 PM.