设为首页 收藏本站
查看: 905|回复: 0

[经验分享] Installing and Configuring Fedora KVM Virtualization

[复制链接]

尚未签到

发表于 2016-1-8 11:45:05 | 显示全部楼层 |阅读模式
  KVM support is pre-built into the Fedora Linux kernel for Fedora
release 7 and later. As a result KVM support is already available in the
standard kernel negating the need to install and boot from a special
kernel.

  The tools required to setup and maintain virtualized system are
not, however, installed by default. To fully utilize the KVM support
built into the kernel the following packages are required:



  • qemu-kvm


  • virt-manager


  • virt-viewer


  • python-virtinst
  Check to find out if these packages are already installed on your
system by running the following commands:


rpm -q qemu-kvm virt-manager virt-viewer python-virtinst

  If any of these packages are reported as not installed
they
may be installed using the yum
package manager:


su -

yum install qemu-kvm virt-manager virt-viewer python-virtinst

  The packages required to implement virtualization can change from one
Fedora release to the next. To avoid the necessity to know the exact
package names to install, the required packages can also be installed as
a group as follows:


yum groupinstall 'Virtualization'

  This command will install all the required packages.

  



[edit
]
Building a Fedora KVM Virtual System

  Virtual systems can easily be configured using either the virt-install
command-line tool, or the virt-manager
GUI tool. For the
purposes of this chapter we will use the virt-manager
tool.

  Begin by launching virt-manager
either by selecting the Applications->System
Tools->Virtual Machine Manager

or from the command-line in a
terminal window by running virt-manager
. Once loaded, the virtual
manager will prompt for the root password prior to displaying the
following screen:

  
DSC0000.jpg

  

   @import "/extensions/GoogleAdSense/GoogleAdSense.css";
<script type="text/javascript">&lt;!--
e9 = new Object();
e9.size = &quot;300x250&quot;;
e9.noAd = 1;
//--&gt;</script> DSC0001.jpg


<noscript> &lt;img src="http://b.scorecardresearch.com/b?c1=8&amp;c2=2102&amp;c3=106&amp;c4=502380&amp;c5=&amp;c6=&amp;c15=&amp;c16=&amp;cv=1.3&amp;cj=1" style="display:none" width="0" height="0" alt="" /&gt; </noscript>



  The main virt-manager screen lists the current virtual machines
running on the system. At this point there should only be one, the host
system. By default the manager should be connected to the host. If it is
not, connect to the host system by right clicking on the entry in the
list and selecting Connect
from the popup menu. The Status
field for this VM should now change to Active
, and the New
button at the bottom of the dialog should be enabled.

  To create a new virtual system, click on the New
button to
display the first configuration screen. Click the Forward
button
to proceed to the Naming
screen and enter a name for the virtual
system which can be any name you choose. On this screen, also select
the location of the media from which the guest operating system will be
installed. This can either be a CD or DVD drive, an ISO image file
accessible to the local host or a network install using HTTP, FTP, NFS
or PXE:

  
DSC0002.jpg

  

Clicking Forward
once more will display a screen seeking
additional information about the installation process. The screen
displayed and information required will depend on selection made in the
preceding screen. For example, if a CD, DVD or ISO was selected, this
screen will ask for the specific location of the ISO file or physical
device.



[edit
]
Configuring the KVM Virtual System

  Clicking Forward
once more will display a screen seeking
additional information about the installation process. The screen
displayed and information required will depend on selection made in the
preceding screen. For example, if a CD, DVD or ISO was selected, this
screen will ask for the specific location of the ISO file or physical
device. This screen also asks that you specify the type and version of
the guest operating system to be installed (for example Windows Vista or
Ubuntu Linux):

  
DSC0003.jpg

  

Once these settings are complete, click Forward
to configure CPU
and memory settings. The optimal settings will depend on the number of
CPUs and amount of physical memory present in the host and the
requirements of other applications and virtual machines that will run in
parallel with the new virtual machine:

  
DSC0004.jpg

  

The last item to configure before creating the virtual machine is the
storage space for the guest operating system and corresponding user
data. This takes the form of a virtual disk drive. A virtual disk drive
is essentially an image file hosted on the file system of the host
computer which is seen by the virtual machine as a physical disk drive.

  Options are available to create an image disk of a specified
size, select a pre-existing volume or to create a storage volume of a
specified format (raw, vmdk, iso etc). Unless you have a specific need
to use a particular format (for example you might need to use vmdk to
migrate to a VMware based virtualization environment at a later date) or
need to use a dedicated disk or partition, it is generally safe to
simply specify a size on this screen. The option is also available to
pre-allocate the space now. If you choose not to pre-allocate the space,
space will be allocated up to the specified maximum only as it is
needed by the guest operating system. This has the advantage that space
on the host file system is not used until it is needed. Downsides are
that performance may degrade as space is allocated in real-time and
allocation will fail if another process uses up the free space on the
host file system before it can be assigned to the virtual machine:

  
DSC0005.jpg

  

Once these settings are configured, click the Forward
key once
more. The final screen displays a summary of the configuration. Review
the information displayed. Advanced options are also available to
configure bridged networking (where the virtual machine has direct
access to a host network adapter) and to configure a specific MAC
address if required:

DSC0006.jpg

  


  注意:做好选择网桥,这需要事先在主机上配置好网桥,具体的配置过程参见本博相关文章。





Starting the KVM Virtual System

  Click on the Finish
button to begin the creation process. The
virtualization manager will create the disk and configure KVM before
starting the system. Once started, the guest OS installation will begin:

  


  

From this point on, simply follow the operating installation
instructions to install the guest OS.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-161837-1-1.html 上篇帖子: [转]KVM中使用LVM快照技术 下篇帖子: KVM/QEMU Emulator User Documentation
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表