Testing Cooker in a Virtual Machine
From Mandriva Community Wiki
To make your work easier you can use qemu-launcher utility. The simple and user-friendly layout helps you to create an image and start the installation via CD, floppy or network. Qemu does not need you to be root to install cooker, you can use network in user space with the "-net nic" parameter. Ok let's see how to use it then, run qemu-img to make your vm HD image:
qemu-img create mandriva-cooker.img 4G
mandriva-cooker.img is a file of 4GB size, you can use other options to have a compressed or encrypted disk (qemu-img --help). I chose a large file to allow using it by chroot in loopback as we can see later.
After having the HD image we can start the installation. You can follow all the installation methods seen in cooker howto page. If you do not have the Mandriva installation cd/dvd you can launch the network install for i586 architecture from the nfs/ftp/http servers by using a following commands that use small boot.iso image.
- wget -c http://ftp.sunet.se/pub/os/Linux/distributions/mandrakelinux/devel/cooker/i586/install/images/boot.iso
- qemu -enable-kvm -cdrom boot.iso -boot d -hda mandriva-cooker.img
Then in the case of install from the http server you could for example give the following download address for the installer:
- HTTP Server: ftp.sunet.se
- Mandriva Linux directory: /pub/os/Linux/distributions/mandrakelinux/devel/cooker/i586
Or if you have the installation cd/dvd available, you can launch the installation also from there by using a command:
qemu -m 512 -sound-hw all -net nic -cdrom /dev/cdrom -boot d mandriva-cooker.img
You can pass ISO image instead of the cdrom device and the memory you prefer in -m option (qemu --help) (to get help in qemu 0.10.1 just write qemu, the --help option is not there). It is also recommmended to install kvm server module to speedup the qemu and then enable it with options "-enable-kvm" qemu option.
After the installation you will have a window with mandriva cooker installed. If your system is slow, you can install kqemu for your personal use, anyway when you want to speed up your fresh installation and you don't need to test some features, you can mount your mandriva-cooker.img in loopback and test your cooker using chroot (see Chroot HowTo). You need to read your partition table and to multiply by 512 the starting point and to pass the result to mount.
/sbin/fdisk -ul mandriva-cooker.img You must set cylinders. You can do this from the extra functions menu. Disk mandriva-cooker.img: 0 MB, 0 bytes 16 heads, 63 sectors/track, 0 cylinders, total 0 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System mandriva-cooker.img1 * 63 204623 102280+ 83 Linux mandriva-cooker.img2 204624 9017567 4406472 5 Extended Partition 2 has different physical/logical endings: phys=(1023, 15, 63) logical=(8945, 15, 63) mandriva-cooker.img5 204687 728783 262048+ 82 Linux swap / Solaris mandriva-cooker.img6 728847 9017567 4144360+ 83 Linux
Choose your mount point, /mnt/cooker for instance and
#root mount -o loop,offset=373169664 -t auto mandriva-cooker.img /mnt/cooker #boot mount -o loop,offset=32256 -t auto mandriva-cooker.img /mnt/cooker/boot #if you need proc and sys fs mount -t proc proc /mnt/cooker/proc mount -t sysfs sysfs /mnt/cooker/sys #chroot now chroot /mnt/cooker
Easy way to get Mandriva running in a VM
It is handy to have Mandriva Linux running somewhere for test purpose. Here's how to do it and it only requires 700 MB of free space.
- urpmi qemu
- download Mandriva One ISO file from your local mirror or see the official page to get it
- Let's call your download location '$ISO', type :
- qemu -cdrom $ISO
That's all. Use kqemu for improved response time (you need to type "modprobe kqemu major=0" before running the command above). The simulated network is described here
VMware Player 3.* is capable of installing cooker ( or any distribution ) from ISO file or CD|DVD. There is no special magic required. Just follow VMware installation instructions.
The easiest way is to install cooker is using a cooker ISO file. If it does not happen to be available, install the latest release for your arch, remove the official release media, install the cooker media and then use urpmi to "auto-update" to the latest cooker packages.
Unless you want all the packages and the kitchen sink too, download the dual arch (free) ISO and use it to install a minimal Mandriva distribution. Then perform the auto-update process. From there install the cooker packages that you wish to work upon or assist in debugging. [ FYI: Mandriva runs very good in VMware Player. ]
You should be aware that there are limitations to using a virtual guest environment for testing, e.g., 3D effects cannot be tested and there are considerations that must be made as to whether it is the Virtual software(VMware) that is causing some issue. With those caveats in mind, it is probably the easiest way to run cooker on Linux or MS Windows 32|64-bit hosts.
If you want to try to use Xen follow the instructions in the related Xen how-to.