分类: LINUX
2011-04-02 10:16:19
1. 安装Centos 5.4 最精简系统
2.关闭selinux
3.安装Virtualbox
a.安装依赖软件包
# yum install mesa-libGL-devel mesa-libGLU-devel libICE-devel libSM-devel libXmu-devel libXt-devel SDL-devel
b.安装内核源代码
# yum install gcc make
# yum install kernel-devel
export KERN_DIR=/usr/src/kernels/2.6.18-194.3.1.el5-i686/
c.Virtualbox安装配置
# yum install which
# wget
# rpm -ivh VirtualBox-3.1-3.1.8_61349_rhel5-1.i386.rpm
# /etc/init.d/vboxdrv setup
# usermod -a -G vboxusers root
安装步骤
1、创建一个Windows 2003的虚拟机
VBoxManage createvm –name “win2003″ –register
从虚拟机列表清除指定的虚拟机
VBoxManage unregistervm
[-delete] 从虚拟机列表删除指定的虚拟机
查看虚拟机列表
VBoxManage list vms
查看虚拟机配置
VBoxManage showvminfo win2003
2、创建一个80G磁盘
VBoxManage createvdi –filename /data/vbox/win2003.vdi –size 80000 –remember
删除一个磁盘
VBoxManage unregisterimage disk /data/vbox/win2003.vdi
3、创建一个IDE接口
VBoxManage storagectl win2003 –name “IDE Controller” –add ide
VBoxManage storagectl win2003 –name “SATA Controller” –add sata
4、修改虚拟机配置
VBoxManage modifyvm “win2003″ –ostype “Windows2003″ –memory “1024″ –vram
“16″ –boot2 disk –boot1 dvd –hda “/data/vbox/win2003.vdi” –sata on
–acpi on –pae on –hwvirtex on –nic1
bridged –cableconnected1 on –nictype1 “82540EM” –bridgeadapter1 eth0 –intnet1 brigh1 –macaddress1 auto –vrdp on –vrdpport 4000 –vrdpmulticon on
SATA:
VBoxManage modifyvm “win2003″ –ostype “Windows2003″ –memory “1024″ –vram
“16″ –boot2 disk –boot1 dvd –sda “/data/vbox/win2003.vdi” –sata on
–acpi on –pae on –hwvirtex on –nic1
bridged –cableconnected1 on –nictype1 “82540EM” –bridgeadapter1 eth0 –intnet1 brigh1 –macaddress1 auto –vrdp on –vrdpport 4000 –vrdpmulticon on
查看参数
VBoxManage modifyvm –help
5、挂载ISO安装盘
VBoxManage openmedium dvd /iso/win2k3.iso
6、将vdi磁盘放在设备0的第0个端口
VBoxManage storageattach win2003 –storagectl “IDE Controller” –port 0 –device 0 –type hdd –medium /data/vbox/win2003.vdi
7、将ISO挂载放在设备0的第1个端口
VBoxManage storageattach win2003 –storagectl “IDE Controller” –port 1 –device 0 –type dvddrive –medium /iso/win2k3.iso
8、将ISO加到虚拟机的DVD光驱里
VBoxManage modifyvm “win2003″ –dvd /iso/win2k3.iso
9、启动|关闭|暂停
VBoxManage startvm “win2003″ -type vrdp
暂停
VBoxManage controlvm “win2003″ pause
继续
VBoxManage controlvm “win2003″ resume
重启
VBoxManage controlvm “win2003″ reset
关机
VBoxManage controlvm “win2003″ poweroff
休眠
VBoxManage controlvm “win2003″ savestate
windows远程桌面远程连接过去,IP:4000
安装客户端增强插件
mkdir /mnt/iso
mount -o loop /usr/share/virtualbox/VBoxGuestAdditions.iso /mnt/iso
或SAS