Presentation is loading. Please wait.

Presentation is loading. Please wait.

Virtual Machine Overview

Similar presentations


Presentation on theme: "Virtual Machine Overview"— Presentation transcript:

1 Virtual Machine Overview
05/23/10 Virtual Machine Overview 1

2 What is Virtual Machine ? How can virtualization help us ?
05/23/10 Agenda What is Virtual Machine ? How can virtualization help us ? Major Virtual Machine Techniques Introducing 4 popular Virtual Machine XEN KVM VirtualBOX VMware player

3 What's Virtual Machine ? Virtual machine (VM):
05/23/10 What's Virtual Machine ? Virtual machine (VM): A software implementation of a machine (computer) that executes programs like a physical machine. Types of virtual machine categories: System virtual machines - Hardware virtual machine Provides a complete system platform environment which supports the execution of a complete operating system (OS). Process virtual machine - Application virtual machine Provides a platform-independent programming environment that abstracts away details of the underlying hardware or operating system from software or application runtime. Example: Hardware virtual machine: VMWare, Xen, VirtualBOX .. Application virtual machine: Java Virtual Machine, .NET Framework (From Wikipedia) 系統virtual machine=硬體virtual machine Process virtual machine=application machine把硬體和作業系統從軟體抽離出來

4 How can virtualization help us ?
05/23/10 How can virtualization help us ? Test before we go: Virtual machine just like a experiment box. You are able to test your application on different kind of system in same machine. It's easy to destroy, rebuild or backup your whole testing environments - Virtual Machine. Server consolidation: Many small physical servers could be replaced by virtual machine, runs on virtualization environment provided by one powerful physical server. Although hardware is consolidated, typically OSs are not. Instead, each OS running on a physical server becomes converted to a distinct OS running inside a virtual machine. The large server can "host" many such "guest" virtual machines. Increase hardware utilization: To increase the utilization of costly hardware resources such as cpu, memory or even like storage space. Rapid provisioning, dynamic fault tolerance.. For example: Computing task can now be utilized down to core of cpu level. Big system memory can partition as smaller portions for legacy system runs within a virtual machine. Big system memory can partition as smaller portions for legacy system runs within a virtual machine: Explanation: 32 bits OS can not address system memory large then 4GB, having a system equipped 32GB memory can create maximum 8 vms, provide 8 * 32 bits virtual machine. Consolidation: 強化/變硬/合併 Provision: 供應/準備 Server consolidation: 在虛擬技術開發之前,傳統machine room需要大量機器來執行程式,會使用大量電力和產生大量熱能及大量空間,當有了虛擬技術,就可以將這些server虛擬化放在一台機器上,可以省下大量電力和不會產生熱能,也會省空間 更強大的電腦就可以容納更多的virtual machine Dynamic fault tolerance: 不同的虛擬機器當使用同一個shared storage,可以動態的migrate到另外一部 機器. 32 bits的機器上面只能跑最大4GB,如果想要跑這種OS,就可以使用虛擬化技術,這樣一台32GB的RAM,可以容納 8VMs

5 Traditional vs. Virtual Architecture
05/23/10 Traditional vs. Virtual Architecture Guest OS 看的是vmware模擬出來的硬體,對於guest OS就不需要知道下面的面對是實體機器或是vmware,對於上層OS完全不知道下面是vmware或是實體機器,就只要使用下面vmware所提供出來的API就行了 Traditional Architecture Virtual Architecture ( Quote from VMware )

6 Xen Architecture ◇ Virtual machine layer ◇ Hypervisor layer
05/23/10 Xen Architecture ◇ Virtual machine layer ◇ Hypervisor layer ◇ Hardware/physical layer Hardware or physical layer: Physical hardware components including memory, CPU, network cards, and disk drives. Hypervisor layer: Thin layer of software that runs on top of the hardware. The Xen hypervisor gives each virtual machine a dedicated view of the hardware. Virtual machine layer: Operating system hosted on the hypervisor and appearing to the user as a separate physical computer. However, the machine shares physical resources with other virtual machines, and it is portable because the virtual machine is abstracted from the physical hardware. Hypervisor layer: 又稱為VMM,是virtual machine monitor,提供上層guest OS monitor資訊,也提供guest OS一個虛擬平台讓guest OS不用知道下面是實體機器或是一個hypersior Virtual machine layer: 在hypervisor上面所執行的OS,可以讓users當作每一個分開的實體機器,此外,guest os可以方便搬移,因為guest OS和下層硬體是切開來的

