User:Murdos/colinuxmbserver

From MusicBrainz Wiki

Products > Server > Server development > Server setup > CoLinux MusicBrainz Server

What Is the CoLinux Virtual MusicBrainz Server?

The CoLinux Virtual MusicBrainz Server is variant of VirtualMusicBrainzServer using Cooperative Linux instead of VMWare to run the virtual machine image provided by MusicBrainz. This image contains a Linux environment fully configured with the latest release of the Server source code. If you want to experiment with the data, or try hacking on some new features, it is intended to be the fastest way to get up and running.

Why should you use coLinux instead of VMWare?

  • It is faster
  • It can run as a Windows Service
  • However it's more complex to set up

What's in the Image?

See VirtualMusicBrainzServer: we'll use the same image.

Preparation

You first need to convert the virtual machine image for VMWare to a format adapted for coLinux.

Download the image using the link in VirtualMusicBrainzServer & extract the files

Check the VirtualMusicBrainzServer page to know the last VMWare image adress.

At the time of writing the URL to download it is ftp://ftp.musicbrainz.org/pub/musicbrainz/MBServer-20070401-2.tar.bz2.

Convert the virtual disks split in 2Gb files to single virtual disks

  1. Be sure to have VMWare Server installed: you'll need the vmware-vdiskmanager tool which comes with it
  2. Assuming vmware-vdiskmanager is in your %PATH%, launch:
vmware-vdiskmanager -r MBServer-Root-000001-cl1.vmdk -t 0 MBServer-Root-000001-cl1-flattened.vmdk
vmware-vdiskmanager -r MBServer-DB-000001-cl1.vmdk -t 0 MBServer-DB-000001-cl1-flattened.vmdk

Convert the new single virtual disks in VMWare format to QEmu raw format

  1. You need the QEmu qemu-img tool
  2. Assuming qemu-img is in your %PATH%, launch:
qemu-img convert MBServer-Root-000001-cl1-flattened.vmdk MBServer-Root.img
qemu-img convert MBServer-DB-000001-cl1-flattened.vmdk MBServer-DB.img

Convert the QEmu raw virtual disks in coLinux raw format

  1. You need a win32 port of dd provided by unxutils
  2. Assuming dd is in your %PATH%, launch:
dd if=MBServer-Root.img of=MBServer-Root bs=512 skip=63
dd if=MBServer-DB.img of=MBServer-DB bs=512 skip=63

Running the CoLinux Virtual MusicBrainz Server

You need to include the following in your coLinux XML configuration (for coLinux 0.6.x):

<block_device index="0" path="\DosDevices\<PATH_TO_YOUR_VIRTUAL_DISKS>\MBServer-Root" enabled="true" alias="sda1" />
<block_device index="1" path="\DosDevices\<PATH_TO_YOUR_VIRTUAL_DISKS>\MBServer-DB" enabled="true" alias="sdb1" />
<block_device index="2" path="\DosDevices\<PATH_TO_YOUR_VIRTUAL_DISKS>\<A_SWAP_FILE>" enabled="true" alias="sda5" />

<!-- bootparams allows you to pass kernel boot parameters -->
<bootparams>root=/dev/sda1</bootparams>

<memory size="256" />

Attention.png Don't forget the alias parameters. You also need a swap file - see http://www.colinux.org if you don't know how to get one.

You should now be able to start the coLinux daemon.

For the follow-up, see VirtualMusicBrainzServer.

References