Development/Howto/Cooker on VM

From Mandriva

Jump to: navigation, search
Testing Cooker in a Virtual Machine

You can test cooker in a virtual machine using Qemu, Xen or VmWare (at least the freeware vmplayer).

Contents

[edit]

Using Qemu

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.

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.7.1 just write qemu, the --help option is not there) .

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
[edit]

Ultra simple way to get 2006.0 up and running in a VM

Most people run cooker as their main environment. So it's handy just to have 2006.0 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
[edit]

Using Vmplayer

I don't have vmware so I downloaded the vmplayer for personal use and I installed my cooker easily as follow:

convert the previous qemu image

qemu-image convert mandriva-cooker.img -O vmdk mandriva-cooker.vmdk

or create a new one

qemu-image create -f vmdk mandriva-cooker.vmdk 4G

Create a simple vxd file (I found some howto googling):

#!/usr/bin/vmware
config.version = "8"
virtualHW.version = "3"
memsize = "512"
ide0:0.present = "TRUE"
ide0:0.fileName = "mandriva-cooker.vmdk"
ide1:0.present = "TRUE"
ide1:0.fileName = "auto detect"
ide1:0.deviceType = "cdrom-raw"
floppy0.fileName = "/dev/fd0"
ethernet0.present = "TRUE"
ethernet0.connectionType = "nat"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Mandriva Cooker"
guestOS = "other24xlinux"
nvram = "mandriva-cooker.nvram"
scsi0:0.redo = ""
ethernet0.addressType = "generated"
uuid.location = "56 4d 39 d0 9b 6d f6 6e-07 34 42 13 48 d9 cb 54"
uuid.bios = "56 4d 39 d0 9b 6d f6 6e-07 34 42 13 48 d9 cb 54"
ide1:0.autodetect = "TRUE"
ethernet0.generatedAddress = "00:0c:29:d9:cb:54"
ethernet0.generatedAddressOffset = "0"
checkpoint.vmState = ""
tools.remindInstall = "TRUE"
ide0:0.redo = ""
usb.autoConnect.device0 = "path:5/3/0 autoclean:1"

Install vmplayer and run

vmplayer mandriva-cooker.vxd

Note: if you want to boot from your cd or dvd, to install from iso for instance, you may need to change the vmplayer bios settings (press F2 as soon as your VM boots).

[edit]

Using Xen

If you want to try to use Xen follow the instructions in the related Xen how-to.

Personal tools