7 VM Techniques (1) - Full-Virtualization
05/23/10 VM Techniques (1) - Full-Virtualization Technical aspects: Full virtualization is a virtualization technique used to provide a certain kind of virtual machine environment, saying, a complete simulation of the underlying hardware which represents total abstraction of the underlying physical system, and create a complete virtual system in which the guest operating system can execute. In such an environment, any software capable of execution on the raw hardware, can be run in the virtual machine and; in particular, any operating systems (Guest Operating System). No modification is required in the guest operating system or application; the guest operating system or application is not even aware that it is running within a virtualized environment. Typical solution of Full-Virtualization: Commercial: VMWare ESX, Microsoft Virtual Server, Citrix XenServer. Opensource: Linux Xen hypervisor – Hardware Virtual Machine (HVM), KVM. Hardware-assisted virtualization (HVM): Offers new instructions to support direct calls by a para-virtualized guest/driver into the hypervisor, typically used for I/O or other so-called hypercalls. HVM: 指說由CPU就開始support虛擬化技術, Xen稱做HVM, Virtual Iron稱做native virtualaization 因為把硬體完整模擬化,所以不需要修改OS

8 Full-Virtualization - Continue
05/23/10 Full-Virtualization - Continue Advantages: Operating System does not need to be modified in order to run in a virtualized environment. Virtual machine can smoothly, easily change to different virtual system. Example: converting VMWare guest image into Xen image Disadvantages: Incur performance and resource penalty on VMs. Some Virtual Machine require CPUs with special virtualization support built in (such as Intel-VT and AMD-V), Example: Xen. Incur: 遭受 VMWare guest image into Xen image: image格式轉換,目前也有工具轉換不同image格式,就像轉換圖檔,從tif轉jpg一樣.

9 VM Techniques (2) - Para-Virtualization
05/23/10 VM Techniques (2) - Para-Virtualization Technical aspects: Para-virtualization is a virtualization technique that attempts to provide most services directly from the underlying hardware instead of abstracting it. Para-virtualization allows for near-native performance. Para-virtualization requires that a guest operating system be modified to support virtualization. This typically means that guest operating systems are limited to open source systems such as Linux. Typical solution of Para-Virtualization: Commercial: Sun Solaris container. Opensource: Linux Xen Hypervisor. 第一段 Sun Solaris Contariner: not open source/只能跑solaris

10 Para-Virtualization - Continue
05/23/10 Para-Virtualization - Continue Advantages: Para-virtualized guest system comes closer to native performance than a fully virtualized guest. The latest virtualization CPU support is not needed for para- virtualized. Disadvantages: Requires that a guest operating system be modified to support virtualization. This typically means that guest operating systems are limited to open source systems such as Linux. It is not possible to migrate a guest Operating System from one platform to another. 因為半虛擬化會直接用到底層kernel的技術/API,所以沒辦法直接換到其他種kernel

11 VM Techniques (3) - Hardware assisted Full-Virtualization
05/23/10 Hardware-assisted virtualization: Is a platform virtualization approach that enables efficient full virtualization using help from hardware capabilities, primarily from the host processors. Hardware-assisted virtualization was recently (2006) added to x86 processors (Intel VT or AMD-V). Is also known as accelerated virtualization; Xen calls it hardware virtual machine (HVM). KVM--which stands for "Kernel-based Virtual Machine"--provides for hardware-assisted virtualization. Accelerated: 加速 在這邊我們特別強調全虛擬化技術中的針對CPU直接支援 如果要看可以cat /proc/cpuinfo |grep vmx(Intel) or svm(AMD)

