VirtualBox命令行操作

关键词:virtualbox 命令行 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

vitual box 无法开启嵌套虚拟化

https://blog.csdn.net/holderlinzhang/article/details/104260531?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

凯尔kyle

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值