我在Ubuntu 16.04上安装了VirtualBox,作为主机和客户机。我需要通过SSH命令行来管理客户机(仅限启动和停止),但是没有找到任何可行的解决方案。
VBoxManage list vms
列出可用的虚拟机,我以我的设置为例进行说明:andrew@ilium~$ VBoxManage list vms
"Windows 8" {c4422acd-727b-45a0-9eef-65636bcde44d}
"Windows 10" {a8e262be-a032-4918-9085-63185318a979}
"Trusty Tahr Clean Copy" {c99bcf4b-9fea-4971-b190-425cb0b0cdeb}
"Xenial Xerus Clean Copy" {850122b9-c65f-425b-abb3-ffda68e159c6}
"Precise Pangolin Clean Copy" {169086e6-a3f4-42e7-8a89-63dcb273143f}
"Precise Pangolin Working Copy" {ff8312b6-cfae-4877-aa93-d71036d8882c}
"Xenial Xerus for MPlayer" {44902710-4368-4c06-9d24-3cb55328d31c}
"Xenial Xerus for vlc" {a62ad306-17d9-4ee3-8c1a-e4439c3b0e05}
"Xenial Xerus mingw64" {584d8513-6a16-49c7-b020-d657b93d5552}
"Trusty Tahr Working copy..." {433349e9-52eb-4066-bae7-623592871839}
"Xenial Xerus Working copy..." {dda23e74-cdb5-4c7d-8836-31be4129c02a}
andrew@ilium~$
VBoxManage list runningvms
代替...VBoxManage
命令和选项来启动虚拟机是这些: startvm <uuid|vmname>...
[--type gui|sdl|headless|separate]
VBoxManage startvm "Trusty Tahr Clean Copy" --type gui
3. 停止虚拟机:
要停止虚拟机,您可以再次使用VBoxManage
,但这一次使用controlvm
选项:
controlvm <uuid|vmname>
pause|resume|reset|poweroff|savestate|
VBoxManage controlvm "Trusty Tahr Clean Copy" savestate
VBoxManage list vms
会报错吗? - andrew.46VBoxManage controlvm "Name" acpipowerbutton