12 VM Techniques (3) - Hardware assisted Full-Virtualization - Continue
05/23/10 VM Techniques (3) - Hardware assisted Full-Virtualization - Continue Benefits of Hardware-Assisted Virtualization: Hardware-assisted virtualization changes the access to the operating system itself. With hardware-assisted virtualization, the operating system has direct access to resources without requirement to any emulation or OS modification. Hardware-assisted virtualization changes the access to the operating system itself. 直接call硬體,和半虛擬化會call系統 再用到硬體不同 Emulate: 模擬

13 Introducing 4 popular Virtual Machine Software
05/23/10 Introducing 4 popular Virtual Machine Software XEN KVM VirtualBOX VMware player

14 05/23/10 XEN (1) Xen is a virtual machine monitor for IA-32 (x86, x86-64), IA-64 and PowerPC 970 architectures. It allows several guest operating systems to be executed on the same computer hardware concurrently. Xen was initially created by the University of Cambridge, Computer Laboratory and is now developed and maintained by the Xen community as free software, as well as Citrix XenServer Commercial version variant. A Xen system is structured with the Xen hypervisor as the lowest and most privileged layer. Above this layer are “one” or “more” guest operating systems, which the hypervisor schedules across the physical CPUs. The first guest operating system called in Xen terminology a.k.a "domain 0" (dom0), is booted automatically when the hypervisor boots and given special management privileges and direct access to the physical hardware. System administrator can log into dom0 in order to manage any further guest operating systems, called "domain U" (domU) in Xen terminology.

15 XEN (2) $ xm list Name ID Mem(MiB) VCPUs State Time(s)
05/23/10 XEN (2) Xen 也分成多個層級 (layer) 來執行。他將 Linux 的核心修改過後, 再使用這個修改過後的核心開機,而開機後先載入 Xen 的監督器 (Hypervisor) , 並且啟動 domain-0。 (在 Xen 上面所謂的一個 domain 就是一個虛擬機器囉!) Domain-0 含有其他虛擬機器啟動所必須的控制指令, 並且 domain-0 也是控制虛擬裝置的重要主控系統。 在 domain-0 上頭最重要的就是一個 xend 的常駐程式,其他的 domain U都是由這個 xend 來管理的。 至於命名方面,除了 domain-0 之外的其他虛擬機器就依序被稱為 domain-1, domain-2 等等, 我們通稱為 domain-U 囉。domain-0 直接控制 Xen 的監督器 (Hypervisor),而且掌握了實際的 Linux 驅動程式 (drivers)。而其他的虛擬機器 (domain-U) 則是透過 Xen 監督器來與實際的硬體以及 domain-0 達成溝通。而為了讓 domain-0 能夠與 Xen 結合,我們必須要修改 domain-0 的核心才能夠順利運作。並且需要使用 domain-0 的核心來開機才可以。 domain-0 是所有虛擬機器的來源,所以他可以盡量簡單一點,其他的個別服務則可以放置到不同的 domain 當中了。 那個 xend 也是很重要的咚咚,管理 domain-0 與其他 domain 之間的啟動與溝通, 可以提供一個終端機 (console) 介面來讓 domain-0 登入其他的 domain ,所以我們也必須要啟動這玩意兒才行。 早期 Xen 尚未被各 distribution 整合到各自的版本中時,使用者必須要由 Xen 的官方網站下載原始碼, 然後自行重新編譯核心以及編譯 Xen 軟體才行。說實在的,玩個 Xen 這麼麻煩,倒不如不要玩!^_^。 然而在 RHEL 5 (CentOS 5) 以後, Xen 已經包含在原始釋出的套件中了,所以我們直接用 yum 就能夠安裝妥當! 所以要搞定一部 Xen 的 domain-0 已經不再是不可能的任務囉!^_^ $ xm list Name ID Mem(MiB) VCPUs State Time(s) CentOS5.3_testbed b Ubuntu9.10_testbed b Domain r

