Difference between revisions of "Ubuntu Build in a VMware Appliance"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Setting up the System)
(Background)
Line 8: Line 8:
 
* '''Which OS variant to use?'''  For historic, work and family reasons my PCs all currently run WinXP.  However, the only way you can develop and debug on WinXP in a supported way is by paying for Microsoft development tools and I was reluctant to do this, so a Linux build was the obvious choice.  Since I had set up a PC with an openSUSE 10.1 and liked the overall integration, ans found it a nice bundle with a lot of Windows features, my first start was based on this.  However, I found it too like Windows, and I like my development environments 'lean and mean', so I ended going back to Ubuntu.  I just felt more comfortable there, OK.   
 
* '''Which OS variant to use?'''  For historic, work and family reasons my PCs all currently run WinXP.  However, the only way you can develop and debug on WinXP in a supported way is by paying for Microsoft development tools and I was reluctant to do this, so a Linux build was the obvious choice.  Since I had set up a PC with an openSUSE 10.1 and liked the overall integration, ans found it a nice bundle with a lot of Windows features, my first start was based on this.  However, I found it too like Windows, and I like my development environments 'lean and mean', so I ended going back to Ubuntu.  I just felt more comfortable there, OK.   
 
* '''Dedicated or VM?'''  I am pre-fashionable Green.  I hate having too many boxes, big electricity bills and a noisy office.  I also hate chucking stuff away.  I also like sandpits that I can take anywhere and the means Virtual.  Clearly another advantage of this is that you can decouple your sandbox OS from your host OS, especially if your VM monitor supports mulit-platform hosting (thus eliminating MSVPC and Xen, etc. from my options).  This drew me to the free, though not [http://en.wikipedia.org/wiki/FLOSS FLOSS], VMware Player product as my runtime vehicle of choice.   
 
* '''Dedicated or VM?'''  I am pre-fashionable Green.  I hate having too many boxes, big electricity bills and a noisy office.  I also hate chucking stuff away.  I also like sandpits that I can take anywhere and the means Virtual.  Clearly another advantage of this is that you can decouple your sandbox OS from your host OS, especially if your VM monitor supports mulit-platform hosting (thus eliminating MSVPC and Xen, etc. from my options).  This drew me to the free, though not [http://en.wikipedia.org/wiki/FLOSS FLOSS], VMware Player product as my runtime vehicle of choice.   
* '''One 'disk' or two?'''  Again after various debates and getting burnt, I decided that I would split my VM over two virtual HDDs Splitting it into system disk + dev disk like this makes a lot of sense. The system disk is pretty non-volitile as far as development goes so the image can be backed up once and replicated across shared developers easily, since the ZIP container is less than 1Gbyte.  The dev disk basically contains the OOF680xxx dev tree.  This is also a lot easier to back up, say by ZIPing it into a backup directory.  This ZIP will fit onto a DVD or a large USB stick, just in case you want to collaborate or move the dev environment around.  
+
* '''One 'disk' or two?'''  Again after various debates and getting burnt, I decided to split my VM over two virtual HDDsSplitting it into separate system disk + dev disk makes a lot of sense. The system disk is pretty non-volatile as far as development goes so the image can be backed up once and replicated across shared developers easily, since the ZIP container is less than 1Gbyte.  The dev disk basically contains the OOF680xxx dev tree.  This is also a lot easier to back up, say by ZIPing it into a backup directory.  This ZIP will fit onto a DVD or a large USB stick, just in case you want to collaborate or move the dev environment around.  
  
 
You need at least 1Gyte RAM in your PC with 2 Gbyte preferred (or required if you use Vista as your OS).  You will need also quite a lot of room on a HDD that you are going to use. I would recommend a minimum of 20Gbyte.  You are going to run your development environment in a VM which needs to be hosted on your native OS, so keep away from Xen if you use Linux -- at least for this approach.  As I said, it doesn't matter whether your host is WinXP (etc.) or Linux, but if you follow this page you are going to be doing all your hacking in a guest VM which runs Ubuntu 6.10 variant of Linux, so you will need some familiarity with the GNU/Linux development tools.
 
You need at least 1Gyte RAM in your PC with 2 Gbyte preferred (or required if you use Vista as your OS).  You will need also quite a lot of room on a HDD that you are going to use. I would recommend a minimum of 20Gbyte.  You are going to run your development environment in a VM which needs to be hosted on your native OS, so keep away from Xen if you use Linux -- at least for this approach.  As I said, it doesn't matter whether your host is WinXP (etc.) or Linux, but if you follow this page you are going to be doing all your hacking in a guest VM which runs Ubuntu 6.10 variant of Linux, so you will need some familiarity with the GNU/Linux development tools.

Revision as of 01:30, 13 August 2007

BUILDING OOo 2.2.1 over a Ubunt 6.10 (Edgy) VM

Background

This tutorial provides a simple cookbook to create a simple portable OOo development environment based on the primary author TerryE's experiences. It rolls up an output following various false start and permutations, which was based on the following parameters:

  • Which code-base to use? A previous playpen work was on Ubuntu on an OOo 2.0.2 build doing some bug hunting. This was based on the Ooo-build described [Ubuntu_Build_Instructions]], which really helped me get up and running a lot quicker. However, the difficulties arose when I started to make changes or hunt bugs. Was the code that I was looking at base OOo code or something that the VBA project etc. introduced? So I decided to use the standard OOo kit as my future baseline.
  • Which OS variant to use? For historic, work and family reasons my PCs all currently run WinXP. However, the only way you can develop and debug on WinXP in a supported way is by paying for Microsoft development tools and I was reluctant to do this, so a Linux build was the obvious choice. Since I had set up a PC with an openSUSE 10.1 and liked the overall integration, ans found it a nice bundle with a lot of Windows features, my first start was based on this. However, I found it too like Windows, and I like my development environments 'lean and mean', so I ended going back to Ubuntu. I just felt more comfortable there, OK.
  • Dedicated or VM? I am pre-fashionable Green. I hate having too many boxes, big electricity bills and a noisy office. I also hate chucking stuff away. I also like sandpits that I can take anywhere and the means Virtual. Clearly another advantage of this is that you can decouple your sandbox OS from your host OS, especially if your VM monitor supports mulit-platform hosting (thus eliminating MSVPC and Xen, etc. from my options). This drew me to the free, though not FLOSS, VMware Player product as my runtime vehicle of choice.
  • One 'disk' or two? Again after various debates and getting burnt, I decided to split my VM over two virtual HDDs. Splitting it into separate system disk + dev disk makes a lot of sense. The system disk is pretty non-volatile as far as development goes so the image can be backed up once and replicated across shared developers easily, since the ZIP container is less than 1Gbyte. The dev disk basically contains the OOF680xxx dev tree. This is also a lot easier to back up, say by ZIPing it into a backup directory. This ZIP will fit onto a DVD or a large USB stick, just in case you want to collaborate or move the dev environment around.

You need at least 1Gyte RAM in your PC with 2 Gbyte preferred (or required if you use Vista as your OS). You will need also quite a lot of room on a HDD that you are going to use. I would recommend a minimum of 20Gbyte. You are going to run your development environment in a VM which needs to be hosted on your native OS, so keep away from Xen if you use Linux -- at least for this approach. As I said, it doesn't matter whether your host is WinXP (etc.) or Linux, but if you follow this page you are going to be doing all your hacking in a guest VM which runs Ubuntu 6.10 variant of Linux, so you will need some familiarity with the GNU/Linux development tools.

Setting up for the Build

Setting up the System

First you need to download the VMare Appliance Player from VMware Player Download. You will need the correct kit according to whether your machine runs Window or Linux. Install this on your PC, and create a container folder on your HDD to hold your work. You next need to download the Ubuntu 6.10 Appliance VMware Virtual Applicance MarketPlace, and the one that you are looking for is the "Ubuntu 6.10 (Edgy)" appliance. This is an HTTP download of a ZIP file of around 755MBytes, so broadband is essential. Create a directory called Ubuntu 6.10 on your host PC and extract the VMDK file in the downloaded zip file into this folder, then rename it to Ubuntu1.vmdk. (You'll see why later). Now download [this ZIP file] which contains the rest of the files that you need to build your appliance and add them to your Ubuntu 6.10 folder, so that it shoul now contain the following files:

  • ubuntu.vmx. This contains the parameter which the VMserver what devices are attached, such as Virtual HDDs, CDs, scree etc.. Note that this is configured to support two VMDKs.
  • ubuntu1.vmdk. This is the downloaded virtual disk contain /root /home etc. It's only and 8Gbyte image which is just too small to build OOo 2.2.1 for hacking, so I have added
  • ubuntu2.vmdk. This contains an empty 12Gbyte efs3 partition, which shows up in the system as /dev/sdb2, and it is in this that you will build the OOo kits.
  • ubuntu.mvram. This contains the virtual BIOS.
  • ubuntu.vmsd. This is the snapshot file. See VMware Files Explained for more details.

There is some customisation that you need to do when you start up the image for the first time:

  • Hit ESC when you first enter the grub loader and select the recovery mode. This brings you into the console prompt. Change directory to /etc/X11 and remove the copy back the xorg.conf. backupBeforeVMtoolsInstalled back over xorg.conf, then hit ^D to continue the boot. (The reason for this was that the creator of the kit did a sudo dpkg-reconfigure -phigh xserver-xorg which replaced the standard VMware xorg.conf, and without this you can't get sensible screen sizes in your VM.
  • You also need to go into System->Preferences and System->Administration to configure your keyboard, mouse, Time region, etc.. For some reason, I've found that the network needs one reboot before the device drivers see it. You may find it useful at this stage to enable samba file sharing and Remote desktop takeover.
  • You also need to think about the security of your VM because when running it is another machine on the network, and just as vulnerable to attack. If you are doing this in a shared work environment, you might want to consider whether you want to move your VM from a bridged NAT based Ethernet emulation. You should also change the default ubuntu password and default root passwords, and other lockdown parameters.

Since the Ubuntu kit by design a fairly minimalist install, some of the packages that you need are missing from the base VM build, so you will also need to do a

sudo apt-get -y install cvs automake1.9 build-essential libpam0g-dev libpng12-dev flex \
    bison libgtk2.0-dev libcupsys2-dev java-gcj-compat-dev libarchive-zip-perl  \
    libjpeg62-dev libxml2-dev python-dev libdb4.3-dev libdb4.3-java-dev libcurl3-dev \
    unixodbc-dev libldap2-dev libnspr-dev libnss-dev libsane-dev libxaw-headers \
    libbonobo2-dev libaudio-dev libsndfile1-dev libgnomevfs2-dev \
    libstartup-notification0-dev ant

Also a few of the packages expect headers in the wrong directories, so you also need to add the following symlinks to make the compile work:

cd /usr/include
sudo ln -s /usr/lib/jvm/java-gcj/include/jni.h
sudo ln -s /usr/lib/jvm/java-gcj/include/jni_md.h
sudo ln -s /usr/lib/jvm/java-gcj/include/jawt.h
sudo ln -s /usr/lib/jvm/java-gcj/include/linux/jawt_md.h
cd /usr/lib
sudo ln -s libXaw7.so.7.0.0 libXaw.so

You now need to setup your dev-disk, so the first thing that you need to do is to create amount point and mount it. This is basically an empty efs3 10Gyte disk with one file in a folder called misc: the config.sh which contains the configure command discussed later.

cd ~
sudo mkdir /OOO-dev
mount /dev/sdb1 /OOO-dev
ls -l /dev/disk/by-uuid
ln -s /OOO-dev/misc misc
sudo mkdir /OOO-dev/OOF680_m18
sudo chown ubuntu:ubuntu /OOO-dev/OOF680_m18 
ls -s /OOO-dev/OOF680_m18

Clearly for the later builds you will need a different OOF680xxx directory. You may also at this stage add sdb1 mount to your fstab. The above listed of the uuid that you need.

You also need to remove the use System->Synaptic Package Manage to remove the pre-installed OpenOffice configuration. Look for OpenOffice.org-core, remove this and the manager will unistall the rest.

Setting up the Dev Environment

Now download the source tarballs from OpenOffice.org 2.2.1 Source into a temporary directory and unpack into ~/OOF680_m18 directory. You will also need to download the Mozilla libraries and store them in ~/OOF680_m18/moz/zipped. Now do the build.

cd /OOO-dev/OOF680_m18
cd configure_office
source ~/misc/config.sh
./bootstrap
cd ..
source LinuxIntelEnv.Set.sh
dmake >& ~/logs/dmake1A.log

The machine is going to be pretty much 100% compute bound for the next 12 hrs, or thereabouts depending largely on the CPU speed. Note that this method doesn't use the solver tarball, as this is more flexible. Go to bed / wait until this completes. Lastly, you need to install it into /opt/openoffice.org2.2 ready for hacking, and since you want to do all your hacking in user ubuntu change the ownership to this account. Having done this you should now be able to avoid use of sudo in your normal development.

cd ~/OOF680_m18/instsetoo_native/unxlngi6.pro/OpenOffice/deb/install/en-US
sudo dpkg --install -R DEBS
cd /opt
sudo chown -R ubuntu:ubuntu openoffice.org2.2
Personal tools