From: David Mair Subject: Re: Can several guests run simultaneously on KVM Date: Fri, 01 Aug 2008 21:59:49 -0600 Message-ID: <4893DBB5.6040605@mair-family.org> References: <260299.45247.qm@web35205.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Stephen Liu Return-path: Received: from nobody.sfcn.org ([160.7.248.25]:38519 "EHLO mail.mair-family.org" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750969AbYHBD7v (ORCPT ); Fri, 1 Aug 2008 23:59:51 -0400 In-Reply-To: <260299.45247.qm@web35205.mail.mud.yahoo.com> Sender: kvm-owner@vger.kernel.org List-ID: Stephen Liu wrote: > --- David Mair wrote: >=20 >> Stephen Liu wrote: >>> Hi folks, >>> >>> >>> Can I run serveral guests on KVM at the same time similar to VMware >>> hypervisor? >> Yes. >> >> --=20 >=20 >=20 > Hi David. >=20 >=20 > Thanks for your advice. >=20 >=20 > Any document for reference? =20 Assuming you have done a configure/make/make install then you need to=20 load the drivers. I load the kvm drivers via initrd so that means=20 arranging for them to be included and running mkinitrd. A reboot will=20 cause them to load but you can modprobe or insmod to load them without = a=20 reboot. I change the group of /dev/kvm to be the default group for most users=20 (you need to be able to read/write it to run a VM in my experience). I=20 did that with an init script. It's been a few kvm releases since I last= =20 checked if that's still necessary. After that you'll probably find more useful information if you search=20 for material about qemu rather than kvm. qemu is the userspace host=20 application for kvm VMs. An example of the process of creating a VM is to create a virtual disk=20 image with qemu-img: > qemu-img create -f qcow2 /path/to/my-vm-disk.img 8G That creates a virtual disk that appears to a VM to be 8GB (the actual=20 file will start at about 40kB and grow with use). Now, you can start a VM with qemu, the command lines can be quite long.= =20 Here's a very basic example: > qemu-system-x86_64 -m 512 \ -hda /path/to/my-vm-disk.img \ -cdrom /path/to/OSinstallDiskOrISO \ -boot d \ -name "My groovy new VM" Replace the 512 with the amount of memory you want the VM to have. The=20 VM's IDE primary:master hard disk will be the virtual disk file you=20 created earlier. The VM's optical drive (IDE secondary:master) will hav= e=20 "inserted" media that is whatever you use as the argument to -cdrom. It= =20 can be an iso file or the dev file for an optical drive (and more). The boot argument specifies which device the BIOS will try to boot from= =20 (the optical drive in this case). You'll probably want to change the=20 boot d to boot c after the OS is installed. The guest will have no networking as shown. Network configuration can b= e=20 intimidating. Try getting the basics working then ask for more help wit= h=20 networking. You'll also find in this mailing list archive a few wrapper scripts=20 people have done that make a lot of it easier to deal with. > On googling I only found; > Re: [kvm-devel] KVM and Perf Counters > http://www.mail-archive.com/kvm-devel@lists.sourceforge.net/msg01133.= html >=20 >=20 > http://synergy2.sourceforge.net/ > synergy2.sourceforge.net =97 Synergy lets you easily share a single > mouse and keyboard between multiple computers with different operatin= g > systems, each with its own display, without special hardware. It's > intended for users with multiple computers on their desk since each > system uses its own monitor(s). >=20 >=20 > There are several documents for Xen and VMware. --=20 David.