20 May 2009

Using .IMG Files with Virtualbox to Test Netbook Operating Systems

For weeks now I've been trying to test the Ubuntu Netbook Remix and Intel's Moblin Linux operating systems, but have been unable to because I've only been able to find them as .IMG files (and not the .ISO like I'm used to).

Now, there is a practical reason why these distrobutions are released in .IMG form -- .IMG files are apparently intended to be immediately flashed onto USB thumb drives, since most netbooks don't have CD-ROM's at all (the usual destination of an .ISO file). However, I haven't found a reliable way to use these images as a boot source in Virtualbox yet.

I've found where some people have said just rename it from ".img" to ".iso". That didn't work. Some people said try mounting it in Virtualbox's virtual floppy drive, which normally takes .IMG's anyway -- that didn't work.

I know I can just burn it to a USB flash drive that I have handy (if I had an empty one handy :P ), but that defeats the whole purpose of being able to test all this stuff in Virtualbox without having to rely on external physical media!

Oddly, the best solution I found was present at the Debian.org website:

VBoxManage convertfromraw -format VDI [filename].img [filename].vdi


Just use that command (replacing "[filename]", of course). This will convert the .IMG file into a Virtualbox .VDI disk image -- now, simply add that disk image as another hard drive, not a mounted ISO. Here's a pic of the Virtualbox config screen I'm talking about:



Now, just start up your Virtualbox VM and press "F12" to choose your boot drive, and select the drive that you've configured as the converted .IMG.

Whew! Lot of steps for something which is supposed to make stuff quicker! :P But it works, and I'm sure there's an easier way -- they're always is.

That being said, I was pleasantly surprised with both netbook OS's. Ars Technica has a great writeup on Moblin here -- the UI is just amazing. You need a modern computer for it to work on (a CPU with SSE3, at least, I think), and my old Compaq EVO410c from 2001 just didn't cut it, so I'll be sticking with the Ubuntu Netbook Remix.

18 comments:

  1. Thanks for this entry, I just wanted to try moblin myself and wondered how to feed the .img file to virtualbox.

    ReplyDelete
  2. Confused2:40 AM

    Hello.

    Im not sure what your talking about i would like to mount a img file to virtual box. Im running windows xp pro, and not sure where to put this command into? Thanks

    ReplyDelete
  3. Anonymous4:45 AM

    Thanks a lot man

    I'm also on my way to checking moblin out.

    just what I needed.

    ReplyDelete
  4. Anonymous1:04 PM

    This is excellent .. I've been looking for a solution for this for a long time .. thanks

    ReplyDelete
  5. Glad I was able to help everyone out!

    @Confused
    You enter this command into the Windows command shell -- you can access it by going to "Start Menu > Run" and then typing in "command" and pressing Enter.

    I'll look into seeing if I can create a Windows batch file that'll make this easier.

    ReplyDelete
  6. However, if anyone's figured out how to get the correct screen resolution when testing Moblin Beta 2 in Virtualbox, feel free to tell me!

    ReplyDelete
  7. Thanks for the tip. I couldn't get the correct screen resolution either, so the icons on the right like volume, network, sound, zones, etc got squashed up and were unusable. Same thing happened on Eee901. Couldn't get network connected either - even when I tried Intel - could anyone else get it?

    ReplyDelete
  8. Thanks for the tip! For Vista Business, I had to run the command prompt as an administrator to get the conversion to work.

    ReplyDelete
  9. Glad to hear you got it work!

    By the way -- it's possible to get the resolution to run correctly with Moblin, but you have to install it into a VDI, and then install the VBox Additions.

    ReplyDelete
  10. shaun butler7:04 AM

    You can also convert an img to an iso using the built in disk utility !

    mount the img (double click) go to disk utility.
    select the img click convert. create cd /dvd master.
    convert it.
    rename it to iso

    nice ;)

    ReplyDelete
  11. Anonymous6:43 AM

    just to make it clear, if your .img file isn't in /home (or it's windows counterpart), you must specify it's location.

    for instance /home/username/Downloads/chromeos.img

    ReplyDelete
  12. Anonymous5:07 AM

    Hi there froom Sweden!

    Thanks for this tip.

    /axel

    ReplyDelete
  13. Anonymous6:22 PM

    Muchas Gracias, muy buen aporte, lo estaba buscando hace tiempo.

    Saludos

    ReplyDelete
  14. Can this be done on Ubuntu?

    ReplyDelete
  15. Don't see why not -- just have to find the VBoxManage executable on Ubuntu, and the commands should even be the same.

    ReplyDelete
  16. Anonymous4:42 PM

    Trying the .vdi conversion on mac osx snow leopard. When you say didn't work, you mean couldn't boot at all? or was there an error. Rename to .iso allowed me to boot but Windows 7 then said some error with media. Same when using Disk Utility to convert to .cdr then .iso. I don't know if my .IMG file got corrupted with renaming or during download or if it's perfectly fine.

    ReplyDelete
  17. Anonymous2:54 PM

    What do I choose as my boot device? Anything I choose gives a "FATAL" error and the system will be halted. If I let the system boot with the default option, I will receive a _ (i.e. suggesting system typing commands) but it will stay there without moving for several minutes with no response. Would appreciate any help.

    VirtualBox 4.1.2, Host: Ubuntu 10.10, Desired Guest: Chromium OS Flow (chromeos.hexxeh.net)

    ReplyDelete