虚拟机名称 centos6.9-1 centos6.9-2 centos6.9-3
使用命令开机 虚拟机
VBoxManage startvm 'centos6.9-1' 正常启动
VBoxManage startvm centos6.9-2 -type vrdp 无界面启动
VBoxManage startvm centos6.9-2 --type headless 无界面启动 推荐使用
VBoxManage startvm 'centos6.9-3'
 
 
查看正在运行的虚拟机
VBoxManage list runningvms
 
关闭虚拟机
VBoxManage controlvm 'centos6.9-2' poweroff 断电关闭虚拟机
VBoxManage controlvm centos6.9-2 savestate 休眠虚拟机
VBoxManage discardstate centos6.9-2 放弃休眠,直接关闭
VBoxManage controlvm centos6.9-2 acpipowerbutton 正常关闭 centos6.9 推荐使用
 
查看快照列表
VBoxManage snapshot centos6.9-2 list
 
创建快照
VBoxManage snapshot centos6.9-2 take snap20180603 snap20180603为快照名称
删除快照
VBoxManage snapshot centos6.9-2 delete snap20180603
快照回复
uuid 使用 查看快照列表获取
VBoxManage snapshot centos6.9-2 restore 0307c6d5-1258-4cd4-984a-4341f17c1bf9 [uuid]
 
设置开机自启动
 
virtualbox(vboxmanage)自动启动虚拟机
系统centos 7,virtualbox 5,宿主机重启后,其上的虚拟机不能自动启动,怎样才能使虚拟机能随主机启动而自动启动呢?步骤如下:
步骤一:
# vi /etc/default/virtualbox
# virtualbox defaults file
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostartvm.cfg
步骤二:
#vi /etc/vbox/autostartvm.cfg
# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny
# Create an entry for each user allowed to run autostart
root = {
allow = true
startup_delay = 10
}
步骤三:
#VBoxManage setproperty autostartdbpath /etc/vbox
步骤四:centos6.9-2为需要开机自启动的虚拟机
#VBoxManage modifyvm centos6.9-2 --autostart-enabled on
步骤五:
#service vboxautostart-service restart --测试发现stop/start不能启动vm,而restart则可以
--详细操作参考参考文献【1】。
 
参考文献:
【1】 How To Set Your VirtualBox 4.2 VM to Automatically Startup ,http://lifeofageekadmin.com/how-to-set-your-virtualbox-vm-to-automatically-startup/
【2】 9.24. Starting virtual machines during system boot,http://www.virtualbox.org/manual/ch09.html#autostart
【3】 8.8.9. Auto starting VMs during host system boot,http://www.virtualbox.org/manual/ch08.html
 
如果以上不起作用的情况下
编辑shell脚本
#!/bin/bash
VBoxManage startvm centos6.9-1 --type headless
VBoxManage startvm centos6.9-2 --type headless
VBoxManage startvm centos6.9-3 --type headless
 
添加执行权限
chmod +x /etc/vbox/vm_centos.sh
加入到开机自启动脚本中
 
安装增强工具,实现文件共享
点击安装增强
 
yum -y upgrade kernel kernel-devel
yum install kernel sources kernel-devel
 
sshfs
 
挂载虚拟光驱
mount /dev/cdrom /mnt/
 
cd /mnt/ 查看列表
执行文件
./VBoxLinuxAdditions.run
 
cat /proc/version
查看版本信息,添加版本
/sbin/rcvboxadd quicksetup
/sbin/rcvboxadd quicksetup 3.10.0-957.1.3.el7.x86_64
 
/sbin/rcvboxadd quicksetup 3.10.0-957.10.1.el7.x86_64
 
执行挂载命令
 
# 挂载命令 共享目录 要挂载到的目录
mount -t vboxsf www /data/www/
 
 

