Programming Robots Study Group – VM

Wikis > Robotics > Programming Robots Study Group - VM


  • VirtualBox is an operating system virtualization product. It allows you to run multiple operating systems.
  • VirtualBox encapsulates operating systems as virtual machines.
  • A virtual machine is contained in an image file. Click on these links to download an image file:

How to use

  • You must download and install Virtual Box. If you are already using Ubuntu or Debian variant, you can use apt-get.
  • How to set up VirtualBox
    • Start VirtualBox
    • File-> Import appliance
    • You may want to increase memory before completing the import process. The image is set to create a machine which has 1GB ram. For performance reasons, you might want to increase this value.
    • Click import button
    • After importing, help->about and note the version of VirtualBox.
    • Close VirtualBox.
    • Install USB extensions
      • Find The USB Extension for your installation. You may find it on the downloads page, or old builds.
      • Click on the link to download the extension pack; choose open with virtualbox
      • When done downloading the extension pack, virtual box should open and ask you to install (click the install button). You will be prompted to accept a license – you have to scroll through the whole license before you can click “I agree”
    • To enable VirtualBox access of USB connected devices in Ubuntu – (not sure if this needs to be done in windows or mac – or if so how to do it)
      • Close virtualbox and run this command:
      • sudo usermod -aG vboxusers <username>
      • Log out of your session or reboot your machine
      • Once back in, launch VirtualBox and start the vm (virtual machine).
      • When the desktop is back up, click on devices/usb and click on any usb device you want to connect to.


These techniques apply to BOTH virtual and physical machines.

Virtual to Physical

THIS SECTION IS UNDER CONSTRUCTION AND INCOMPLETE. No warranty expressed or implied. Use at your own risk!

For some purposes you will want to run an OS as the native OS on a device. An example might be that you are doing Android development and need to use the emulator, which will not work under VirtualBox.

Note! It is really, really important that you get the device path right – you can cause irreparable damage to your system if you don’t. This is destructive and may result in complete data loss or worse. Read and understand these instructions completely before attempting.

  • These directions assume 2 open USB ports on the target machine. You will need 2 USB drives. One at least 2GB and the other 64GB. Both should be FAT format.
  • You will use the 2GB drive to create a bootable USB drive using these instructions.
  • Create a ‘raw’ image of the disk of your virtual machine. For virtual box, type a command like this:
    VBoxManage internalcommands converttoraw ROS-Indigo-Ubuntu32-20150314-disk1.vmdk TARGETNAME.img
  • You will want to replace TARGETNAME with an appropriate name of your choosing. TARGETNAME will work however.
  • We now need to backup the files from the raw/img file. You must mount the image file on a loop device. Right clicking the image file and open with disk image mounter Nautilus.
  • Now you must back up your files. Ubuntu has documented this here. Since your USB is FAT format, files cannot be greater than approximately 4GB. USER is your user. MOUNTPOINT is specific to your machine. Substitute those values in the following subsection.
    • Change to the directory:
      cd /media/USER/MOUNTPOINT/
    • Create, verbose, preserve permissions, compress, specify file to compress to. f must be the last parameter after the tar command as it specifies file prototyle:
      USER@COMPUTER:/media/USER/MOUNTPOINT/$ sudo tar -cvpzf /bkup.tar.gz --exclude ./media --one-file-system .
    • Make directory on USB drive tardir:
      mkdir tardir
    • Now you must split the The last parameter is the prefix. Trailing ‘.’ is on purpose and required.
      sudo split -d -b 3900m /bkup.tar.gz /media/USER/MOUNTPOINT/tardir/bkup.tar.gz.
  • Boot your target machine using the bootable USB device prepared earlier. Click on try Ubuntu.
  • Use gparted to partition the disk. This is destructive and will make existing data unavailable.
    • Open a terminal and type:
      sudo gparted
    • Delete all existing partitions, assuming you want to use the entire drive.
    • Click on the document with plus icon to create the main partition. Allocate all but the space you want for a swap partition. Use ext4 for the file system. Swap size should be… Minimum might be 2GB and as much as 8GB. MARCO, do you have a suggestion here?
    • Create the swap area next with linux-swap as the file system. Allocate the remaining space to swap. Apply all operations.
    • Now right click on the main partition->manage flags and set the boot flag and close gparted.
  • Now let’s move the tar’d files to the newly partitioned device.
    • Insert the USB drive with the tar files.
    • Determine which drive is the hard drive you want to install onto.
    • df -h
    • cd /media/ubuntu/NEWPARTITION
    • cp /media/ubuntu/USBDRIVE/tardir/* .
    • cat bkup.001>>bkup.000
  • The software

    2015-02-15 image

        • Xbuntu – a somewhat light-weight Linux distribution
        • ROS Indigo Desktop – a developer’s version of Robot Operating System
        • Eclipse Luna with Python, C and C++ Tools – Eclipse is an IDE (integrated development environment); Python, C and C++ are computer languages.
        • Android SDK and NDK – Android software development kit and native development kit.
        • Android Studio – latest Android development tools
        • Arduino IDE – Arduino is a platform for device control; the IDE
        • FreeCAD – 3D computer aided graphics
        • Inkscape – vector graphics editor
        • Blender – a 3D graphics tool, often used for animation
        • LibreOffice – a complete open source office suite including word processor, spreadsheet, database, email and calendar.

    2015-03-14 image – includes 2015-02-15 image

      • Slic3r – ‘slices’ 3d models to prepare them for printing
      • Pronterface – controls 3d printer
      • Cura – ‘slices’ 3d models and controls 3d printer
      • Teensy extensions to Arduino IDE – Arduino interactive development environment makes it easy to create software for an Arduino microcontroller
Did you like this? Share it: