虚拟机名称 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. btcpool之Stratum协议

    一.简介 矿机(或挖矿软件)与矿池之间通过stratum协议通讯,它包括订阅.授权.下发难度.下发任务.提交share五种消息. 二.订阅(mining.subscribe) 矿机启动后,先和矿池建立 ...

  2. angular当router使用userhash:false时路由404问题

    angular当router使用userhash:false时路由404问题 安装iis urlrewrite2.0组件 在根目录下创建 Web.config <configuration> ...

  3. nginx中的超时设置,请求超时、响应等待超时等

    nginx比较强大,可以针对单个域名请求做出单个连接超时的配置. 比如些动态解释和静态解释可以根据业务的需求配置 proxy_connect_timeout :后端服务器连接的超时时间_发起握手等候响 ...

  4. JavaWeb初级进阶高级学习方向计划

    阶段1 语言基础 课程一.Java负基础扫盲课 1.初识Java 本课程从java开发环境配置开始,讲解了java语法基础 .类和面向对象.面向对象编程三大特性:封装.继承.多态.建议零基础学员从本课 ...

  5. ESP8266清理flash学习记录

    学习来源:http://bbs.eeworld.com.cn/thread-497588-1-1.html 还稍看了电子产品世界 主要内容 1在windows 上通过 命令行 安装  Python环境 ...

  6. Go 初体验 - 常量 与 iota

    常量的概念跟大多数语言一样,都是定义一个不可变的数值 go 语言支持常量,但没有 C# 中的枚举类型,所以常量在 go 语言里多用于枚举 上代码,有注释 输出: 在来看这个代码: 注释已说明结果 io ...

  7. 小程序wx:for Do not set same key \"NaN\" in wx:key.

    在使用wx:for的时候出现了Do not set same key \"NaN\" in wx:key. 去网上查看资料,说是使用wx:key 试了一下,没用 字面意思是不要设置 ...

  8. CentOS 7 搭建Squid代理服务器

    Squid安装 官方地址:http://www.squid-cache.org/ [root@DaMoWang ~]# -r6d8f397.tar.gz [root@DaMoWang ~]# -r6d ...

  9. git 本地提交代码到 github 远程库,没有弹框 github login

     git 本地提交代码到 github 远程库,没有弹框 github login:  原因: win10 有个凭据管理器,给保存了历史登陆用户名密码,导致无法切换用户. 解决办法: 删除历史登陆用户 ...

  10. LapSRN

    Deep Laplacian Pyramid Networks for Fast and Accurate Super-Resolution 解决问题: 1.bicubic预处理上下采样,计算复杂度高 ...