centos 装VBOX

#cd /etc/yum.repos.d/
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
yum install kernel-devel  dkms.noarch
yum install VirtualBox-4.1
service vboxdrv start #运行后,如果内核不支持会更新内核

download : Oracle_VM_VirtualBox_Extension_Pack-4.1.34-95024.vbox-extpack
#安装扩展,不然命令看不见安装的虚拟机
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.34-95024.vbox-extpack

#查看当前已启动的虚拟机
VBoxManage list runningvms
#显示操作系统ID,下面用到
VBoxManage list ostypes
#删除虚拟机
VBoxManage unregistervm -delete win08

#安装WIN系统

#创建硬盘
VBoxManage createvdi --filename /var/vbox/win08/win08.vdi --size 20000
#创建虚拟机
VBoxManage createvm --name win08 --ostype Windows2008_64 --register --basefolder /var/vbox/win08/
#修改配置
VBoxManage modifyvm win08 --memory 1024  --accelerate3d off --nic1 bridged --bridgeadapter1 eth1
#加IDE
VBoxManage storagectl win08 --name IDE --add ide --controller PIIX4 --bootable on
#加硬盘
VBoxManage storageattach win08 --storagectl IDE --type hdd --port 0 --device 0  --medium /var/vbox/win08/win08.vdi
#加光驱
VBoxManage storageattach win08 --storagectl IDE --port 1 --device 0 --type dvddrive --medium /root/cdrom/win2008-64.iso
#硬件引导设置
VBoxManage modifyvm win08 --boot1 dvd
#系统搞定后设置从硬盘启动
#VBoxManage modifyvm win08 --boot1 disk
#启用远程桌面
vboxmanage modifyvm win08 --vrde on --vrdeport 9003
#系统搞定后可以关掉
#vboxmanage modifyvm win08 --vrde off
#后台运行
VBoxManage startvm win08 --type headless
#关闭电源
VBoxManage controlvm win08 poweroff

#安装CENTOS系统
#以下解释同上
VBoxManage createvdi --filename /var/vbox/cen/cen64.vdi --size 10000
VBoxManage createvm --name cen64 --ostype Linux26_64 --register --basefolder /var/vbox/cen/
VBoxManage modifyvm cen64 --memory 512  --accelerate3d off --nic1 bridged --bridgeadapter1 eth1
VBoxManage storagectl cen64 --name IDE --add ide --controller PIIX4 --bootable on
VBoxManage storageattach cen64 --storagectl IDE --port 0 --device 0 --type hdd --medium /var/vbox/cen/cen64.vdi
VBoxManage storageattach cen64 --storagectl IDE --port 1 --device 0 --type dvddrive --medium /root/cdrom/centos-64.iso
#硬件引导设置
VBoxManage modifyvm cen64 --boot1 dvd
#系统搞定后设置从硬盘启动
#VBoxManage modifyvm cen64 --boot1 disk
#启用远程桌面
vboxmanage modifyvm cen64 --vrde on --vrdeport 9002
#系统搞定后可以关掉
#vboxmanage modifyvm cen64 --vrde off
#后台运行
VBoxManage startvm cen64 --type headless
#关闭电源
VBoxManage controlvm cen64 poweroff

posted @ 2014-09-11 15:14  liushan  阅读(457)  评论(0编辑  收藏  举报