ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

VBoxManage

2019-04-17 13:40:32  阅读:685  来源: 互联网

标签:快照 虚拟机 startvm centos6.9 VBoxManage virtualbox


虚拟机名称 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/    

标签:快照,虚拟机,startvm,centos6.9,VBoxManage,virtualbox
来源: https://www.cnblogs.com/starfish29/p/10722945.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有