TS-VIRTUAL-DEV Setup Guide

Table of Contents

Introduction

When developing for a Linux based appliance, such as the SBCs from Technologic Systems, it sometimes becomes necessary to utilize Linux tools which don't exist in the Windows world (for example, the 'dd' command to copy a .dd image to an SD card). Except installing Linux on a development PC can be difficult and time consuming for some and obtaining an extra computer to run Linux on is an additional cost.

A practical solution is to offer a pre-built Linux virtual machine (guest) in which you can run Linux commands as if you're sitting on a physical Linux PC from your Windows or Linux PC (host). This guide will walk you through how to prepare the ts-virtual-dev.vdi VirtualBox virtual machine image for use on a host machine using Oracle's VirtualBox application. This guide assumes that you have already installed VirtualBox successfully and will to walk you through how to setup and start your Linux guest. If you do need assistance installing VirtualBox, please refer to Chapter 2 of the VirtualBox User's Manual.

Requirements

Installing and running a VirtualMachine is fairly basic and doesn't have a lot of requirements. You will, however, need a computer with enough harddrive space to both install VirtualBox and have a minimum of 5.8GB free (which will dynamically expand as needed up to a max of 16GB) for the virtual machine image referred to in this guide. Other hardware requirements are as follows (source: VirtualBox FAQs)

You will need to download VirtualBox (3.2.0 r61806 or above)for Windows hosts from the VirtualBox website here: http://www.virtualbox.org/wiki/ Downloads.

You will also need to download the pre-built VirtualBox .vdi image containing the Technologic Systems VirtualBox developmnet environment based on Ubuntu 10.04 LTS with guest additions installed. You can download this image here: ts-virtual-dev.vdi.gz2.

When you have finished installing VirtualBox and you have downloaded the pre-built ts-virtual-dev.vdi image, you will need to 1) extract the ts-virtual-dev.vdi.gz2 file using 7zip, or a similar program, and then 2) move the extracted ts-virtual-dev.vdi image from the original download location on your harddrive to C:\Documents and Settings\Username\.VirtualBox\VDI\ or another appropriate location that you'll remember.

Procedure

The following is a step-by-step guide explaining how to setup the ts-virtual-dev.vdi VirtualBox virtual machine image.

  1. Open Oracle's VirtualBox and then click the "New" button to create a new VirtualBox image.
  2. You are now in the VirtualBox "New Virtual Machine Wizard". Click "Next" to continue.
  3. Name your Virtual Machine (eg. ts-virtual-dev), select "Linux" as the Operating System, and then "Ubuntu" as the Version. Click "Next" to continue.
  4. Accept the default settings for base memory size as 512 MB and click "Next" to continue (if you find that your PC is struggling when running the virtual machine, try lowering this value to 192 MB).
  5. You will now select the virtual hard disk. Click on the Folder with the arrow emblem which will bring up the next dialog.
  6. Click on the "Add" button to add new media to the virtual media manager. It will bring up the next dialog.
  7. Navigate to the location where you downloaded and extracted (you can use the 7zip program for this) the ts-virtual-dev.vdi.bz2 file and click "Open" to add it to the virtual media manager.
  8. You can now see that ts-virtual-dev has been added to the virtual media manager. Highlight the item and click on the "Select" button to continue.
  9. You can now see that ts-virtual-dev has been selected as the virtual hard disk image. Click on "Next" to continue.
  10. Now, review your virtual machine details. Click "Finish" if everything appears to be in good order.
  11. You have now installed the ts-virtual-dev virtual machine. Click on the "Start" button to start the virtual machine.
  12. Once started, you will need to login with the UN: ts-user and PW: ts-user. There are many readme files and such within the virtual machine itself, so be sure to read those as well.
Additional Information/Resources

I would like to follow through on how to copy a .dd image to an SD card by mentioning the required commands. You will probably want to setup a shared folder between the guest and host so that you can access the .dd image that you probably downloaded onto the host machine. Section 4.7 of the user's manual will assist you in this. When you have access to the .dd image, follow the steps below.

   1.) In the terminal, find the required information about the SD card
       inserted.  Most importantly, the /dev/sd* location.
        * sudo fdisk -l
   2.) Once found, you will want to copy the .dd image to the entire SD card.
        * sudo dd if=theImage.dd of=/dev/sdb
       -- Or, alternatively, you can write an image to a single partition of the
          SD card.
           * sudo dd if=partition2_image.dd of=/dev/sdb2
   3.) Furthur, you can mount the SD card manuall using the following commands
        * sudo mkdir /mnt/sdcard_part1
        * sudo mount /dev/sdb1 /mnt/sdcard_part1   

Additional resourses are listed below

Notes from the Author

Image locations, website addresses, and programs may change in time so do not follow this guide verbatim too far past the date it was created on. It may be updated once and a while, but it is not guaranteed. Even if things change, the principles and steps shown in this guide will probably remain the same.

I would also like to add that this document and the subject matter is NOT supported by Technologic Systems. I chose to create this guide on my own time at home and publish it on an semi-official webpage located on the Technologic Systems server. I nor Technlogic Systems are responsible for any damages and/or headaches this guide could have caused. I am providing it in hopes that it will be useful to people (even those who may not be our customers).

You may be wondering why I chose to use the Ubuntu Linux distribution. Well, I wanted to offer the most user-friendly and popular Linux distribution so that it was easy and quick for people to start developing their products quickly with the smallest learning curve possible. Ubuntu has been flaunted and deemed as such by the majority of the Linux community. I also wanted to give the users a Debian based distribution so it matched the SBCs closely.

Created: 05/24/10

VirtualBox version used in this guide: 3.2.0-r61806