User:Jack Palmadesso
Intro
The following tutorial is a pretty advanced topic. I will attemmpt to do my best in being as clear as possible but you need to be warned that if you have not worked with Linux for very long you might get lost.
For a few years now the Linux kernel has had the ability to run virtual machines natively. Most people think of Vmware or Virtual Box when they want to run virtual machines. These are good products and have come a long way in making virtualization a reality. While it is possible to get these products for "free" and use them there are drawbacks to using these products. For the most part these mainstream products are streamlined and present a nice gui to an end user. These usually do a good job in making the complex task of virtualizing a machine simple but there are drawbacks. The "free" versions usually disable some really nice features like "snapshots" or they might restrict the amount of resources that can be assigned to a Virtual Machine.
There are also the problems. The guis can be a bit buggy and not always work correctly. Of course support is not going to be possible so you will have to live with the problems until the next update. With Vmware and Virtual Box there are also some packages that need to be installed in the guest to make them work "properly". This is usually some form of driver that makes the Virtual Machine aware its being virtualized or presents a layer to trick the Virtual Machine into thinking its on some real hardware.
I am not knocking these products. There are quite a few out there now and its really amazing how far they have come. I actually remember around the year 2000 when Vmware was giving away its product for free with Suse Linux. They were the only one in the space at that time. Now there are dozens of products and most of them work pretty well. At this point in time virtualization is just a fact so the various OS vendors are now building vitualization into thier product. Microsoft has Hyper-V, Oracle has Virtual Box and Solaris Zones, and all Linux distros have the ablility to run either Xen, or KVM based virtual machines. Xen is on the decline in favor of KVM now.
Its pretty safe to say that if you use the native products that are built into the OS you will enjoy an advantage over a product that you add-on. Think Microsoft and Internet Explorer or Apple and iTunes. These applications will enjoy lots of advatages over competing products because they can take advantage of some unpublished hooks. These hooks will give the native applications many advantages over competing products that are installed afterwords. Native Virtualization is no exception to this rule. This is especially true if the VM is the same OS as the Host OS.
The purpose of this wiki page is to give Amahi developers an intro to native Linux virtualization. Any Linux distribution can be used. Its only a matter of installing the right packages. These days with YUM and APT its only a command or two away and you don't even need to reboot. Take that Microsoft !!
Seriously though I hope you all get something out of this. I've been working with Linux for a long time now (10+ years) and I make my living now from working with it daily. As the Suse guys say "Have alot of fun!"
Prepare Prepare Prepare!!
This is going to take some time so get yourself comfortable. Maybe get some music going in the background and get a drink or something, seriously. For this example I am using the Host or Hypervisor is running on Fedora 15 x64. Do yourself a favor and make the Host 64 bit because you really need to take advantage of the RAM. Here are my Host/Hypervisor specs:
Dual core 3ghz proc 4gb RAM 80 OS drive (Fedora 15 X64 Installed) 160 gb drive (to be used for the VM images)
Nothing special about it right but to take advantage of the 4gb or RAM you need 64 bit, especially if you have more RAM than I have here.
You will need the following information which will be used later on
- Enable Virtualization in your BIOS !! Don't overlook this !!
- Update your System !!
- su -c yum -y update
- Install the needed Packages
- su -c yum -y install kvm virt-manager qemu-kvm.x86_64 qemu-kvm-tools.x86_64 qemu.x86_64 qemu-common.x86_64 qemu-kvm.x86_64 qemu-kvm-tools.x86_64 sheepdog.x86_64 virt-v2v.x86_64 mc nmap
- Your Drive ID or model number.
- You can get this by installing the "sdparm" package
- sdparm /dev/sdb Copy down the model number
- You can also get this same info from the "Disk Utility" app which is gui based.