Installing the Mindstorms EV3 software on a Linux system

Alternatives

The Mindstorms software requires either a Microsoft Windows, or a MacOSX system. I run Linux exclusively. I don't own a Mac, and don't want to install Windows, not even dual-boot. I don't want to give Windows that much control over the entire machine. Wine does not seem to be an option, giving the Mindstorms software the rating "garbage".

VirtualBox

My way out was VirtualBox. Note that Lego itself provides installation instructions for VirtualBox, but this is for the opposite way: installing VirtualBox in Windows to run a Linux guest system.

What I did was installing VirtualBox within my Debian (wheezy) system. This ships with version 4.1.18, and I managed to install both Windows 7, and the Mindstorms software. I had to install the guest additions and the USB2 extensions to even get the EV3 brick recognized by Windows as USB device. However, Windows wouldn't recognize the brick correctly. It could "see" it, but the driver wouldn't pick it up and the Mindstorms software didn't recognize it either. I tried everything within that setup. Updating to the latest Microsoft patches didn't help either.

The solution to this was to use a newer version of VirtualBox - I used version 4.3.6. I could reuse the old machine with the new version, and again had to make sure all USB support and guest additions were installed. VirtualBox actually provided Debian packages, which is a real treat, making installation a breeze. Using this version, Windows correctly listed the Brick in it's hardware list, and the Mindstorms software recognized it as well. Not all was well yet, though:

USB foes

VirtualBox features so-called USB filters. These are a very nice way to use select which USB device should be used by which system - host or which of the possibly many guests. By default nothing is automatically attached to the guests, but you can simply add something while the guest is running, without the need for a filter. A filter is a rule for VirtualBox to always connect certain USB devices automatically to a given guest. This is what you very likely want for the EV3 brick, so be sure to create one of these for your own convenience. This works well, except when you update the firmware of your brick.

Firmware update

Almost the first thing I did after getting USB communication to the brick working was to update its firmware. And I promptly ran into another problem. While my USB filter happily connected the brick to the software every time I connected it to the machine, little did I know how the upgrade process works. What happened was that I started the upgrade process, which put the brick into update mode and then nothing happened anymore. The software eventually timed out and gave an error message - something you don't want to see in a firmware update. The brick was stuck and all I could do was powering it down (by taking out the batteries). Powering it up revealed that it was now hanging at start-up. You can imagine how I felt at that moment, but not all was yet lost. I noticed the very likely reason that this failed: when a brick is put into update mode, it unregisters itself from USB and registers as another device. This in general is fine, except that VirtualBox didn't automatically connect it to Windows, and since I didn't do it by hand, the software eventually timed out. So: if you ever do a firmware update, be sure to watch your USB devices and connect the "EV3 firmware update" device as soon as you see it. I later tried an empty filter which supposedly connects any device, but for some reason this also didn't work.

All this knowledge didn't help me at this point though. The brick was stuck in its start-up phase, and the software didn't recognize it, so I couldn't start the firmware update process again. Luckily, Lego provides a recovery mechanism for this case:

  1. Power your brick down (if need be, by removing the batteries for a short time)
  2. Hold down the back, center and right buttons
  3. When the brick restarts, release the back button

This puts the brick into the "update mode" I described earlier (watch out to connect it in VirtualBox), at which point the Mindstorms software recognized the brick and could update the firmware. I was successful with this procedure, and use this VirtualBox setup to program the brick, even though my underlying OS is still my old Linux installation.