VirtualBox
A customer asked me to create a VirtualBox virtural machine (VM) using Ubuntu 10.04 and containing their SDK. Here are my notes.
Downloads
- VirtualBox deb package - http://dlc.sun.com.edgesuite.net/virtualbox/4.3.0/virtualbox-4.3_4.3.0-89960~Ubuntu~precise_amd64.deb
- VirtualBox add-on -http://dlc.sun.com.edgesuite.net/virtualbox/4.3.0/Oracle_VM_VirtualBox_Extension_Pack-4.3.0-89960.vbox-extpack
- Ubuntu 10.04 Lucid Lynx PC (Intel x86) desktop CD - http://old-releases.ubuntu.com/releases/lucid/ubuntu-10.04.4-desktop-i386.iso
Installation
Setup storage space
I used an extra hard disk I stuck into my dev machine. I wanted the vm related files to be in /vm
sudo mkdir /media/fa853c54-d59c-435a-bb09-368a6112ec00/vm sudo chmod ugo+rwx /media/fa853c54-d59c-435a-bb09-368a6112ec00/vm sudo ln -s /media/fa853c54-d59c-435a-bb09-368a6112ec00/vm /vm cd /vm
Install VirtualBox
sudo dpkg -i virtualbox-4.3_4.3.0-89960~Ubuntu~precise_amd64.deb
Create RidgeRun-SDK-Ubuntu 10.04 VM
See instructions at https://www.virtualbox.org/manual/ch01.html#intro-installing
The settings I used:
mem: 1024MB virtual hard drive: virtualBox Disk image, dynamic, 100 GB user: rr pass: rr
Configure new VM
- Machine -> General -> Advanced, shard clipboard and drag'n'drop -> bidirectional
- Network -> Attached to: Bridged Adapter
Configure main development PC as primary source for Open Source package downloads
I have over 1200 packages downloaded due to building various RidgeRun SDKs. Instead of downloading those files again, I enabled apache web server on my dev machine and exposed the ridgerun download directory.
On your dev machine, run:
sudo apt-get install apache2 ln -s /opt/ridgerun/downloads /var/www/downloads
Configured sudo and ssh
I am a command line type guy, so I just want to ssh into the VM. I also don't want to keep entering the password every time I run sudo.
In the VM, run:
sudo su - passwd # root password also set to rr addgroup root admin echo '%admin ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers cat /etc/sudoers apt-get install openssh-server exit
While you are on your VM, disable screen lock:
- System -> Preferences -> Screensaver -> Lock screen -> disable
Update all packages
Although 10.04 is out of support, there were still 243 updates since the ISO was made.
On the dev machine:
sudo apt-get update sudo apt-get upgrade
Make a copy of the VM
In case something goes wrong, make a copy of the VM
- In the VM, halt Ubuntu
- In Oracle VM VirtualBox Manager, right mouse click on the VM and select clone, give it a name, and make a physical copy.
- Start the VM again
Install RidgeRun SDK
Follow SDK install steps from https://developer.ridgerun.com/wiki/index.php/RidgeRun_Turrialba_SDK_User_Guide
Setup common download area
sudo chgrp admin /opt sudo chmod g+w /opt mkdir -p /opt/ridgerun/downloads sudo chmod ugo+rwx /opt/ridgerun/downloads
Use bash instead of dash
sudo rm /bin/sh sudo ln -s /bin/bash /bin/sh
Close the terminal and open a new one.
Install toolchain
wget http://www.codesourcery.com/sgpp/lite/arm/portal/package4573/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi.bin chmod ugo+x arm-2009q1-203-arm-none-linux-gnueabi.bin ./arm-2009q1-203-arm-none-linux-gnueabi.bin # installed to /opt/codesourcery/arm-2009q1
Add packages needed by SDK
sudo apt-get -y install git-core fakeroot curl build-essential libncurses5-dev texinfo sudo apt-get -y install minicom picocom quilt subversion autoconf libcrypt-ssleay-perl sudo apt-get -y install ccache uuid-dev liblzo2-dev intltool libusb-1.0-0-dev libexpect-perl sudo apt-get -y install libdbus-glib-1-dev libgtk2.0-dev bison flex gperf libbz2-dev
Add github public key
Follow steps at https://help.github.com/articles/generating-ssh-keys
ssh-keygen -t rsa -C "todd.fischer@ridgerun.com" cat /home/rr/.ssh/id_rsa.pub
Then go to github.com, log in:
- settings -> SSH Keys -> click Add SSH key
Install TI DM814x EZSDK
Use default settings. Remember toolchain was installed into /opt/codesourcery/arm-2009q1/bin
firefox http://software-dl.ti.com/dsps/dsps_public_sw/ezsdk/latest/index_FDS.html chmod ugo+x ezsdk_dm814x-evm_5_05_02_00_setuplinux ./ezsdk_dm814x-evm_5_05_02_00_setuplinux --forcehost --mode console
Add SDK
cd $HOME mkdir work cd work git clone git@github.com:RidgeRun/foo.git rrsdk
Setup local download server
Since I have apache on my dev machine making all the packages I have downloaded available, tell the SDK on the VM to look there first when it is fetching packages:
export PKG_INTERNAL_URL=http://10.111.0.4/downloads
Build SDK
cd $HOME/work/rrsdk `make env` make config time make make install
Cleanup VM
Since I am giving this VM to a customer, I don't want to leave the SSH keys in the image. Good time to clean up other files as well.
rm /opt/images/* rm ~/.ssh/* rm ~/.ccache rm -rf ~/ti-dvsdk_dm368-evm_4_02_00_06 sudo apt-get autoremove sudo apt-get autoclean sudo apt-get purge
Additional Ubuntu packages required by RidgeRun SDK
On a fresh Ubuntu 10.04 install (after running apt-get update/upgrade), the installed packages were captured using
aptitude search .\* | grep ^i | grep -v '^i A ' | awk '{print $2}'
A diff was run on the same output for the VM that successfully build the RidgeRun SDK. The 28 additional packages that were included are:
autoconf
bison
build-essential
ccache
curl
fakeroot
flex
git-core
gperf
intltool
libbz2-dev
libcrypt-ssleay-perl
libdbus-glib-1-dev
libexpect-perl
libgtk2.0-dev
liblzo2-dev
libncurses5-dev
libusb-1.0-0-dev
linux-headers-2.6.32-52
linux-headers-2.6.32-52-generic
linux-image-2.6.32-52-generic
minicom
mkpasswd
openssh-server
quilt
subversion
texinfo
uuid-dev