VMware: Difference between revisions
(Add an emulation nav sidebar) |
(Cut down on the chatty and redundant text, reorganise, references to emulation and dev handbook) |
||
Line 1: | Line 1: | ||
{{emulation-nav}} |
{{emulation-nav}} |
||
{{merge|Emulating the XO/UsingVMware|Talk:VMware#Merger proposal|{{subst:DATE}}}} |
|||
= Emulation with VMWare = |
= Emulation with VMWare = |
||
[http://www.vmware.com/ VMWare] (Workstation, Player) is an emulator released as commercial software. The player version is distributed free of charge (Gratis). It runs on either Win32 or Linux host machines, allowing you to run OLPC images within the virtual machine. A Mac version is also available, VMWare Fusion, however this is not provided free of charge (a free 30-day evaluation is available). |
[http://www.vmware.com/ VMWare] (Workstation, Player) is an emulator released as commercial software. The player version is distributed free of charge (Gratis). It runs on either Win32 or Linux host machines, allowing you to run OLPC images within the virtual machine. A Mac version is also available, VMWare Fusion, however this is not provided free of charge (a free 30-day evaluation is available). |
||
You can decide either to emulate an XO via downloaded images, or to build a developer's desktop image starting from a stock Fedora 7. Both approaches are discussed here. |
You can decide either to emulate an XO via downloaded images, or to build a [[#Developer's Desktop Emulation|developer's desktop image]] starting from a stock Fedora 7. Both approaches are discussed here. |
||
⚫ | |||
You'll probably want two different Virtual Machines. For serious development of core system components, a Fedora 7 with sugar-jhbuild. For testing and working on activities, you will likely want to run the XO Emulator (see below). |
|||
For development on the core system, you need the Fedora 7 system, so you can use GIT for creating patches. With F7, you're also unlikely to lose your work accidentally while you can still easily run the latest version (using source-code-control is highly recommended). The XO image is nice, beacuse it is much more responsive than F7+Sugar-jhbuild. However, sound and networking may or may not work, depending on the image you are using. |
|||
⚫ | |||
* First get a preconverted XO image from [http://dev.laptop.org/pub/virtualbox/ are made available] (don't worry that it is not the latest; anything less than 6 weeks old is perfect). Be sure to change networking to 'bridged' if you want to access the virtual XO using ssh from another machine in your network. Now you have something to play with, while getting the ''real'' environment. See the sections below for more instructions. |
|||
* The next steps will take the better part of a day to complete, if not more on a slower machine (You'll be running an emulator ''within'' an emulator!) For Windows: if your machine was considered 'fast' two years ago, you'll do fine. For Macs: don't even think about this on a G4 or even a G5: use an Intel-Mac. On either platform: You can try this with 1GB of RAM in your machine, but 2GB is a more realistic minimum. 3GB is perfect. |
|||
* So: Join one of the [[IRC]] channels! Sitting all alone while waiting for the install to complete is no fun :) You will probably want to start either in #sugar for hacking on activities or #olpc for core hacking. #olpc-content is about creating/maintaining materials (you don't actually need an F7 vmware for that!). A lot of people just hang out in two or all three of those. Ask if someone knows about a little thing to hack on. There are always buttons to be added, simple things to be done. Those will get you to learn the environment, really quickly. |
|||
* Create a new virtual machine and do a base F7 install on it. Make sure you give the disk at least 15GB max size. If you have the disk space, preallocate it now. That will give you a twofold increase in performance. If you have more than 1GB of RAM, set the virtual machine to 800MB, if not give it 400MB. Give it access to all your CPUs too, if you have them (default is one). '''Don't worry about packages yet. That will come scripted in the next step.''' ''note: There is a preinstalled 'virtual appliance' F7 available via vmware.com, but you'll need to increase its disk size first. It maxes out at 4.7GB. 2GB short of a working sugar-jhbuild environment.'' |
|||
⚫ | |||
⚫ | |||
* Additionally, you can (and should!) look at http://dev.laptop.org for things to do. There are two 'beginner' links there. |
|||
== Emulating the XO == |
== Emulating the XO == |
||
Line 34: | Line 11: | ||
The XO images have the advantage of being faster than a "developer's desktop" image. They are also much easier to maintain (sugar-jhbuild can be quite time consuming). You should be sure to use source-code-control storing to another machine (such as your host machine) for all of your code so that you do not lose work when updating to a newer image. |
The XO images have the advantage of being faster than a "developer's desktop" image. They are also much easier to maintain (sugar-jhbuild can be quite time consuming). You should be sure to use source-code-control storing to another machine (such as your host machine) for all of your code so that you do not lose work when updating to a newer image. |
||
⚫ | |||
=== Compatibility === |
=== Compatibility === |
||
Line 44: | Line 19: | ||
* A kernel driver (Ensoniq ES1371) has been added to allow sound support https://dev.laptop.org/ticket/3034. |
* A kernel driver (Ensoniq ES1371) has been added to allow sound support https://dev.laptop.org/ticket/3034. |
||
= Caveats = |
|||
⚫ | |||
* You will need to use ssh, rsync, or another standard Unix mechanism to share files with the image under the Player version of the software |
|||
⚫ | |||
== File Sharing == |
|||
⚫ | |||
* source-code-control (git, bzr, svn) |
|||
* sftp, scp |
|||
* rsync |
|||
* editor-based virtual file-systems |
|||
= Setup = |
|||
The VMWare/VirtualBox images are converted from the official images using a simple downloading script. You can either download and convert the official images yourself or use a pre-converted image. |
The VMWare/VirtualBox images are converted from the official images using a simple downloading script. You can either download and convert the official images yourself or use a pre-converted image. |
||
== Downloading Pre-converted Images == |
|||
Pre-converted images [http://dev.laptop.org/pub/virtualbox/ are made available] periodically to support those who do not have Qemu's tools installed on their workstations. Choose the .zip file for the version you require. |
Pre-converted images [http://dev.laptop.org/pub/virtualbox/ are made available] periodically to support those who do not have Qemu's tools installed on their workstations. Choose the .zip file for the version you require. |
||
Line 59: | Line 43: | ||
Read bug [https://dev.laptop.org/ticket/3470 #3470] before choosing builds 578-581! |
Read bug [https://dev.laptop.org/ticket/3470 #3470] before choosing builds 578-581! |
||
== Building an Image from Scratch == |
|||
* Download an official [[OS_images|devel-ext3]] image (<thefile>.img.bz2) |
* Download an official [[OS_images|devel-ext3]] image (<thefile>.img.bz2) |
||
Line 90: | Line 74: | ||
** You can use CTRL-ALT + space then F1, that is, hold down CTRL-ALT while you press the spacebar and then the F1 key. You can do the same with F3 to get back to your normal X session. |
** You can use CTRL-ALT + space then F1, that is, hold down CTRL-ALT while you press the spacebar and then the F1 key. You can do the same with F3 to get back to your normal X session. |
||
* Use an Editor on your HOST machine to edit code. Much nicer user experience. Quite a few editors support 'remote' files using SCP, for example. Setup 'samba' in your virtual machine and you can just use network drives. |
* Use an Editor on your HOST machine to edit code. Much nicer user experience. Quite a few editors support 'remote' files using SCP, for example. Setup 'samba' in your virtual machine and you can just use network drives. |
||
* Install the VMWare tools when available. Really. Just do it. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | <li>Once you have the RPM installed, you have to run a Perl configure script. Well, the XO doesn't have Perl. So you have to install Perl. After that, you discover that the script needs "gcc", "make" and kernel headers. I got "gcc" and "make" in there, but the repositories don't seem to have the right kernel headers.</li> |
||
⚫ | |||
⚫ | |||
⚫ | |||
* Use full screen mode to make working with the emulated machine more pleasant. |
* Use full screen mode to make working with the emulated machine more pleasant. |
||
Line 129: | Line 102: | ||
* Now you can boot the clone! |
* Now you can boot the clone! |
||
== |
=== VMWare Tools === |
||
* install the VMWare tools if you prefer |
|||
** Note, experiences of most developers seem to suggest this isn't '''necessary''', and it's a bit involved |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | <li>Once you have the RPM installed, you have to run a Perl configure script. Well, the XO doesn't have Perl. So you have to install Perl. After that, you discover that the script needs "gcc", "make" and kernel headers. I got "gcc" and "make" in there, but the repositories don't seem to have the right kernel headers.</li> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
For development on the core [[Sugar]] system (as distinct from activities), you likely need an emulated [[sugar-jhbuild]] system so that you can keep up to the most recent versions of all core packages. |
|||
System Requirements: |
|||
* Windows hosts: if your machine was considered 'fast' two years ago, you'll do fine |
|||
* Mac hosts: don't even think about this on a G4 or even a G5: use an Intel-Mac |
|||
* Memory: 2GB is a realistic minimum. 3GB is recommended. |
|||
⚫ | |||
* The next steps will take the better part of a day to complete, if not more on a slower machine (You'll be running an emulator ''within'' an emulator!) |
|||
* Create a new virtual machine and do a base Fedora 7 (or Ubuntu) install on it |
|||
** Do not install any extra packages (will be done later) |
|||
** Make sure you give the disk at least 15GB max size. If you have the disk space, preallocate it now. That will give you a twofold increase in performance |
|||
** If you have more than 1GB of RAM, set the virtual machine to 800MB, if not give it 400MB. |
|||
** Give the image access to all your CPUs too, if you have them (default is one). |
|||
** There is a preinstalled 'virtual appliance' F7 available via vmware.com, but you'll need to increase its disk size first. It maxes out at 4.7GB. 2GB short of a working sugar-jhbuild environment. |
|||
Once you have your working Fedora 7 or Ubuntu image under emulation, see the instructions for setting up [[Sugar with sugar-jhbuild]] for your new (emulated) platform: |
|||
⚫ | |||
* [[Sugar on Ubuntu]] |
|||
⚫ | |||
See: |
|||
* [[Developers/Setup|Developer's Handbook Setup]] -- describes the process of setting up a working environment |
|||
* [[VirtualBox]] is an emulation system with similar performance and usage |
|||
* [[Qemu]] is an Open Source emulation system |
|||
[[Category:OS]] |
[[Category:OS]] |
Revision as of 19:27, 17 December 2007
modify |
Emulation with VMWare
VMWare (Workstation, Player) is an emulator released as commercial software. The player version is distributed free of charge (Gratis). It runs on either Win32 or Linux host machines, allowing you to run OLPC images within the virtual machine. A Mac version is also available, VMWare Fusion, however this is not provided free of charge (a free 30-day evaluation is available).
You can decide either to emulate an XO via downloaded images, or to build a developer's desktop image starting from a stock Fedora 7. Both approaches are discussed here.
Emulating the XO
An emulated XO image is recommended for developers working on Activities (as distinct from Sugar and other core libraries). It is also recommended for those who want to test their software or who may not have enough computer power to run a developer's image.
The XO images have the advantage of being faster than a "developer's desktop" image. They are also much easier to maintain (sugar-jhbuild can be quite time consuming). You should be sure to use source-code-control storing to another machine (such as your host machine) for all of your code so that you do not lose work when updating to a newer image.
Compatibility
- Official OLPC build 616 is known to work under VMWare workstation 5 on Linux AMD64 with networking and (non-csound) sound with a workaround (sound service needs to be restarted)
- Official OLPC build 602 is known to work under VMWare workstation 6 on Vista and MacOS using VMWare Fusion.
- Official OLPC build 557 is known to work under VMWare with networking (tested on Linux AMD64 host w/).
- A kernel driver (Ensoniq ES1371) has been added to allow sound support https://dev.laptop.org/ticket/3034.
Caveats
On Linux, VMWare setup requires a package of kernel modules (as do all high-speed emulation options we are aware of)
File Sharing
You can use your host machine to edit files and "upload" them to your virtual XO via and IP-based file-transfer mechanism:
- source-code-control (git, bzr, svn)
- sftp, scp
- rsync
- editor-based virtual file-systems
Setup
The VMWare/VirtualBox images are converted from the official images using a simple downloading script. You can either download and convert the official images yourself or use a pre-converted image.
Downloading Pre-converted Images
Pre-converted images are made available periodically to support those who do not have Qemu's tools installed on their workstations. Choose the .zip file for the version you require.
Read bug #3470 before choosing builds 578-581!
Building an Image from Scratch
- Download an official devel-ext3 image (<thefile>.img.bz2)
- bunzip2 <thefile>.img.bz2
- use the qemu-img function from Qemu to convert the image into a vmdk file
- qemu-img convert <thefile>.img -O vmdk <thefile>.vmdk
Now create a new VMWare "Machine":
- "New Virtual Machine", "Typical", OS Type "Other Linux 2.6.x kernel"
- Network Address Translation (NAT) networking (recommended, try others if you like)
- Disk configuration (irrelevant, we're going to overwrite it)
Edit "Machine" Settings:
- Memory 512MB (recommended for development work, 256 more closely simulates an XO)
- Remove the auto-generated hard-disk
- Add a new hard disk, "Existing Disk Image", choose <thfile>.vmdk
- Ensure that audio is enabled
Configure
Once you have booted the machine, you will need to specify a name for yourself and choose an XO colour. You will then need to configure the collaboration server. To do this, pull up the developer's console, and use the "vi" editor to change the configuration file ~/.sugar/default/config to change the "server=" line to "server=olpc.collabora.co.uk".
When this is done, reboot. The virtual XO should now have networking support and should show you a network view with other XOs logged on.
Tips
- To get access to the root console, that is, virtual console 1
- You can use CTRL-ALT + space then F1, that is, hold down CTRL-ALT while you press the spacebar and then the F1 key. You can do the same with F3 to get back to your normal X session.
- Use an Editor on your HOST machine to edit code. Much nicer user experience. Quite a few editors support 'remote' files using SCP, for example. Setup 'samba' in your virtual machine and you can just use network drives.
- Use full screen mode to make working with the emulated machine more pleasant.
OLPC Clones
VMware Workstation has a nifty feature called "Linked Clones." This enables users to deploy virtual machines based on the "template virtual machine" that take up very little space. For example, I can make a OLPC virtual machine, turn it into a template, make a clone, and the clone will take up ~6 megs of disk space when not running. When running, it will consume more diskspace as ram.
Why Are OLPC Virtual Machine Clones Useful?
It is now extremely easy to test mesh networking and networking activities in general. The folks at OLPC Austria have done something similar with qemu, but that requires additional software to manage a virtual ethernet network. VMware workstation provides more networking support out the box.
In addition, the clones would take less disk space than it would to run multiple instances of qemu images.
Creating the Template OLPC Virtual Machine
- Follow the above steps for creating a OLPC virtual machine, but when done, do not boot it up. This is extremely important! Booting it up and making a clone of that will cause unpredictable behavior such as no setup username screen ever displaying.
- Now, edit the virtual machine's settings and go to the options tab. Choose "Advanced" and check the "Enable template mode" checkbox and hit OK.
- Go to the snapshot manager for this virtual machine and choose to take a snapshot in its powered off state. Give it a useful name like, "OLPC Base Template" with a description of perhaps "Not booted yet." Save this.
- You now have a template VM for cloning!
Deploying Clones From The Template OLPC Virtual Machine
- With the OLPC VM still selected, Goto VM -> Clone.
- In the 'Clone Virtual Machine Wizard' that pops up, select next.
- Choose the existing snapshot (It will be called "OLPC Base Template" if you followed the above instructions exactly) and hit next.
- Choose "Create a linked clone" - This will greatly save on disk space.
- Give the clone a name and a place to live in and click through.
- Now you can boot the clone!
VMWare Tools
- install the VMWare tools if you prefer
- Note, experiences of most developers seem to suggest this isn't necessary, and it's a bit involved
Ed Borasky, 5 December 2007: I've downloaded ship2 build650 and built a virtual machine from it following the above instructions. Unfortunately:
- The image of 1 GB is almost full. The VMware tools RPM won't install -- there isn't enough space.
- I can build a new virtual disk (2 GB) and copy the original image to it, using a Fedora 8 rescue CD. After that, I can install the VMware tools RPM.
- Once you have the RPM installed, you have to run a Perl configure script. Well, the XO doesn't have Perl. So you have to install Perl. After that, you discover that the script needs "gcc", "make" and kernel headers. I got "gcc" and "make" in there, but the repositories don't seem to have the right kernel headers.
- I am about to try this with the latest Joyride build -- I think I can get all the dependencies installed, although I still will need a larger virtual disk than the stock 1 GB.
- The good news is that even without VMware tools, the virtual machines come up in Workstation and the Player. I have not been able to connect to a host sound card yet, but that's probably a VMware configuration issue and not something in the emulated XO guest.
Developer's Desktop Emulation
For development on the core Sugar system (as distinct from activities), you likely need an emulated sugar-jhbuild system so that you can keep up to the most recent versions of all core packages.
System Requirements:
- Windows hosts: if your machine was considered 'fast' two years ago, you'll do fine
- Mac hosts: don't even think about this on a G4 or even a G5: use an Intel-Mac
- Memory: 2GB is a realistic minimum. 3GB is recommended.
The quickest way to get started creating a jhbuild (developer's desktop) is:
- The next steps will take the better part of a day to complete, if not more on a slower machine (You'll be running an emulator within an emulator!)
- Create a new virtual machine and do a base Fedora 7 (or Ubuntu) install on it
- Do not install any extra packages (will be done later)
- Make sure you give the disk at least 15GB max size. If you have the disk space, preallocate it now. That will give you a twofold increase in performance
- If you have more than 1GB of RAM, set the virtual machine to 800MB, if not give it 400MB.
- Give the image access to all your CPUs too, if you have them (default is one).
- There is a preinstalled 'virtual appliance' F7 available via vmware.com, but you'll need to increase its disk size first. It maxes out at 4.7GB. 2GB short of a working sugar-jhbuild environment.
Once you have your working Fedora 7 or Ubuntu image under emulation, see the instructions for setting up Sugar with sugar-jhbuild for your new (emulated) platform:
The update
step will download approximately 1.6GB of data (using compression so probably around 400MB in actual download). The build phase will also take a few hours. On a 2.4Ghz Core2 duo iMac with 3GB ram it took about two hours.
See:
- Developer's Handbook Setup -- describes the process of setting up a working environment