In my last post I described how to enable kvm on fedora 12.
Now it’s time to create some virtual machines…..
1.) I copy the iso’s of the guest os in the directory /var/lib/libvirt/isos to prevent SELinux from throwing errors like “cannot open XYZ.iso…permissio denied”, even if it’s world readable.
Get your installation media for your guest os you want to install, e.g.
- FreeBSD8.0 => ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/8.0/8.0-RELEASE-i386-dvd1.iso.gz
- Debian => http://caesar.acc.umu.se/debian-cd/5.0.4/i386/iso-cd/debian-504-i386-netinst.iso
- OpenSolaris => http://dlc-cdn-rd.sun.com/c1/osol/opensolaris/2009/06/osol-0906-ai-x86.iso
or whatever system you want…
2.) create the virtual machine on your kvm server
2.1) evaluate the “virt-install” command to check the parameters for creating a virt. machine => man virt-install
2.2) create FreeBSD8.0 vm called “fb8″ with 1 vCPU, 512MB Ram, 16GB HDD, source install file under /var/lib/libvirt/isos, target vm under /vm/fb8.qcow2
virt-install --connect qemu:///system -n fb8 -r 512 --vcpus=1 -s 12 \\
-c /var/lib/libvirt/isos/8.0-RELEASE-i386-dvd1.iso \\
--vnc --noautoconsole --os-type unix --os-variant freebsd7 \\
--accelerate --network=bridge:br0 --hvm -f /vm/fb8.qcow2
3.) switch to your desktop and start virt-manager to access the virtual machine
open virt-manager
- click
File -> add connection
- connection type (most probably) “remote tunnel over ssh”
- type the hostname (or ip address) of the kvm server
- click
Connect
At first connection you’ll get a dialog which shows RSA fingerprint, type yes and click OK
In the next dialog you have to type the root password of your kvm server
Now you should see your vm in state “running”. Click “open” and type the root password again to login to your vm. You should have access to the graphical terminal and the installer of your guest OS should have been started. Now you can install your guest OS…
Advertisement
Like this:
Be the first to like this post.