Live GIS Virtual Machine

From OSGeo Wiki
Jump to: navigation, search

This wiki page describes how to set up OSGeo-Live in a Virtual Machine, using a number of different methods.

The Current Version of this Information HERE: http://live.osgeo.org/en/quickstart/virtualization_quickstart.html

System Requirements

  • RAM: You can only just get away with 1 Gig. 2 Gig is what you will require to avoid slowdowns due to memory swapping.
  • About 10 Gig of spare hard disk for building a Virtual Machine.(20GB if you intend to build an ISO as well.)
  • Recommended: An Ubuntu based linux distribution. We built this Live DVD process using an Ubuntu based system, and some of the steps assume the hosting operating system is Ubuntu, however you should be able to achieve all the steps (some slightly modified) from Windows.

Selecting a Virtual Machine

The OSGeo Live DVD can be built using a range of virtual machines. Here we explain our preferences and reasons:

VirtualBox
VirtualBox is provided as Open Source and can be downloaded onto an Ubuntu based system using apt-get which is great.

VirtualBox is our current recommendation, as it has been the more stable of our implementations so far.

Unfortunately, we haven't worked out how to convert from VirtualBox back to VMware images yet, and so far VMware Player software is more widely deployed than VirtualBox. So for the moment, we plan to build vmware images then convert to virtual box (rather than the other way around).

VMware Server
VMware server provides a browser based interface to the virtual machine which can be accessed over the internet. (This is a good way to let others view your virtual machine without them having to download the large Virtual Machine)

