login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

How to provide FriCAS as a VirtualBox VDI file

The following describes a procedure that produces a running FriCAS (based on sbcl and Debian) as a virtual disk image.

  • Download Debian NetInstall? iso image from here http://www.debian.org/CD/netinst/ . Choose the latest 32bit version: http://cdimage.debian.org/debian-cd/6.0.4/i386/iso-cd/debian-6.0.4-i386-netinst.iso

  • Download VirtualBox for your system: https://www.virtualbox.org/wiki/Downloads

  • Start virtual box and create a new virtual machine "fricas" with a dynamic disk attached. (Disk size must be at least about 2 GB, dynamically expanding, Main memory 1GB).

  • Attach the debian-6.0.4-i386-netinst.iso image as your CD drive.

  • Start the "fricas" machine and install Debian.

    • You can pretty much follow the default setting.

    • Select "Install".

    • Select "root" as the root passwort and great a user "me" with password "me".

    • Deselect the "Graphical desktop environment" if you are asked for it during install.

    • Login as "root". Install GUI (XFCE, GDM) and GNU MP.

      apt-get install xfce4 xfce4-terminal gdm libgmp3-dev emacs
      
  • Power off the "fricas" virtual machine.

Now we have a relatively minimal Debian. We should now compile FriCAS in this environment and install it.

Since we don't want the VDI file to grow too much, we do the compilation in a cloned VM (let's call it "fricasbuild") and only copy the installed FriCAS files to the virtual machine with name "fricas".

  • In VirtualBox go to File -> Virtual Media Manager select "fricas" and press "Copy" and create a dynamic diskimage with name "fricasbuild". Close the Virtual Media Manager.

  • Create a new VM (Linux/Debian/1GB Memory). Use existing hard disk and select the copy "fricasbuild" that you've created above.

  • Start the "fricasbuild" VM and install (as root) all software for a build environment of FriCAS.

    apt-get install libx11-dev libxt-dev libice-dev libsm-dev libxau-dev libxdmcp-dev libxpm-dev
    apt-get install sbcl noweb gitk
    
  • Get the latest FriCAS sources.

    git clone https://github.com/hemmecke/fricas-svn fricas
    
  • Compile FriCAS.

    cd fricas
    git checkout KNOWN-GOOD-VERSION
    ./configure --enable-gmp --prefix $HOME
    make -j x > make.log 2>&1 ## replace x by the number of the processors of the VM
    make install
    
  • Shut down "fricasbuild".

  • Go to VirtualBox Settings for the "fricas" VM and attach "fricasbuild" as a second hard disk.

  • Start the "fricas" VM.

    • Mount the second disk (as root).

      mkdir -p /media/fricasbuild
      mount -t ext3 /dev/sdb1 /media/fricasbuild
      
    • Copy installation (as user "me").

      cp /media/fricasbuild/home/me/bin ~
      cp /media/fricasbuild/home/me/lib ~
      
    • Add the following line to ~/.bashrc.

      export PATH=$HOME/bin:$PATH
      
    • Create an quick-start icon in the panel in order to launch "efricas".

    • Shut down "fricas".

  • The resulting file "fricas.vdi" should now be approximately 1.5GB.

  • Upload "fricas.vdi" to some place from where it can be downloaded.

Shrink the size of a .vdi file

I took most information from here: http://www.bdjl.de/localhost/?p=2135 .

  • Attach fricas.vdi to another virtual machine vm. Maybe simply clone fricas.vdi inside VirtualBox.

  • Start that new machine, become root and install zerofree.

    apt-get install zerofree
    
  • Mount fricas.vdi in read-only mode. (If it's the second disk, it's /dev/sdb1.)

    mkdir /mnt/tmp
    mount -r /dev/sdb1 /mnt/tmp
    
  • Call zerofree.

    zerofree /dev/sdb1
    
  • Close the virtual machine and detach fricas.vdi.

  • In the host system run the following command.

    VBoxManage modifyhd /path/to/fricas.vdi --compact
    

Enlarge a VDI disk

Description is in the VirtualBox Manual. http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi

After that one must attach the .vdi file to another virtual machine. Start that other VM and run gparted on /dev/sdb1, i.e. move the swap partition to the end of the free space that has been created with VBoxManage?.

Resolve Network problems

On reboot the files /etc/udev/rules.d/70-persistent* will be created which involve a MAC address that is most probably invalid if the virtual machine is run on another computer. That leads to unfunctional network connection.

In the virtual machine remove '/etc/udev/rules.d/70-persistent*' and reboot. That should make the network functional again. Maybe one should rather remove those files before distributing the .vdi file.

DISCLAIMER: I've recalled these steps from memory after I have created such a VDI file. There may be small mistakes in the above procedure. In fact, this site is just a reminder to myself. (Ralf Hemmecke)




  Subject:   Be Bold !!
  ( 15 subscribers )  
Please rate this page: