How to automatically start VM created by virt-manager?
Posted
by Jeff Shattock
on Server Fault
See other posts from Server Fault
or by Jeff Shattock
Published on 2010-05-22T21:14:23Z
Indexed on
2010/05/22
21:21 UTC
Read the original article
Hit count: 216
virtualization
|kvm
I have created a virtual machine with virt-manager that runs on kvm/qemu. The machine works well when started through virt-manager. However, I would like to be able to start and stop the VM through a script in init.d, so that it comes up and down along with the host. I need to have virt-manager show that the machine is running, and to be able to connect to its console through there.
When I use the command line that is produced by running ps -eaf | grep kvm
after starting the vm through virt-manager, I get some console messages about redirected character devices, but the machine does start and runs properly. However, I do not get any indication from virt-manager that it has started. How can I modify the command line to get virt-manager to pick up the running VM? Is there anything else about the command line that should change when starting outside of virt-manager?
Command line is (slightly reformatted for readability):
/usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 512 -smp 1 -name BORON \
-uuid fa7e5fbd-7d8e-43c4-ebd9-1504a4383eb1 \
-chardev socket,id=monitor,path=/var/lib/libvirt/qemu/BORON.monitor,server,nowait \
-monitor chardev:monitor -localtime -boot c \
-drive file=/dev/FS1/BORON,if=ide,index=0,boot=on,format=raw \
-net nic,macaddr=52:54:00:20:0b:fd,vlan=0,name=nic.0 \
-net tap,fd=41,vlan=0,name=tap.0 -chardev pty,id=serial0 -serial chardev:serial0 \
-parallel none -usb -usbdevice tablet -vnc 127.0.0.1:1 -k en-us -vga cirrus
© Server Fault or respective owner