KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

Tip: How to prevent yourself from accidentally killing your virtual machine

Have you ever accidentally killed your virtual machine by clicking the close icon on your virtual machine window? Well if you have, you’re not the first and there’s a way to prevent it. You can prevent it from happening by using the –no-quit option when starting your virtual machine from the command line. Bear in mind though that this only applies if you’re not using vnc to access your virtual machine ie. you’re not running your virtual machine as a daemon. You can try out this feature by starting your virtual machine with the –no-quit option like so

qemu-system-x86_64 –m 400 –hda windows.img –no-quit

Now if you try closing the window with your virtual machine running nothing will happen.

 

 

You can no longer kill your virtual machine by closing the window whether accidentally or intentionally; you’re forced to shut it down gracefully from within the guest .