VirtualBox Command Line
最近在用 VirtualBox 运行虚拟机的时候,由于图形窗口太多了,于是就查找了一些便于管理 VirtualBox 的命令
用命令行的方式可以避免打开更多的窗口,直接使用命令行,也不用用鼠标来回的选择控制虚拟机啦
To find a list of the VMs, issue the command
VBoxManage list vms
list [--long|-l]
vms|runningvms|ostypes|hostdvds|hostfloppies|
intnets|bridgedifs|hostonlyifs|natnets|dhcpservers|
hostinfo|hostcpuids|hddbackends|hdds|dvds|floppies|
usbhost|usbfil‐ters|systemproperties|extpacks|
groups|webcams|screenshotformats
Say we want to run the “Ubuntu Server” VM as a headless instance. To do this,
you would issue the command:
VBoxManage startvm "Ubuntu Server" --type headless
The VM will start up and hand you back your bash prompt. Your virtual server (if
that’s how you’re using the VM) is now available to you.
If you need to pause that VM, issue the command:
VBoxManage controlvm "Ubuntu Server" pause --type headless
To restart that paused VM, issue the command:
VBoxManage controlvm "Ubuntu Server" resume --type headless
To shut down the VM, issue the command:
VBoxManage controlvm "Ubuntu Server" poweroff --type headless