VMware Server also provides compression tools which we use at the end of the build process. (These are not provided by VMWare Player) Unfortunately, there are instability issues with VMWare 2.0.2 + Ubuntu 9.04 / 9.10 (as a host), which means we have been unable to use this combination to build OSGeo Live 3.0 (Arramagong). (The compression tools still seem to work). The vmware images that are created can be used with VMWare Server, VMWare Player and relatively easily can be converted to VirtualBox format. (We haven't worked out how to convert from VirtualBox back to VMware images yet).

VMware Player
VMware Player provides a desktop application which runs a Virtual Machine, and can be used to create a vmware image. It doesn't provide the image compression utilities. (Can we download these from somewhere?)
QEMU with KVM acceleration
Very well supported by newer Linux kernels (KVM is the kernel developer's darling right now). Fully open source and installs from standard Ubuntu packages. Very easy to run. Only runs with Linux as the host, but can run any OS as the guest. See instructions elsewhere on this page. The kvm-img virtual-disk image creating program can create in a number of different VM formats by changing the -f parameter. (used by HB)

Install VirtualBox

Install VMWare Server

Note: During the building of Arramagong 3.0, we have found VMWare Server installed on Ubuntu 9.04 and 9.10 to be unstable to the point of being unusable.

We have successfully installed used a CentOS 5.3 host + VMware Server 2.0.2 (Make sure you don't accept any security updates as this introduces the bug which makes VMWare unstable). We suspect that Ubuntu 8.04 (LTS) + VMware should work as it is supposed to be supported, but we haven't verified this yet.

Alternatively, you can build images in VMWare Player.

You will need VMWare server which provides all the tools for configuring a VM, setting the disk size, compressing the image etc. VirtualBox doesn't seem to have the compression scripts required, and it doesn't seem to have a way to copy your image to VMWare.

If you are installing on linux, the installer will ask a series of questions. Answer the default for everything, except the default administrator. For this, you need to enter in your <user_id> for the local computer you are installing on.

Once running, you should be able to access vmware server at:

https://127.0.0.1:8333

As explained here, firefox has issues connecting to VM until you fix it by doing the following:

  • Go to the url: about:config
  • Update the following:
    • security.enable.ssl2 from false to true

Create an Xubuntu Virtual Machine for VirtualBox

If you already have an Xubuntu (or similar) Virtual Machine, you can skip this step.

Otherwise, run VirtualBox, and create an image.

Download the latest desktop i386 Xubuntu ISO. Copy to the Virtual Machine directory:

mv xubuntu-10.04-desktop-i386.iso "~/.VirtualBox"
  • Run VirtualBox
  • Select Name=osgeolive
  • Operating System=Linux
  • Version=Ubuntu
  • Base Memory Size (RAM) = 768 MB
  • Create a new hard disk
  • Select "Dynamically expanding storage"
  • Hard Disk Size = 20 GB

To boot from the ISO:

  • Select Settings->Storage->CD/DVD Device-> Add -> select the xubuntu ISO
  • Select the Xubuntu ISO

To allow ssh access to the the VM:

  • Select Settings -> Network -> Adapter 2 -> Enable Network Adapter -> Attached to: Bridged Adapter, Name: eth0

The following settings were required with an Ubuntu 9.10 guest operating system, but don't seem to be required for Ubuntu 10.04:

If the display is not rendering for the VM, try:

  • in Settings -> System -> Motherboard -> Extended Features:, untick "Enable ACPI"
  • in Settings -> Display -> Video, set Video Memory = 64 MB.

Run the Virtual Machine, which will boot from the Xubuntu CD. Select to install Xubuntu, using defaults, plus:

  • Language: English (default)
  • Location: (FOSS4G City)
  • Prepare disk space: Erase and use the entire disk (default)
  • Keyboard layout: USA (default)
  • Name: user
  • Login name: user
  • Password: user
  • Computer name: osgeolive
  • [x] Log in automatically

After installing xubuntu, disconnect the ISO image from the CD and reference the physical drive instead.

  • select Settings->Storage->CD/DVD Device: Empty

The save the virtual machine for use later on:

  • select File->Export Appliance ... -> accept defaults

Create an Xubuntu Virtual Machine for VMWare

If you already have an Xubuntu (or similar) Virtual Machine, you can skip this step.

Otherwise, run VMWare Server, and create an image.

Download the latest Xubuntu ISO. Copy to the Virtual Machine directory:

wget http://mirror.internode.on.net/pub/ubuntu/xubuntu/9.04/release/xubuntu-9.04-desktop-i386.iso
mv xubuntu-9.04-desktop-i386.iso "/var/lib/vmware/Virtual Machines/"

Run vmware, which opens up a browser based User Interface.

vmware

Create a new Virtual Machine with:

  • Virtual Machine name = "osgeolive"
  • RAM = 512 Gig (we might want to experiment with less)
  • Hard Disk = 20 Gig (If you plan to make an ISO you will need the space, just the VM install will fit in 8GB with little extra room, but it is a pain to increase later, and can't be done from VMWare Player)
  • Mount the XUbuntu ISO image for the disk drive

For VirtualBox, select the virtual machine -> Settings The following will allow ssh into the virtual machine (for easy building):

  • Network -> Adapter 2 -> Enable Network Adapter -> Attached to: Bridged Adapter -> Name: eth0 (usually)
  • Display -> Video Memory:64K, Enable 3D acceleration.

Run the Virtual Machine, which will boot from the Xubuntu CD. Select to install Xubuntu, using defaults, plus:

What is your name?
user
What is your password?
user
What is the name of your computer?
osgeolive(prev arramagong)
[x] Log in automatically

After installing xubuntu, in the VMWare Summary tab, select the change the CD drive from pointing to the xubuntu iso to point to the actual hard drive.

Alternative: build ISO using vmbuilder

Side note: vmbuilder is reported to be a good way to create an Ubuntu image. I haven't tried it, and haven't worked out if it can create the smaller Xubuntu image. (Please update this wiki if you try it). Note: This method requires you to be running the same or newer version of Ubuntu than you want to make an image for.

host$ sudo apt-get install python-vm-builder
host$ sudo vmbuilder vmserver ubuntu --suite karmic --arch i386 \
      --mem 512 --rootsize=20000 --user user --pass user

Update base Virtual Machine

Now that you have a Xubuntu virtual machine. Boot it to upgrade it's packages.

 sudo apt-get update
 sudo apt-get dist-upgrade
 sudo reboot

This will likely upgrade the kernel, so we want to reboot and then remove the old kernels.

 uname -r
 sudo apt-get remove linux-image-2.6.x (Whatever versions you have that don't match the above, use tab autocomplete to see options)
 

Backup base Virtual Machine

You should now have a XUbuntu Virtual Machine image in /var/lib/vmware/Virtual Machines/ . It would be a good idea to save a copy of this machine somewhere, so you can use it again.