How to convert .img to usable VirtualBox format

296,513

Solution 1

  1. Select a virtual machine by clicking its name in the VirtualBox window
  2. Click the Machine menu at the top of the VirtualBox window, and click Settings
  3. Click the Storage category in the Settings window
  4. Right-click in the storage tree pane, and click Add Floppy Controller
  5. Right-click the Floppy Controller device, and click Add Floppy Device
  6. Click the Choose Disk button in the prompt window that appears
  7. Navigate to the floppy disk image file (.IMG) on your computer and double-click it

If that doesn't work, try renaming the .IMG as .ISO and mount it.

If that too doesn't work, use VBoxManage's convertfromraw command as follows:

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

Mount the VDI as a hard disk.

Solution 2

Windows 10 can mount .img files as a drive. This drive can then be accessed by a virtual machine.

  1. In Windows Explorer, right click on the .img file, select Mount.
  2. Start the virtual machine
  3. In the Devices menu => Optical Drives => select the Host Drive created in step 1.
Share:
296,513
Anthony
Author by

Anthony

Computing and Systems student, gamer, knowledgeable with computers, programming etc.

Updated on September 18, 2022

Comments

  • Anthony
    Anthony almost 2 years

    I have a .img file for Windows 10, and I need to turn it into something which I can use in VirtualBox, such as an ISO, or turning it into a bootable virtual disk for an ICT project.

    • user1686
      user1686 over 11 years
      If this was Linux, I'd suggest qemu-img convert. On Windows, it's more fun to install Win1 yourself from floppy images
  • Anthony
    Anthony over 11 years
    Thanks so much! It worked, and a few days before the project was due.
  • ThorSummoner
    ThorSummoner almost 10 years
    Is this reversible?
  • Karan
    Karan almost 10 years
    @ThorSummoner: Try VBoxManage clonehd --format RAW [filename].vdi [filename].img (syntax help for clonehd here).
  • Amit Bhagat
    Amit Bhagat over 8 years
    Thanks! Renaming .img to .iso worked in my case, I had SharePoint 2013 Server.
  • Jorduino
    Jorduino about 7 years
    The fully quallified command path is: /Applications/VirtualBox.app/Contents/MacOS/VBoxManage clonehd --format RAW [filename].vdi [filename].img
  • weberjn
    weberjn over 6 years
    convertfromraw was the only way that worked for me to convert a Volumio.img into a VirtualBox vdi and boot from it.
  • vhs
    vhs about 6 years
    Just a note it will not work if the image file converted is built for a different architecture. For example, you cannot convert a Raspian (ARM) image for use in VirtualBox (x86) using this method.
  • Gurpreet
    Gurpreet over 4 years
    sometimes it wont , for e.g. i tried to mount an octopi img file in windows 10 and it said the image file is corrupt
  • GChuf
    GChuf about 4 years
    I'm also experiencing a "corrupted image file" which came from a raspberry pi.
  • Anton Andreev
    Anton Andreev over 3 years
    convertfromraw is what worked for me.
  • Tim McElwee
    Tim McElwee over 2 years
    The Rasberry Pi images might be ARM processor based, instead of x86-based.