Atmel AVRISP mkII working in Virtualbox

In the past I have had problems getting the Atmel AVRISP mkII to work with Virtualbox.  This can be really irritating if, like me, you want to write code in Linux but are forced to run Windows for Skype and various closed-source development tools (ugh).

Today, it seems to be working.  I can talk to the AVRISP with avrdude and program devices.  Cool!

I’m not sure what I changed.  I’m using Virtualbox 3.2.10 r66523, running on a Windows 7 64-bit host.  The VM/client OS is Ubuntu 10.10.  I created a USB filter for the AVRISP in the Virtual Machine settings; it doesn’t seem to work without it.  That might be what I was missing before.

To avoid having to run avrdude with root priveledges, I created the file /etc/udev/rules.d/10-avrisp2.rules with the contents:

SUBSYSTEM=="usb", SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2104", GROUP="adm", MODE="0666"

Pretty simple.

Oh, I should add that there is no guarantee other combinations of host/client OS will work.   If you’re getting different results, leave a comment.

7 thoughts on “Atmel AVRISP mkII working in Virtualbox”

  1. I’ve been faffing with a Silicon Labs USB ISCP/debugger and Virtualbox. I’ve finally got it working in my virtualised Windows XP with Ubuntu host. The trick was using the USB filter, with that it now works a treat.

    My AVRISP mkII stays firmly near my GCC, on the Ubuntu host!

  2. .. I’ve used a mkII with avrdude in linux for a few years now. no virtual machine needed.

    (Also there are linux build of skype 😉 )

    1. Max – I’ve used Linux as my primary OS before, but there’s always a few programs that keep me going back to Windows. So instead of trying to run a Windows 7 VM within Ubuntu (not a great experience, GUI response too slow!), I decided to try it the other way around this time.

  3. Please learn from my mistake. Do NOT try to update the firmware on your programmer in either virtualbox or vmware. It will corrupt the image and you will have to find a native windows box to fix it.

    BTW – anyone know how to program elf files directly from linux? I’m lazy and get tired of running 3 separate avrdudes: flash, eeprom, fuse.

    1. I know of *a* way. Write a simple shell script. Just write a text file with a shebang on the first line like this :

      #!/bin/sh

      and then just write the commands you want to run. Make the file executable and then just type “./scriptname” in the terminal and they will all run for you.

      I’m no expert, more elegant ways probably exist. There are probably ways to generalize the script so I didn’t have to re-write it for every project, but I’d have to look up how to do that. Once you figured that out though you could alias your script and easily use it from any directory. Hope that helps at least get you started!

      1. Oh, sorry forgot to mention that I realize that isn’t exactly what you asked for. Don’t have any advice for programing .elf’s, but the shell script I described is a lazy workaround to running multiple commands over and over.

      2. He could also write or edit a Makefile to do the same thing.

        Michael –

        You can’t run avrdude on an .elf file directly, but a Makefile can automate running avr-objcopy to turn the .elf into a .hex (or .eep) file and writing the hex file(s) to the AVR with avrdude (so you don’t have to do it manually each time).

Leave a Reply to SuperFungusCancel reply