VBoxManage

VBoxManage 使用

cd /mnt/c/Program\ Files/Oracle/VirtualBox

显示所有虚拟机
root@DESKTOP-PM5KOT8:/mnt/c/Program Files/Oracle/VirtualBox# ./VBoxManage.exe  list vms
"win10" {be8f8a1f-cc37-40c3-976a-9de56d666ed1}                        
"ubuntu14" {8647c815-ac12-4527-9735-3589c82abb77}                     
"MacOS10.12" {5af7fac7-37e8-4abb-b6df-027d1ad9b977}                   
"ubuntu-18.04.2-desktop-amd64" {27cc697f-647e-4e58-99d9-b32f47e0f3ba} 
"centos7.6std" {ffd4b832-3324-4728-a0a1-182961f21617}                 
"k8s001" {e52977e9-7bfa-4f77-aab1-d30e5c8f9fb0}                       
"k8s002" {0ee4d271-9682-461a-859c-b6deca7a531a}                       
"k8s003" {86a3d4f7-ac42-41e8-8f94-9d3448158195}                       
"frp-manager" {d2e155be-4539-4642-99a4-aedda1b15b55} 



启动虚拟机
./VBoxManage.exe  startvm k8s001 --type headless
root@DESKTOP-PM5KOT8:/mnt/c/Program Files/Oracle/VirtualBox# ./VBoxManage.exe  startvm k8s001 --type headless 
Waiting for VM "k8s001" to power on... 
VM "k8s001" has been successfully started. 


显示所有启动的虚拟机
root@DESKTOP-PM5KOT8:/mnt/c/Program Files/Oracle/VirtualBox# ./VBoxManage.exe  list runningvms
"k8s001" {e52977e9-7bfa-4f77-aab1-d30e5c8f9fb0} 
"k8s002" {0ee4d271-9682-461a-859c-b6deca7a531a} 
"k8s003" {86a3d4f7-ac42-41e8-8f94-9d3448158195} 


关闭虚拟机
./VBoxManage.exe controlvm k8s001 poweroff; ./VBoxManage.exe controlvm k8s002 poweroff; ./VBoxManage.exe controlvm k8s003 poweroff


修改虚拟机的描述信息
./VBoxManage.exe  modifyvm ubuntu14   --description "hello2"


查看单个虚拟机的详细信息
root@DESKTOP-PM5KOT8:/mnt/c/Program Files/Oracle/VirtualBox# ./VBoxManage.exe  showvminfo k8s003 | grep -i state
State:                       running (since 2019-10-28T06:41:42.355000000)
./VBoxManage.exe  showvminfo "centos7.6std"


克隆虚拟机
cd /mnt/c/Program\ Files/Oracle/VirtualBox
./VBoxManage.exe clonevm centos7.6std --basefolder  /xpc/xvm --mode machine --name k8s004 --register --options link --snapshot init2
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% 
Machine has been successfully cloned as "k8s004"   


创建快照
root@DESKTOP-PM5KOT8:/mnt/c/Program Files/Oracle/VirtualBox# ./VBoxManage.exe  snapshot  k8s004 list
This machine does not have any snapshots
root@DESKTOP-PM5KOT8:/mnt/c/Program Files/Oracle/VirtualBox# ./VBoxManage.exe  snapshot  k8s004 take s1 --description "首次克隆" --live
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% 
Snapshot taken. UUID: 59c0b8b9-131d-454b-8a6f-3acd40ad308c      
root@DESKTOP-PM5KOT8:/mnt/c/Program Files/Oracle/VirtualBox# ./VBoxManage.exe  snapshot  k8s004 list
   Name: s1 (UUID: 59c0b8b9-131d-454b-8a6f-3acd40ad308c) * 
   Description:                                            
首次克隆

virtual box 磁盘共享

https://baijiahao.baidu.com/s?id=1618882235985759900&wfr=spider&for=pc