虚拟机名称 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. 使用Gadget 做usb鼠标键盘设备

    使用Gadget 做usb鼠标键盘设备 感谢TI社区提供的好帮助啊!http://e2e.ti.com/support/arm/sitara_arm/f/791/p/571771/2103409?pi ...

  2. Scala中 zip或者zipWithIndex的用法

    问题:你要遍历一个有序集合,同时你又想访问一个循环计数器,但最重要的是你真的不需要手动创建这个计数器.解决方案:    使用zipWithIndex或者zip方法来自动地创建一个计数器,假设你有一个有 ...

  3. jenkins深入学习

    一.jenkins深入学习 一.jenkins项目配置 1.Jenkins Gitlab持续集成打包平台搭建 http://blog.csdn.net/zgzhaobo/article/details ...

  4. git 解决授权失败的方法

    git 提示  fatal: Authentication failed for 'http://***********‘’得解决方法 首先用 git config --list 查看一下 如果不对, ...

  5. principal(括号匹配+多组查询)

    题目传送门: 把所有括号相匹配的段直接预处理出来就行了 #include <bits/stdc++.h> using namespace std; #define ll long long ...

  6. ORA-00600: 内部错误代码, 参数: [kcm_headroom_warn_1], [], [], [], [], [], [], [], [], [], [], []

    SQL*Plus: Release 11.2.0.4.0 Production on 星期三 1月 1 08:53:48 2003 Copyright (c) 1982, 2013, Oracle. ...

  7. selenium--键盘事件

    from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Fi ...

  8. PHP----------支付宝支付的一些注意事项。该博客只适用于20180209之后,的app支付宝支付。

    1.签名方式: 2.设置应用公钥.也就是开发者公钥.

  9. springboot+web文件上传和下载

    一.首先安装mysql数据库,开启web服务器. 二.pom.xml文件依赖包配置如下: <?xml version="1.0" encoding="UTF-8&q ...

  10. 第一个Python游戏窗口

    不废话,撸起袖子就是干. import pygame import sys pygame.init(); caption=pygame.display.set_caption("Python ...