考试首页 | 考试用书 | 培训课程 | 模拟考场 | 考试论坛  
  当前位置:Linux认证 > 红帽认证 > 红帽认证辅导 > 文章内容
  

RHCE7认证学习笔记:使用虚拟化系统KVM

来源:Linux社區 [ 2016年2月14日 ] 【

    网络类型:

    isolated virtual network:独立的虚拟的网络,相当于vm workstation的vmnet0,vmnet1.。。。

    forwarding to physical network: mode如果选择是NAT,相当于vm workstation的NAT模式,mode选择routed相当于桥接。

RHCE7认证学习笔记16——使用虚拟化系统KVM

Virsh命令行管理KVM的虚拟机:

virsh [options]... []
virsh [options]... [args...]

    常用命令:

    list:

    shutdown:

    destroy:

    reboot:

    resume:

    start:

    snapshot-create:创建快照:
    undefine: 彻底从KVM删除虚拟机;

    console:控制台进入虚拟机;

虚拟机的配置文件目录:cd /etc/libvirt/qemu

五、vir-install命令行安装虚拟机:

首先查看KVM支持的系统平台:
[root@linuxidc ~]# virt-install --os-variant=list
win7                : Microsoft Windows 7
vista                : Microsoft Windows Vista
winxp64              : Microsoft Windows XP (x86_64)
winxp                : Microsoft Windows XP
win2k                : Microsoft Windows 2000
win2k8              : Microsoft Windows Server 2008
win2k3              : Microsoft Windows Server 2003
openbsd4            : OpenBSD 4.x
freebsd8            : FreeBSD 8.x
freebsd7            : FreeBSD 7.x
freebsd6            : FreeBSD 6.x

KVM默认的存储池位置为:/var/lib/libvirt/images,如果需要将虚拟磁盘安装在其他位置,则需要修改上下文权限:

        semanage fcontext -a -t virt_image_t "new location"
        restorecon -R "new location"

        使用命令行安装虚拟机:

[root@linuxidc Desktop]# virt-install -n rhel7 -r 512 --vcpus=1 --location=/root/rhel-server-7.0-x86_64-dvd.iso --controller=usb --os-variant=rhel7 --disk=/var/lib/libvirt/images/mydisk1,size=3

列出活动的虚拟机:

[root@linuxidc ~]# virsh list
 Id    Name                          State
----------------------------------------------------
 7    rhel7                          running

本文纠错】【告诉好友】【打印此文】【返回顶部
将考试网添加到收藏夹 | 每次上网自动访问考试网 | 复制本页地址,传给QQ/MSN上的好友 | 申请链接 | 意见留言 TOP
关于本站  网站声明  广告服务  联系方式  站内导航  考试论坛
Copyright © 2007-2013 中华考试网(Examw.com) All Rights Reserved