$ sudo virsh -c qemu:///system list Id Name State ---------------------------------- 1 Ubuntu running 2 Ubuntu-Server running # virsh list Id Name State ---------------------------------------------------- 1 Ubuntu running 2 CentOS6.4 running
# virsh 显示虚拟机列表: virsh # list --all 启动虚拟机: virsh # start [name] 关闭虚拟机: virsh # shutdown [name] 重启虚拟机: virsh # reboot [name] 指定虚拟机开机自动启动: virsh # autostart [name]
例 167.1. virsh
virsh # list --all Id Name State ---------------------------------------------------- - CentOS6.4 shut off - FreeBSD shut off - Test shut off - Ubuntu shut off - www shut off virsh # start Ubuntu Domain Ubuntu started virsh # list --all Id Name State ---------------------------------------------------- 1 Ubuntu running - CentOS6.4 shut off - FreeBSD shut off - Test shut off - www shut off virsh # quit
# virsh list Id Name State ---------------------------------------------------- 2 monitor running # virsh console monitor Connected to domain monitor Escape character is ^]
Ctrl + ] 推出 console
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。