centos6.7 安装 virtualBox 再安装 centos 7

Tag: 黄色为自己实际情况需要设置的部分,绿色部分为虚拟机名称(自定义)

 

1.创建虚拟机
VBoxManage createvm --name centos7 --ostype Linux26_64 --register --basefolder /home/virtualbox/

VBoxManage list ostypes(查看支持的操作系统类型)

 

2.创建磁盘
VBoxManage createvdi --filename /home/virtualbox/centos7.vdi --size 40000

 

3.创建硬盘控制器
VBoxManage storagectl centos7 --name storage_controller_1 --add ide

 

4.挂载虚拟机硬盘
VBoxManage storageattach centos7 --storagectl storage_controller_1 --type hdd --port 0 --device 0 --medium /home/virtualbox/centos7.vdi

 

5.挂载虚拟机光驱(操作系统镜像)
VBoxManage storageattach centos7 --storagectl storage_controller_1 --type dvddrive --port 1 --device 0 --medium /home/download/VirtualBox/CentOS-7-x86_64-Minimal-1804.iso

 

6.设置启动顺序,光驱第一,硬盘第二
VBoxManage modifyvm centos7 --boot1 dvd
VBoxManage modifyvm centos7 --boot2 disk

 

7.创建桥接的网络
VBoxManage modifyvm centos7 --nic1 bridged --cableconnected1 on --nictype1 82540EM --bridgeadapter1 p2p1 --intnet1 brigh1 --macaddress1 auto

 

8.开启vrde 模块(关闭),需要安装VirtualBox 扩展模块,以支持RDP协议,镜像桌面连接
VBoxManage modifyvm centos7 --vrde on
VBoxManage modifyvm centos7 --vrde off(暂时不用)

 

9.设置虚拟机内存和CPU
VBoxManage modifyvm centos7 --memory 8192
VBoxManage modifyvm centos7 --cpus 2

 

10.启动虚拟机
VBoxManage -startvm centos7 -type headless (后台启动)

 

ps: 更新宿主机操作系统内核 yum -y install kernel

posted @ 2018-07-04 19:09  梅里之巅  阅读(378)  评论(0编辑  收藏  举报