虚拟机名称 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. what's the 灰盒测试

    what's the 灰盒测试 灰盒测试的概念:是一种综合测试的方法,他将白盒测试和黑盒测试结合在一起,构成一种无缝测试技术. 灰盒测试的思想:是基于程序运行时的外部表现又结合程序内部逻辑结构来设计测 ...

  2. vue/cli3 配置相对路径

    根目录下新建 vue.config.js 文件 const path = require('path') function resolve(dir){ return path.join(__dirna ...

  3. 20175211 2018-2019-2 《Java程序设计》第五周学习总结

    目录 教材学习内容总结 第六章 接口与实现 教材学习中的问题和解决过程 代码调试中的问题和解决过程 代码托管 上周考试错题总结 学习进度条 参考资料 教材学习内容总结 第六章 接口与实现 6.1 接口 ...

  4. python类与对象-如何为创建大量实例节省内存

    如何为创建大量实例节省内存 问题举例 在网络游戏中,定义玩家类Player(id, name, level...), 每个玩家在线将创建一个Player实例,当在线人数很多时,将产生大量实例, 如何降 ...

  5. setup FTP server on CentOS 7

    Setup FTP Server on CentOS 7 Install vsftpd vsftpd (Very Secure File Transport Protocol Daemon) is a ...

  6. python绘制中文词云图

    准备工作 主要用到Python的两个第三方库 jieba:中文分词工具 wordcloud:python下的词云生成工具 步骤 准备语料库,词云图需要的背景图片 使用jieba进行分词,去停用词,词频 ...

  7. FB面经Prepare: Merge K sorted Array

    Merge K sorted Array 跟Merge K sorted lists不同在于,从PQ里poll出来以后不知道下一个需要被加入PQ的是哪一个 所以需要写一个wrapper class p ...

  8. ASP.NET MVC案例教程(六)

    ASP.NET六 一个小难题 我们继续完善“MVC公告发布系统”,这次,我们的需求是对公告发布功能添加日志记录能力,即在发布公告前,记录一次,在公告发布成功后,再记录一次.然后还要使得其具备异常处理, ...

  9. IDEA 创建Web项目

    1,创建Project:依次点击File–new Project:   创建.png 2,选择Empty Project项目,点击Next:   下一步 3,输入项目名称,选择项目路径:   Past ...

  10. Typora/VSCode/Sublime 更改Markdown默认宽度样式等

    Typora 所见即所得Markdown编辑器更改 最大宽度 C:\Users\Desk\AppData\Roaming\Typora\themes\github.css CSS第46行改为 max- ...