VBoxManage的更多相关文章

  1. VBoxManage命令

    查看有哪些虚拟机VBoxManage list vms 查看虚拟的详细信息VBoxManage list vms –long 查看运行着的虚拟机VBoxManage list runningvms 开 ...

  2. VBoxManage: error: Cannot register the hard disk 解决办法

    将虚拟盘从一个分区拷到另外一个分区上,打开虚拟机挂载这个虚拟盘老是报错,VBoxManage: error: Cannot register the hard disk '/media/New Vol ...

  3. Virtualbox后台管理之VBoxManage

    Virtualbox是提供了后台启动的.只是不是默认的. 查看有哪些虚拟机 VBoxManage list vms 查看虚拟的详细信息 VBoxManage list vms --long 查看运行着 ...

  4. 利用VBoxManage对虚拟机格式vdi、vmdk、vhd进行互转

      虚拟机顾名思义就是虚拟出来的机器(virtual machine),虚拟化技术也是时下IT界最热门的技术,因其能更加有效利用硬件资源,整合IT应用,降低TCO,节能环保等,说白了就是一台硬件上够强 ...

  5. (原创)vagrant up 异常报错,出现 There was an error while executing `VBoxManage` 的解决方法

    最近在使用 vagrant homestead 时,不小心在虚拟机上使用了 exit 命令退出虚拟机,导致再使用 vagrant up 时出现以下错误: Bringing machine 'larav ...

  6. VBoxManage命令详解

    转自:http://zhang-ly520.iteye.com/blog/300606 由于最近工作对vbox有一定涉猎,发现这个写的比较好,先转来,稍有空时再根据自己的心得整理一下. VBoxMan ...

  7. VBoxManage 命令行使用

    原文地址:http://cnjun939.blog.163.com/blog/static/78144538201251474311135/ 由于最近需研究virtualbox,看好看到上面的网址有, ...

  8. VBoxManage.exe: error: Resize hard disk operation for this format is not implemented yet!

    VirtualBox虚拟磁盘空间不够了,默认10G.想扩大,图形界面下没有找到可操作菜单.Google了一下用 Vbox自带的命令工具VBoxManage即可解决. C:\Program Files\ ...

  9. Vboxmanage改动uuid报错的解决的方法

    我的环境: Virtualbox 4.3.10 r93012 操作系统:win7 问题:Virtualbox在使用拷贝的虚拟盘时会提示uuid冲突: Because a hard disk with ...

  10. VBoxManage命令速记

    1.IDE控制器创建:VBoxManage storagectl testvm --name "IDE Controller" --add ide卸载VBoxManage stor ...

随机推荐

  1. HDU 1754 线段树入门解题报告

    ---恢复内容开始--- 题意:给定区间,每个人的成绩, Q次询问,求每次询问区间中的最大值 思路:构造线段树 代码: #include<stdio.h> #include<algo ...

  2. 在visual studio code 中配置python以及解决中文乱码问题

    安装好 visual stuido code (下面简称 “ VSC ”)后,要想使用它运行调试 python 代码还需要做一些工作以解决下列问题: 搭建 python 环境 print 打印中文出现 ...

  3. note_The Top Risks of Requirements Engineering

    The risk is greatest at several points: 1. Overlooking a crucial requirement This one the greatest r ...

  4. Azure基础(三)- Azure的物理架构和服务保证

    Azure fundamentals - Core Cloud Services - Azure architecture and service guarantees Azure provides ...

  5. git加速和只下载部分目录

    浅复制 工作要用到的.git有1.8G太大了.下载过程要好几个小时,太慢了.可以这样操作 git clone 默认会下载项目的完整历史版本,如果你只关心最新版的代码,而不关心之前的历史信息,可以使用 ...

  6. 分享一个不错的Unittest测试报告

    分享一个不错的,unittest测试报告. 先上图: 代码如下: 复制下来保存成py可用 #coding=utf-8 """ A TestRunner for use w ...

  7. PHP----------一群猴子排成一圈,按1,2,...,n依次编号。

    1.一群猴子排成一圈,按1,2,...,n依次编号.然后从第1只开始数,数到第m只,把它踢出圈,从它后面再开始数,再数到第m只,在把它踢出去...,如此不停的进行下去, 直到最后只剩下一只猴子为止,那 ...

  8. python [[1,2],[3,4],[5,6]]一行代码展开该列表,得出[1,2,3,4,5,6]

    #1)利用推导式运行过程:for i in a ,每个i是[1,2],[3,4],[5,6],for j in i,每个j就是1,2,3,4,5,6,合并后就是结果 a=[[1,2],[3,4],[5 ...

  9. jenkins+Gitlab+maven+tomcat实现自动集成、打包、部署

    一.前言 首先出于提高自己技术水平和琢磨能做点什么能提高工作效率,上线工作实在无聊.重复(手动编译.打包,传包,重启),于是就想到了jenkins,jenkins持续集成已经不是什么新鲜的话题,网上文 ...

  10. (.NET高级课程笔记)委托、事件总结

      1.委托的声明.实例化和调用 同样的,也可以把事务写成上面的形式 2.泛型委托---Func.Action 3.委托的意义:解耦 4.委托的意义:异步多线程 5.委托的意义:多播委托 6.观察者模 ...