From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: QEMU / KVM support in libvirt & virt-manager Date: Sun, 25 Feb 2007 16:29:45 +0000 Message-ID: <20070225162945.GA13570@redhat.com> References: <20070222221654.GR22473@redhat.com> <45E11F8A.8080306@qumranet.com> <45E14A07.6090207@qumranet.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <45E14A07.6090207-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Sun, Feb 25, 2007 at 10:34:15AM +0200, Avi Kivity wrote: > Avi Kivity wrote: > >Daniel P. Berrange wrote: > > > >>FYI, as of libvirt 0.2.0 and virt-manager 0.3.1 there is now > >>(experimental!) > >>support for managing virtual machines running under QEMU or KVM > >>virtualization > >>platforms, as well as the existing Xen support. > >> > >> > >> > > > >Great; as I see it hit FC6-updates I'll give it a shot. > > How is one supposed to use it? I tried entering 'qemu://' and 'kvm://' > in the 'other hypervisor' thingy, but that didn't work. The virt-manager in Fedora Core 6 hasn't been updated to the newest 0.3.1 release yet - only the underling libvirt has been pushed to FC6 thus far. What follows is an example illustrating use of the low level 'virsh' command. First we create an XML file describing the VM we want to create, then create a file to serve as a disk image. Then we start virsh connecting to the QEMU hypervisor, define the domain, start it and dump the runtime info & XML. Finally it connects to the VNC port to access the console $ cat > newvm.xml < Fedora c7a5fdbdcdaf9455926ad65c16db1809 hvm 219200 2 EOF $ dd if=/dev/zero of=/home/berrange/fedora.img bs=1M seek=5000 count=0 $ virsh --connect qemu:///session Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh > define /home/berrange/qemu.xml Domain Fedora defined from /home/berrange/qemu.xml virsh > list --all Id Name State ---------------------------------- - Fedora shut off virsh > start Fedora Domain Fedora started virsh > list Id Name State ---------------------------------- 4 Fedora running virsh > dominfo Fedora Id: 4 Name: Fedora UUID: c7a5fdbd-cdaf-9455-926a-d65c16db1809 State: running CPU(s): 2 CPU time: 0.0s Max memory: 219200 kB Used memory: 219200 kB virsh > dumpxml Fedora Fedora c7a5fdbd-cdaf-9455-926a-d65c16db1809 219200 219200 2 hvm /usr/bin/qemu virsh > quit $ vncviewer :0 VNC Viewer Free Edition 4.1.2 for X - built ... The above illustrates creating a QEMU domain. The use of KVM is completely identical - still use qemu:///session as the hypervisor URL. The change is in the XML file describing the guest VM - in the top level '' attribute use type='kvm' instead of type='qemu'. You can also use type='kqemu' if desired. NB you can create 'qemu' guests as an user, but if you want to create kvm/kqemu guests you must either be root, or chown the device nod.e Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV