VBoxManage命令用法详解

来源:互联网 发布:unity3d粒子系统水流 编辑:程序博客网 时间:2024/05/17 01:30

VBoxManage命令用法详解

VBoxManage命令用法详解
系统环境:CentOS 6.3 x86_64
VirtualBox版本:4.2.8
VirtualBox扩展版本:4.2.8

增加一个新的扩展包
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 "Win 2008" --register

将虚拟机Win 2008重命名为win2008
VBoxManage modifyvm "Win 2008" --name win2008

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

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

将虚拟机win2008的CPU个数设为2个
VBoxManage modifyvm win2008 --cpus 2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章推荐

0 0
原创粉丝点击