VBoxManage常用命令用法

VBoxManage命令常用用法
系统环境:CentOS 7.3 x86_64
VirtualBox版本:6.1.22
VirtualBox扩展版本:6.1.22

增加一个新的扩展包
VBoxManage extpack install <.vbox-extpack>

卸载指定扩展包
VBoxManage extpack uninstall <name>

显示已安装的扩展包
VBoxManage list extpacks

移除安装扩展包失败或卸载扩展包失败时可能遗留下来的文件和目录
VBoxManage extpack cleanup

列出所有的虚拟机
VBoxManage list vms

显示所有虚拟机的配置信息
VBoxManage list vms --long

列出所有正在运行的虚拟机
VBoxManage list runningvms

列出VirtualBox所能识别的所有客户机操作系统
VBoxManage list ostypes

显示主机的Hardware time、CPU、内存、操作系统及系统版本信息
VBoxManage list hostinfo
//输出中的"Processor count"指的是CPU的线程数

列出所有VirtualBox支持的虚拟磁盘后端
VBoxManage list hddbackends

列出VirtualBox当前正在使用的虚拟磁盘的信息
VBoxManage list hdds

列出虚拟机配置文件中加载的虚拟磁盘镜像的信息
VBoxManage list dvds

显示VirtualBox的一些全局设置信息,包括Guest Additions文件的路径
VBoxManage list systemproperties

显示虚拟机的配置信息
VBoxManage showvminfo <uuid>|<name>

详细显示虚拟机的配置信息
VBoxManage showvminfo <uuid>|<name> [--details]

创建并注册一个虚拟机
VBoxManage createvm --name "centos-7-20210521" --register

将虚拟机centos-7-20210521重命名为centos-7-20210521
VBoxManage modifyvm "centos-7-20210521" --name centos-7-20210521

将虚拟机centos-7-20210521的操作系统类型改为Windows 2008(32位)
VBoxManage modifyvm centos-7-20210521 --ostype Windows2008

修改虚拟机的内存大小
VBoxManage modifyvm <uuid|name> [--memory <memorysize in MB>]

将虚拟机centos-7-20210521的CPU个数设为2个
VBoxManage modifyvm centos-7-20210521 --cpus 2

将虚拟机的第一启动设备设为硬盘
VBoxManage modifyvm centos-7-20210521 --boot1 disk

将虚拟机centos-7-20210521的第一个网卡的网络连接方式设为桥接
VBoxManage modifyvm centos-7-20210521 --nic1 bridged

将虚拟机centos-7-20210521的第一个网卡的网卡芯片类型设为82540EM
VBoxManage modifyvm centos-7-20210521 --nictype1 82540EM

将虚拟机centos-7-20210521的第一个网卡桥接到host的eth0网卡上
VBoxManage modifyvm centos-7-20210521 --bridgeadapter1 eth0
//前提是虚拟网卡1使用的网络连接方式是桥接

开启VirtualBox remote desktop extension (VRDE) server
VBoxManage modifyvm centos-7-20210521 --vrde on
//VRDE server的默认监听地址为0.0.0.0,默认监听端口为3389

以VBoxHeadless作为前端来启动虚拟机centos-7-20210521
VBoxManage startvm centos-7-20210521 --type headless

创建一个大小为100G的虚拟硬盘
VBoxManage createhd --filename centos-7-20210521.vdi --size 102400

给虚拟机centos-7-20210521添加一个IDE控制器
VBoxManage storagectl centos-7-20210521 --name "IDE Controller" --add ide --controller PIIX4

将centos-7-20210521.vdi文件作为虚拟机centos-7-20210521的第一块IDE硬盘
VBoxManage storageattach centos-7-20210521 --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium centos-7-20210521.vdi

配置第一个IDE光驱,并挂载安装光盘
VBoxManage storageattach centos-7-20210521 --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium server_2008_64.iso

将主机的/home/vbox目录共享给Guest虚拟机centos-7-20210521,且共享名为share
VBoxManage sharedfolder add centos-7-20210521 --name share --hostpath /home/vbox
//该命令必须在关闭虚拟机之后才能执行

将主机的/home/vbox目录瞬间共享给Guest虚拟机centos-7-20210521,且共享名为share
VBoxManage sharedfolder add centos-7-20210521 --name share --hostpath /home/vbox --transient
//该命令在虚拟机运行时就可以执行,但当虚拟机关闭(指虚拟机的状态为poweroff)后该共享文件夹不会保留

备注:
1.使用VBoxManage modifyvm命令的前提是虚拟机已经处于关机状态;

2.在fedora33 x86_64 + VirtualBox 6.1.22 + CentOS 7.3 x86_64(VirtualBox创建的虚拟机)的环境下,网卡芯片的默认类型为Am79C973,若使用这个类型的网卡芯片,CentOS 7.3 x86_64 装好后网卡是没有驱动的;

参考:《VBoxManage命令用法详解》

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

purple.taro

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

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

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

打赏作者

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

抵扣说明:

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

余额充值