Linux kvm 创建 虚拟机 的方法
2015-12-05 08:34
435 查看
通常情况下,复制别人的硬盘文件vmHardDisck.qcow2,制定内存,网卡就可以启动虚机了,当然这个是硬盘中的操作系统是别人已经安装好的了。
那如何创建一个空的硬盘,然后自己通过操作系统镜像(Linux 或者 Unix )安装自己的操作系统呢?
其实最关键的就是通过-boot d指定从光盘启动,并加载镜像就可以了。假设之前host上已经安装了VNC server。
如下:
##创建一个硬盘文件,命名为Centos6.5.qcow2
(1) #qemu-img create -o preallocation=metadata-f qcow2 ./Centos6.5.qcow2 80G
#创建一个虚拟机,制定启动方式从光盘启动,并为光盘指定镜像文件,menu可以选择启动
#的方式。指定vnc的端口号是69,虚拟机启动后先用vnc连接上去,安装操作系统,然后再#配置网络。
(2) qemu-kvm -name Centos6.5 -enable-kvm -cpuSandyBridge -smp 2 -m 5000 -drivefile=./Centos6.5.qcow2,if=ide,format=qcow2-cdrom ./CentOS-6.5-x86_64-bin-DVD1.iso-boot
d,menu=on,splash-time=19000-net nic,model=e1000,macaddr=aa:bb:ef:ef:21:69,vlan=1 -netnic,model=e1000,macaddr=aa:bb:ef:ef:21:70,vlan=2 -nettap,ifname=tap2069,vlan=1,script=no,downscript=no -net tap,ifname=tap2070,vlan=2,script=no,downscript=no
-vnc :69 &
通常情况下,复制别人的硬盘文件vmHardDisck.qcow2,制定内存,网卡就可以启动虚机了,当然这个是硬盘中的操作系统是别人已经安装好的了。
那如何创建一个空的硬盘,然后自己通过操作系统镜像(Linux 或者 Unix )安装自己的操作系统呢?
其实最关键的就是通过-boot d指定从光盘启动,并加载镜像就可以了。假设之前host上已经安装了VNC server。
如下:
##创建一个硬盘文件,命名为Centos6.5.qcow2
(1) #qemu-img create -o preallocation=metadata-f qcow2 ./Centos6.5.qcow2 80G
#创建一个虚拟机,制定启动方式从光盘启动,并为光盘指定镜像文件,menu可以选择启动
#的方式。指定vnc的端口号是69,虚拟机启动后先用vnc连接上去,安装操作系统,然后再#配置网络。
(2) qemu-kvm -name Centos6.5 -enable-kvm -cpuSandyBridge -smp 2 -m 5000 -drivefile=./Centos6.5.qcow2,if=ide,format=qcow2-cdrom ./CentOS-6.5-x86_64-bin-DVD1.iso-boot
d,menu=on,splash-time=19000-net nic,model=e1000,macaddr=aa:bb:ef:ef:21:69,vlan=1 -netnic,model=e1000,macaddr=aa:bb:ef:ef:21:70,vlan=2 -nettap,ifname=tap2069,vlan=1,script=no,downscript=no -net tap,ifname=tap2070,vlan=2,script=no,downscript=no
-vnc :69 &
相关文章推荐
- linux(debian) cannot set LC* to default locale, No such file or directory
- git diff 无效的解决
- 在CentOS 7.0中配置svn自动更新出现的问题
- Linux CentOS 7电源管理设置(合盖不睡眠)
- Linux学习笔记(三)基础命令
- 在linux下如何证明目录不能创建硬链接
- Linux学习笔记(三)基础命令
- Linux关于watch的用法
- KDB调试Linux4.2.6内核过程记录
- linux 信号集操作函数,信号阻塞与未决
- linux alarm和可重入函数
- linux 中断与信号
- linux 信号处理流程
- linux 信号安装、signal、kill,arise讲解
- linux 信号发送函数sigqueue和信号安装函数sigaction用法
- 1.2Centos6.5本地yum源配置
- Linux相关概念
- 怎样在1秒内启动Linux
- CentOS下桥接模式连不上网
- 3.Linux 文件的压缩与打包