以前一直用vmware,linux下一般用vmware server 但是最近升级到centos6 vmware server 安装就一直有问题。
没办法就换成virtual box
也是一个很不错的虚拟机软件,
可以完全在命令行操作,适合远程安装操作。
经过几次的安装觉得不错,记下来以便以后使用,同时也推荐给大家。
安装前的准备
要安装的包,根距环境不同,会有不同 但以下几个包是必须的,其它如果没有,就增加就行了
yum install qt qt-x11 gcc kernel-devel-{内核版本号}
virtualBox默认是在DKMS内核内运行。
安装DKMS:
http://linux.dell.com/dkms/
下载后安装
rpm -ivh dkms-2.2.0.2-1.noarch.rpm
下载virtualbox安装文件:
VirtualBox-4.1-4.1.4_74291_rhel6-1.x86_64.rpm
下载扩展补定,可以用3389远程连接到桌面,否则只能用桌面安装了
Oracle_VM_VirtualBox_Extension_Pack-4.1.4-74291.vbox-extpack
开始安装:
rpm -ivh VirtualBox-4.1-4.1.4_74291_rhel6-1.x86_64.rpm
安装时会在/var/log/vbox-install.log打出安装日志,如果安装失败,则看此处文件可以知道哪有错误了,
打补定:
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.4-74291.vbox-extpack
安装完成后开始创建配置:
创建虚拟机:
VBoxManage createvm --name win2003 --ostype Windows2003 --register --basefolder /data/virtualbox/
设置一些属性:如果CPU不支持虚拟化,则此处只能用一个CPU,且不能装64位系统。
VBoxManage modifyvm win2003 --memory 2048 --cpus 1 --ioapic on --vram 16 --acpi on --pae on --hwvirtex on
创建虚拟硬盘
VBoxManage createvdi --filename /data/virtualbox/win2003.vdi --size 20480
创建硬盘控制器:
VBoxManage storagectl win2003 --name storage_controller_1 --add ide
挂载虚拟硬盘和光盘:
VBoxManage storageattach win2003 --storagectl storage_controller_1 --type hdd --port 0 --device 0 --medium /data/virtualbox/win2003.vdi
VBoxManage storageattach win2003 --storagectl storage_controller_1 --type dvddrive --port 1 --device 0 --medium /data/virtualbox/Windows.Server.2003.MSsetup.ISO
打开vrde模块,可以用远程桌面连接:
VBoxManage modifyvm win2003 --vrde on
设置启动顺序:
VBoxManage modifyvm win2003 --boot1 dvd
VBoxManage modifyvm win2003 --boot2 disk
配置网络(网桥方式,好处时,可以在虚拟机内设置与宿主主机一样的IP段及地址,以后虚拟机就相当于一台内网机器,我觉得这种方式非常方便):
VBoxManage modifyvm win2003 --nic1 bridged --cableconnected1 on --nictype1 82540EM --bridgeadapter1 eth0 --intnet1 brigh1 --macaddress1 auto
启动虚拟机:
VBoxHeadless -startvm win2003 &
然后用远程桌面连接一宿主机,进行安装操作系统的操作。
安装完操作系统并分配好IP后,就可以关闭3389的监听:
VBoxManage modifyvm win2003 --vrde off
如果不关闭,则任何人都可以通过3389连上虚拟机。
其它的一些选项:
查看已有配置:
VBoxManage showvminfo win2003 --details
管理:
VBoxManage controlvm
pause|resume|reset|poweroff|savestate|
暂定 恢复 重启 关机 保存
删除一个磁盘:
VBoxManage list hdds
VBoxManage closemedium disk /data/virtualbox/win2003.vhd --delete
装好操作系统后,可以做一下磁盘备份,以便以后同操作系统时,不用再重装,但如果直接COPY的话,是无法挂载的。可以用硬盘克隆
VBoxManage clonevm
如果启动时出现:
Error: failed to start machine. Error message: VT-x features locked or unavailable in MSR. (VERR_VMX_MSR_LOCKED_OR_DISABLED)
一个原因是CPU不支持虚拟化技术,
如果支持,则可能在BIOS内没有开启虚拟化功能。打开就可以了,
否则可以把CPU改成1个也可以
先写这么多,以后有更多发现的东西再补充。。
分享到:
相关推荐
virutalbox+phpvirtualbox (centos7网页虚拟化)自动部署
VirtualBox安装CentOS5
在VirtualBox下CentOS的安装6.3
文档针对在VirtualBox上安装Centos 6版本,把每个安装步骤都详细截图记录下来。 同时也把一些常用的Linux操作记录下来:修改静态IP,hostname,关闭防火墙等。
完成的VirtualBox上面安装CentOS的步骤过程
在VirtualBox上安装CentOS6.5,很详细的linux系统安装
CentOS 7 1905.1 基础版本中Vagrant VirtualBox VBoxGuestAdditions vbguest版本有误 制作方式为Packer自动打包 使用方式为: 安装软件 vagrant virtualbox 安装vagrant的virtualbox guest插件 vagrant ...
实验1 在VirtualBox中安装CentOS6虚拟机。
1、Virtualbox安装centos 5.4图解参考一.... 2 1、在VirtualBox下安装CentOS截图参考二.... 11 2、安装增强功能.... 47 3、修改图形界面分辨率.... 49 4、配置远程桌面.... 50 5、配置samba.. 51 6、安装mysql...
VirtualBOx安装CentOS7虚拟机的相关网络配置
vagarnt用virtualbox的centos7 box
自己动手从开箱上架开始,Dell CentOS 6.4服务器安装Oracle VM VirtualBox 操作的文档
解决CentOS 7安装mysql后3306端口不通
Centos与VirtualBox共享文件夹的设置方式,适用于不同版本的virtualBox
由于服务器在国外,所以我们在线安装VirtualBox往往都会失败。这里我们使用本地安装CentOS-7-x86_64-Vagrant-2004_01.VirtualBox,里面有安装步骤。
【virtualbox6.0.12版本】六祎-在virtualbox中安装CentOS-7——软件+安装Centos7教程
使用VirtualBox虚拟机安装Centos操作系统后进行全屏设置
VirtualBox安装CentOS 和Pycharm执行环境
CentOS 6 安装VirtualBox客户端增强功能、Windows 7同 Linux双启动、修复Windows 7系统MBR、常用配置文件、Linux终端乱码的解决办法
实验环境:Oracle VM VirtualBox 4.2.12 操作系统:CentOS 7(LINUX7)64bit 数据库 :Oracle 12C 64bit 实验目标:熟悉LINUX7下安装Oracle12C