16 KVM (1) KVM (for Kernel-based Virtual Machine)
05/23/10 KVM (1) KVM (for Kernel-based Virtual Machine) Open source software, full virtualization solution for Linux on x86 hardware, which containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable kernel module: “kvm.ko”, that provides the core virtualization infrastructure. “kvm-intel.ko”, processor specific module for Intel CPU. “kvm-amd.ko”, processor specific module for amd CPU. KVM also requires a modified QEMU although work is underway to get the required changes upstream. By using KVM, one can run multiple virtual machines running unmodified Linux or Windows images. Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc. The kernel component of KVM is included in mainline Linux, as of KVM: 全虛擬化且是kernel-based的,不用再掛其他軟體 QEMU是一個一般化且是一個open source的machine emulator和virtualizer 如果是扮演machine emulator, QEMU可以在不同CPU上面執行另外一個OS 如果是扮演machine virtualizer, QEMU可以透過直接在host CPU上面執行guest OS的code來達成高效能, 目前QEMU可以support Xen, KVM,當放在KVm環境中,QEMU可以虛擬化x86, server, Power PC, S390 KVM also requires a modified QEMU although work is underway to get the required changes upstream??

17 KVM (2) KVM Architecture – with Linux Kernel modules ` 05/23/10
當有安裝KVM時,每一個guest OS都是host OS的一個process,上面的圖就提供KVM的虛擬化的表示,下層是支援虛擬化技術的硬體平台 ,就是指 含有intel VT或AMD-V技術的處理器,在硬體上面所執行的是一個含有KVm driver的linux kernel, 這個linux kernel就像一般的linux kenrnel, 您可以執行任一個application,只不過這個 kernel同時也透過由KVM的utility來support guest OS,一個Guest OS就像一個在這個環境上面所執行的應用程式一樣 CPU直接支援虛擬化的能力, memory也透過KVm達成虛擬化,而IO也透過QEMU達成虛擬化

18 05/23/10 VirtualBox (1) VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL). Presently, VirtualBox runs on Windows, Linux, Macintosh and OpenSolaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista, Windows 7), DOS/Windows 3.x, Linux (2.4 and 2.6), Solaris and OpenSolaris, and OpenBSD. Nice user interface and easy to install on Windows or Linux. Free Download : One kind of full virtualization

19 VirtualBox (2) 05/23/10 Screenshot of Windows VM running on Linux’s system via VirtualBox 當使用linux,VirtualBox提供一個open source且免費的方案,如果想要使用vm的技術的話,VirtualBox是個不錯的選擇. The VirtualBox processes: a bird's eye view When you start the VirtualBox graphical user interface (GUI), at least one extra process gets started along the way -- the VirtualBox "service" process VBoxSVC. Once you start a virtual machine (VM) from the GUI, you have two windows (the main window and the VM), but three processes running. Looking at your system from Task Manager (on Windows) or some system monitor (on Linux), you will see these: VirtualBox, the GUI for the main window; another VirtualBox process that was started with the -startvm parameter, which means that its GUI process acts as a shell for a VM; VBoxSVC, the service mentioned above, which is running in the background to keep track of all the processes involved. This was automatically started by the first GUI process. (On Linux, there's another daemon process called VBoxXPCOMIPCD which is necessary for our XPCOM implementation to work. We will ignore this for now; see COM-XPCOM interoperability? for details.) To the host operating system (OS), the VM that runs "inside" the second window looks like an ordinary program. VirtualBox is very well behaved in that respect: it pretty much takes over control over a large part of your computer, executing a complete OS with its own set of guest processes, drivers, and devices inside this VM process, but the host OS does not notice much of this. Whatever the VM does, it's just another process in your host OS. We therefore have two sorts of encapsulation in place with the various VirtualBox files and processes: Client/server architecture. All aspects of VirtualBox and the VMs that are running can be controlled with a simple, yet powerful, COM/XPCOM API. For example, there is a command-line utility called VBoxManage that allows you to control VMs just like the GUI does (in fact, many of the more sophisticated operations are not yet supported by the GUI). You can, for example, start a VM from the GUI (by clicking on the "Start" button) and stop it again from VBoxManage. This is why the service process (VBoxSVC) is needed: it keeps track of which VMs are running and what state they're in. Frontend/backend architecture. The guts of VirtualBox -- everything that makes x86 virtualization complicated and messy -- are hidden in a shared library, VBoxVMM.dll, or VBoxVMM.so on Linux. This can be considered a "backend", or black box, that is static, and it is relatively easy to write another frontend without having to mess with the gory details of x86 virtualization. So, as an example, if you don't like the fact that the GUI is a Qt application, you can easily write a different frontend (say, using GTK). In fact, VirtualBox already comes with several frontends: The Qt GUI (VirtualBox) that you may already be familiar with. VBoxManage, a command-line utility that allows you to control all of VirtualBox's powerful features. A "plain" GUI based on SDL, with fewer fancy features than the Qt GUI. This is useful for business use as well as testing during development. To control the VMs, you will then use VBoxManage. A Remote Desktop Protocol (RDP) server, which is console-only and produces no graphical output on the host, but allows remote computers to connect to it. This is especially useful for enterprises who want to consolidate their client PCs onto just a few servers. The client PCs are then merely displaying RDP data produced by the various RDP server processes on a few big servers, which virtualize the "real" client PCs. (The RDP server is not part of VirtualBox OSE, but is available with the full version; see the Editions page for details.) Inside a virtual machine As said above, from the perspective of the host OS, a virtual machine is just another process. The host OS does not need much tweaking to support virtualization. Even though there is a ring-0 driver that must be loaded in the host OS for VirtualBox to work, this ring-0 driver does less than you may think. It is only needed for a few specific tasks, such as: allocating physical memory for the VM; saving and restoring CPU registers and descriptor tables when a host interrupt occurs while a guest's ring-3 code is executing (e.g. when the host OS wants to reschedule); when switching from host ring-3 to guest context; enable or disable VT-x etc. support. Most importantly, the host's ring-0 driver does not mess with your OS's scheduling or process management. The entire guest OS, including its own hundreds of processes, is only scheduled when the host OS gives the VM process a timeslice. After a VM has been started, from your processor's point of view, your computer can be in one of several states (the following will require a good understanding of the x86 ring architecture): Your CPU can be executing host ring-3 code (e.g. from other host processes), or host ring-0 code, just as it would be if VirtualBox wasn't running. Your CPU can be emulating guest code (within the ring-3 host VM process). Basically, VirtualBox tries to run as much guest code natively as possible. But it can (slowly) emulate guest code as a fallback when it is not sure what the guest system is doing, or when the performance penalty of emulation is not too high. Our emulator (in src/emulator/) is based on QEMU and typically steps in when guest code disables interrupts and VirtualBox cannot figure out when they will be switched back on (in these situations, VirtualBox actually analyzes the guest code using its own disassembler in src/VBox/Disassembler/); for execution of certain single instructions; this typically happens when a nasty guest instruction such as LIDT has caused a trap and needs to be emulated; for any real-mode code (e.g. BIOS code, a DOS guest, or any operating system startup). Your CPU can be running guest ring-3 code natively (within the ring-3 host VM process). With VirtualBox, we call this "raw ring 3". This is, of course, the most efficient way to run the guest, and hopefully we don't leave this mode too often. The more we do, the slower the VM is compared to a native OS, because all context switches are very expensive. Your CPU can be running guest ring-0 code natively. Here is where things get hairy: The guest only thinks it's running ring-0 code, but VirtualBox has fooled the guest OS to instead enter ring 1 (which is normally unused with x86 operating systems). Also, in the VirtualBox source code, you will find lots of references to "host context" or "guest context". Essentially, these mean: Host context (HC) means that the host OS is in control of everything including virtual memory. In the VirtualBox sources, the term "HC" will normally refer to the host's ring-3 context only. We only use host ring-0 (R0) context with our new Intel VT-x (Vanderpool) support, which we'll leave out of the picture for now (but see below). Guest context (GC) means that basically the guest OS in control, but with VirtualBox keeping a watch on things in the background. Here, VirtualBox has set up CPU & memory exactly the way the guest expects, but it has inserted itself at the "bottom" of the picture. It can then assume control when nasty things happen -- if a privileged instruction is executed, the guest traps or external interrupts occur. VirtualBox may then possibly delegate handling such things to the host OS. So, in the guest context, we have ring 3 (hopefully executed in "raw mode" all the time); ring 1 (of which the guest thinks it's ring 0, see above), and ring 0 (which is VirtualBox code). This guest-context ring-0 code is also often called a "hypervisor".

20 VMware player (1) VMWare, Inc.
05/23/10 VMware player (1) VMWare, Inc. Commercial software provider, specialize for providing virtualization software and corresponding solution. VMware has many popular virtualization solution across windows and linux platform, like: VMware Workstation, Server, ESX, GSX and client side software called VMWare player. VMware Player provide a easiest way to run multiple operating systems at the same time on your desktop. With its user-friendly interface, VMware Player makes it effortless for anyone to try out Windows 7, Chrome OS or the latest Linux releases, or create isolated virtual machines to safely test new software and surf the Web. VMware Player can also be used to run a virtual copy of an old PC so that you can recycle the old machines you have under your desk or stored in the closet. Download: ESX: kernel patched過,整個作業系統就裝進去,virtual console GSX: 一堆套件所組合而成的 free之後變成VMware Server , virtual console Workstation: for personal users, virtual console本機版的VM,針對, no virtual console Player: free, not open source,只要註冊就可以使用了, no virtual console

21 05/23/10 VMware player (2) Screenshot of Linux VM running on Windows’ system via VMWare player 相較於virtual box, GUI介面也很好用也很好裝,但是需要經過授權,需要註冊的

22 How Infrastructure as a Service (IaaS) utilize Virtualization
05/23/10 How Infrastructure as a Service (IaaS) utilize Virtualization From WikipediA: Cloud infrastructure services or "Infrastructure as a Service (IaaS)" delivers computer infrastructure, typically a platform virtualization environment as a service. Company provide IaaS – Clouds vendors: Amazon's EC2 (Elastic Compute Cloud) Google's App Engine Microsoft's Azure platform TCloud Computing - Elaster All the vendors above provide services for delivering custom’s applications to internet environment and still maintain flexibility, configurability and pay-only-for-what-you-use model to the client when subscribe their services. All cloud service provider leverage the virtualization technologies as a fundamental building block in the whole infrastructure and management stack. IaaS大量使用virtual技術,可以大量deploy VM,提供OS幾顆CPU給user使用 TCloud Computing - Elaster TrendMicro is the major founder of TCloud Computing, which is quite new established (kicked off) IaaS provider, locale in Taiwan. Pay-only-for-what-you-use: 只要當使用到resource時才會付錢,不用的時候可以關掉,這樣就不用付錢

23 Amazon’s Elastic Compute Cloud EC2 and Virtualization – Xen
05/23/10 Amazon’s Elastic Compute Cloud EC2 and Virtualization – Xen Amazon Elastic Compute Cloud (EC2): A central part of Amazon.com's cloud computing platform, EC2 allows users to rent virtual computers on which to run their own computer applications. EC2 allows scalable deployment of applications by providing a web service the - Amazon Web Services (AWS) which a user can create a virtual machine, boot an Amazon Machine Image to which Amazon calls an "instance", containing any software desired. EC2 uses Xen virtualization. Each virtual machine, called an "instance", functions as a virtual private server. Private Clouds: A private cloud is a cloud computing infrastructure created by an organization for its own internal use, rather than using someone else’s infrastructure (e.g., Amazon EC2). Many open source project provide management software as a virtualization framework management utility for private cloud. Private cloud:不是做commercial 應用

24 Introduce two virtualization management software
05/23/10 Introduce two virtualization management software OpenNebula is a virtualization control framework, an open-source toolkit to easily build any type of cloud, includes private, public and hybrid. OpenNebula has been designed to be integrated with any networking and storage solution and so to fit into any existing data center, such as EC2 service. An Opennebulas architecture 透過open nebula軟體管理VM的framework,使用者可以透過public cloud interface(web/API)連接OpenNebula, scheduler負責排程大量部署或migrate或停機等管理工作,OpenNebula core是一組driver/transfer/command toolkit組合而成,可以透過不同plugin(Xen或KVM)跟Xen/KVM server farm溝通或管理,透過cloud plugins可以溝通/管理外面的public cloud部署的VM

25 Introduce two virtualization management software - Coutinue
05/23/10 Introduce two virtualization management software - Coutinue Eucalyptus - Elastic Utility Computing Architecture for Linking Your Programs To Useful Systems“ An infrastructure for the implementation of cloud computing on computer clusters which provides an interface that is compatible with the Amazon EC2 service. With Eucalyptus, Users make more efficient use of their computing capacity, thus increasing productivity and innovation, deploying new applications faster, and protecting sensitive data while making savings in capital expenditure. Reference: 另外一個類似OpenNubela的open source軟體,cloud的管理軟體

26 Hands on: Build your own first virtualization
05/23/10 Hands on: Build your own first virtualization sandbox .. with VMWare Player Introduction of VMWare Player What is VMWare Player Get your software for free Installation and setup Prepare your own VM images .. Windows, Linux, .. VMWare software runs on different platforms: MS Windows, Linux, Mac OSX. Personal/non-comercial 的vm軟體 由EMC買下來

27 Introduction of VMWare Player - What is VMWare Player
05/23/10 Introduction of VMWare Player - What is VMWare Player Freeware virtualization software VMWare player is for personal non-commercial use of virtualization software released by EMC Corp. It can runs on Windows and Linux 32bits or 64 bits OS platform. VMWare player main aim is on target to compare with same implementation of desktop virtualization product from Microsoft - Virtual PC, which is Microsoft's free desktop virtualization software. Something we have to know .. The VMWare Player’s versions which is earlier than were unable to create virtual machines, meaning users have to get pre-installed virtual machines, manually create and edit vm’s profile for VMWare Player. Version or later lifts this limitation, allowing users to create new virtual machines in the GUI. 主要競爭對手是Microsoft 的Virtual PC 3.0之前的VMWare player的使用者必須使用已經安裝好的image,手動建立及編輯vm的profile 3.0之後沒有這個問題了,這邊例子也是用3.1版

28 Introduction of VMWare Player - Get your software for free
05/23/10 Introduction of VMWare Player - Get your software for free Register you VMWare Player license and get the software: Download and register VMWare Player, go to visit VMWare website, fill the form and get software download link from license notification . 先到官方網站註冊及拿到license,會告訴你那邊可以download,也會要求你註冊一個vmware的帳號,以後要使用vmware其他的軟體,就要使用這組account來使用,之後拿到一個installer

29 Introduction of VMWare Player - Installation and setup
05/23/10 Introduction of VMWare Player - Installation and setup Run VMWare installer When finished download VMWare Player software, open the software installer. Software installation will use total 200MB around disk space for the last version 3.1. After VMWare Player installation finished, open the “VMWare Player”, complete the license agreement. Then may start to configure the system environment: In preferences, download VMWare Tools , The “VMware Tools” package provides supports required for shared folders and for drag and drop operations, and better display performance of VMs. If need more advance features in VMWare solution, users are required to upgrade the Player to “VMWare Workstation. Vmware tools 可以建立一個分享的目錄, VM 和 原本OS都可以看的到, 所以兩個os要分享檔案時, 可以透過這個目錄, display driver也顯示比較好

30 Introduction of VMWare Player - Prepare your own VM images ..
05/23/10 Introduction of VMWare Player - Prepare your own VM images .. Create virtual machine in VMWare Player Acquire operating system iso image or make use of host machine’s dvd device directly. VMWare player will emulate pc bios, find out a bootable device which follows the boot device sequence setup in vm’s bios User can create vm firstly, after vm(s) created, then configure boot device and media source for installation. Just like we will go for buying a bare metal box (PC), and get start to install operating system after complete to assemble pc with components like cpu(s), ram(s) and hard drive(s). Select a “Guest Operating System (vm)”, and pick up correct version (distribution) for that media source you are using. Remember that VMWare Player can install both 32 or 64bits guest os on 64bits host (server), but can’t install 64bits vm on 32bits host (server). 2. User可以先裝一個空的vm,之後再開始裝OS 3. 沒辦法超出硬體限制

31 Introduction of VMWare Player - Installation and setup, continue
05/23/10 Introduction of VMWare Player - Installation and setup, continue Select “Version” (guest OS). for what operating system you are going to install. Decide the location (local) for where vm’s virtual hard drive (HDD) and profile repository to store, the location supposedly to has a large space to store many vm’s “vmdk” – virtual machine disk file. VM(s) can be migrated and backup via copy whole installation directory of the vm(s) to another server Default: my document -> virtual machines Vmdk: virtual machine=> 指vm的image

32 Introduction of VMWare Player - Prepare your own VM
05/23/10 Introduction of VMWare Player - Prepare your own VM Configure vm host to store vm’s virtual disk(s) with single giant file or multiple one; file access performance of vm will be degraded if user create a single big file for vm. User are suggested to create separated multiple files if need big disk space for vm. Refer to VM’s profile information listed here, more customization of hardware's specification can be adjusted via select “Customize Hardware …”: Memory Number of cpu(s) DVD Type of device controller: IDE or SCSI Network adapter: Bridge, NAT, host only 1. 把模擬出的硬碟放在一個大檔或是好幾個小檔案(最大2GB),但是只是先暫駐,並沒真正使用,所以有可能被別的檔案用掉 2.

33 Introduction of VMWare Player - Prepare your own VM, continue
05/23/10 Introduction of VMWare Player - Prepare your own VM, continue Common Networking Configuration Explanation of VMWare: Bridged Networking Bridged networking connects a virtual machine to a network by using the host computer’s network adapter. Host-Only Networking Host-only networking creates a network that is contained within host machine itself; This approach can be useful to set up an isolated virtual network. In this configuration, the virtual machine cannot connect to the Internet. Network Address Translation The virtual machine and the host share a single network identity that is not visible outside the network. NAT can be useful when your network administrator lets you use a single IP address or MAC address. Bridged networking:在network 卡起另外一個network interface, VM直接使用這個interface有自己的mac address,獨立IP Host-only networking: host OS本身會起一個虛擬的interface及虛擬網路也有一個default gateway(在記憶體模擬),VM的network interface接到這個虛擬網段,如果VM想要連到外面的network,在host要改routing table,只看到一個IP echo 1 > /proc/sys/net/ipv4/ip_forward 用手動加routing rule NAT: 只看到一個IP,VM連到外面時會把VM IP換成主機IP,用同一個網路介面,外面是看不到Vm的IP的

34 Introduction of VMWare Player - Prepare your own VM, continue
05/23/10 Introduction of VMWare Player - Prepare your own VM, continue When finish the configuration of vm(s), select your vm from vm repository, edit “virtual machine settings …”: Change the CD/DVD connection to use ISO image or physical drive of host machine. Select Connect at power on (means “start vm”) Right click to select “Play Virtual Machine“, after vm boot up, follow the OS installation processes to finish the new OS installation. Notice: there is message remind user to install “vmware tools”, but it can be done after os installation completed. 先create VM Select Connect at Power on可以立刻看到接DVD或是要安裝的image,這樣開啟VM時才會使用這個Image或是DVD來開機並安裝的流程 下面圖是安裝過程,用視窗顯示安裝過程 VM ware tools不要在這個時間裝,要等完guest OS裝完再裝VMWare tools,不然網路會出問題

35 Introduction of VMWare Player - Prepare your own VM, continue
05/23/10 Introduction of VMWare Player - Prepare your own VM, continue Install VMWare Tools in to VM(s): Enable “Install VMWare Tools…”, and open a console extract the vmware tools package from the vm’s cdrom. Run the installation script “./vmware- install.pl”, wait for installation processes completed, then reboot the system again to let the changes take effect (change of the display driver can take place right away). After vm system reboot , vm preparation is now completed 之後會cd rom會變成VMWare tools所放的packages,這個也是一個虛擬光碟機 打開來後就會有兩個檔一個是perl檔,一個是readme,跑這個perl檔就可以了,VM重開機\後,畫質就會好多了 Vmware tools和Vmware就算裝好了

36 Screenshot of new vm - CentOS on windows..

37 Reference http://en.wikipedia.org/wiki/Virtual_machine
05/23/10 Reference


Download ppt "Virtual Machine Overview"

Similar presentations


Ads by Google