Executing Gummiworms The trials and tribulations of a grumpy curmudgeonly old git

20Jan/1215

New Raspberry Pi development vm version 0.2

[update (11/3/12): This version is now out of date. Please use v0.8 the torrent of which is at http://downloads.raspberrypi.org/tools/ukscone/RaspberryPi-Development%20VM%20v0.8/RaspberryPi-Development%20VM%20v0.8.torrent The readme http://downloads.raspberrypi.org/tools/ukscone/RaspberryPi-Development%20VM%20v0.8/README.txt and the sha1 http://downloads.raspberrypi.org/tools/ukscone/RaspberryPi-Development%20VM%20v0.8/RaspberryPi-Development%20VM%20v0.8.ova.sha1 ]

[update: There is a tiny little buglet in the vm that slipped passed me as it didn't crop up when I was testing that yum worked as I didn't install a library that needed to go in the top level of the rootfs. If you get a lot of errors about unpacking or mkdir... when trying to install something using yum then you'll need to do the following

cd $HOME/raspberry_pi_development/f13arm_rootfs
sudo chmod -R 777 *

and that should fix it. sorry about that.

the torrent is now available.]

I have put together a new VM for developing software for the Raspberry Pi. I've made a few tweaks and cleaned up a lot of stuff and it's a much more pleasant setup and easier to use and update without making a whole new VM. I also used fedora13 for ARM as the seed rootfs so it should be possible to just swap files from/to a real Raspberry Pi and it should just run and you can update the seed rootfs as well (hopefully I guessed Raspberry Pi standardized educational disto correctly). I was planning to use fedora16 as the guest OS in the VM but after struggling with some of it's foibles for several hours and having to rebuild it a few times i gave up and reverted back to a ubuntu based release. it's currently compressing and uploading and with my upstream speed being so rubbish it'll take about 8 to 18 hours to finish but once it is finished i'll post a link to it and hopefully someone will make a torrent of it.

http://russelldavis.org/RaspberryPi/raspberrypi_dev_vm_02.torrent

Below is the README that is included with the exported appliance.

-------

RaspberryPi Development Virtual Machine 0.2

This is an exported virtualbox virtual machine for developing software for
the RaspberryPi. It is setup using the git versions of scratcbox2 & qemu (19/01/12), the fedora 13 for ARM as rootfs seed & arm-2011.03 codesourcery toolchain.

The root password is toor and the username and password for the normal user
is raspberry/password

To compile software for the raspberrypi as you would normally on an x86 machine
prefixing sb2 to any command. e.g. instead of gcc hello.c -o hello you would type sb2 gcc hello.c -o hello

To update, install or remove libraries and software in the seed rootfs use the command sb2 -eR yum ... where update, install, remove etc.

If you want to build and install libraries to use when building other software
that are not availble via fedora yum then rather than prefixing with sb2 prefix the command with sb2 -eR e.g. sb2 -eR make && make install

You can upgrade scratchbox2, qemu, the rootfs or toolchain quite easily as they are all in seperate dirs inside the raspberry_pi_development directory. it shoudl be possible to just swap them out when/if you need/want.

I have installed apache2 adn linked the $HOME/build directory so you can download anything you build to another system. You will probably want to change the network settings for the VM from NAT to Bridged though.

An ssh server is also installed so you can ssh in to the vm if you want as well (same proviso as above though. You'll need to change from NAT to Bridged to get it working).

If you have any other questions about the VM then you can send them via my blog (http://russelldavis.org) or post on the raspberry pi forum. (http://raspberrypi.org)

I have added one of my favourite bash aliases to the .bashrc doch is very handy in case you forget to use the sudo prefix to a command. just type doch and it'll redo the command but with sudo added.

Russell Davis (ukscone) 20/01/12

Share
Comments (15) Trackbacks (10)
  1. Great work, thanks for the effort even though I just finished tweaking 0.1 version to my likes.

  2. the VM (ova file in the zip archive) has an md5 of 305ba1bbbc17454f941714f9fff902c0

  3. Thanks to poster who posted .zip, torrent is often blocked on most firewalls.

  4. Sweet! Just wanted to say thanks, it’s working nicely. For those who want to run this under qemu rather than VirtualBox, here’s how:

    1. untar the .ova file.

    2. use VBoxManage to convert the .vmdk to .vdi or .raw (this step is required because qemu and qemu-img currently can’t read this type of VMDK – see http://lists.gnu.org/archive/html/qemu-devel/2011-04/msg01605.html

    3. start it up!

    oh and be aware that if you try to change the directory of the development user from /home/raspberry, it won’t work as this is hardcoded somewhere in qemu. A symlink will fix it.

    Now just waiting for some hardware to match it…

  5. Excellent work Russell. Hoping to get to have a proper play with it this weekend, even if just to look at the desktop wallpaper :)

    Have left my torrent thingy running 24×7 since I downloaded. It says I’ve uploaded 52,915,624K in the 6 days 5 hours since then. And that’s just me, guess there’s a lot of interest in this then..

    Dave

  6. just a note to say that I couldnt start the VM on VMware’s player or workstation but it worked first time on Virtual Box. I know little of VM’s so it could be I was doing something wrong.
    thanks for the VM
    n

  7. Having started the vm in Virtual Box and updated it thru Update manager I tried applying the fix above before I started to install anything else but getting no such directory trying to change into $HOME/raspberry_pi_development/f13arm_rootfs both as user and as root.
    Can someone tell me – What am I missing?
    thx

  8. just found the rest of your docs and info on R-pi – sorry for the previous comments – all much clearer now please just delete all of my comments,
    thx again

  9. G’day Russell!

    Mate, thanks so much for providing the whole kit & kaboodle! It’s an intimidating step for many people, jumping into the world of VMs and filesystems (let alone toolchains!), and this seems to be a great way to start.

    Luckily for me, I’m well versed in VMs (from Z80,CP/M to DOS to Win 3.x to W95 to XP to linux now, all running simultaneously if needed!), but it’s still a big step to go from “I’m so excited about the Pi” to “sb2 gcc hello.c -o hello”!!

    And QEMU has more than its share of quirks and undocumented features that it could still trip novices (and not-so-novices *cough*).

    However, since QEMU does emulate the ARM, I’m wondering if you’ve had a chance to (or interest in) getting code (compiled on your Pi-kit) to somehow run in an ARM instance of QEMU? If so, what would be your recommended way of achieving that? Is it possible? Or is the instruction set hoohaa (Thumb vs RISC, et al) going to be a showstopper?

    The reason I ask is that it would be really nice to get a software mirror of the hardware Pi working so that folks can test something simple out by building it on the PiKit, running it on the ARM VM, and then putting on the Pi to see it work in hardware. Is this feasible? Is it worthwhile doing, or am I just adding more complexity to an already well-complicated situation?

    I do realise that there’s a lot of stuff that can’t be emulated (graphics, networking, GPIO, etc), but the stuff that can be would be nice to see running before the hardware hits our desks.

    In any case, thanks so much for taking so much trouble to help us noobs out. I really do appreciate it. As do quite a few others, judging from the 18,000+ available copies of the torrent!

    Best wishes from Down Under,
    Pete (aka Cephas Borg).

    • I have actually been looking at how sbrsh/sbrshd (scratchbox remote shell) works these days (it seems to have been abandoned, the git repository that did exist is gone and just legacy tarballs lying around). I seem to have found two “forks” of it before it got dropped. one seems to have sshfs support and the other has the original nfs support but I haven’t yet found time to investigate further. If i can get versions compiled for the raspi and qemu then we can use sb2 with either the real hardware and/or a running qemu-system-arm system to handle the ARM emulation required when doing things like ./configure

      However if you have a running qemu-system-arm with a compatable rootfs to the one sb2 is using e.g. fedora and have networking working in the qemu-system-arm emulation then because I installed (or you have) apache2 and symlinked it to the build directory you can wget programs built using sb2 into the running qemu-system-arm system.

      I did try to be a clever wotsit a couple of days ago and used a virtualbox emulated harddisk containing the seed rootfs that scratchbox2 uses and used that with qemu-system-arm instead of a disk image. so that things compiled and installed to the rootfs in scratchbox2 would show up in the running qemu-system-arm and vice versa. Probably not exactly a wise thing to do and i probably wouldn’t recommend it if you want to keep a stable rootfs but it did work :)

      I’m having to put most Raspberry Pi things (other than the forum and twitter) on the back burner for a little while but as soon as I get a chance i’ll continue looking at sbrsh. If anyone wants to speed up the time it takes for me to get back to raspi related activities I could do with some help with opencv and python and webcams in linux :)

  10. thank you for the nice work. I would recommend to add QT to the VM and adjust the environment for building software on it and compiling for arm. This is tricky. Please do it for us.

  11. Many Many thanks for the vm. How difficult is it to transfer this to a real raspberry pi?

    also i am running a programme which is based for the x86 (i386) and have installed it on this machine in vbox and it works? i thought that i would of had to get the ARM version of the binary but it works out of the box? would this happen on a real raspberry pi?

    thanks again


Leave a comment