Ubuntu – How to mount disk image taken in linux and run in virtual box

mountvirtualbox

I want to get virtual box to mount and boot the disk image I took a month ago.

I have been able to mount the drive and can see its contents, everything is accessible, I want to now get the image booted up as I want to use the windows programs I need to access.

How do I proceed? Typing in the question, I only see references to virtual box images.

As I don't have a VBox image file, only the image file I called ssd.img and VBox won't mount anything other than .iso or its native format. renaming .img to .iso doesn't work.

** EDIT **
My question still remains a mystery, to reiterate, I am not using an ISO file, it is an image of a hard disk that was created usingdd command and the file is an *.img file, tried already to change the file name by renaming it and that doesn't work.

I have virtual box and want to run the windows partition of that image.

In simple terms, if it runs then I know the SSD has a bad block (which Ubuntu is not repairing / moving / stuffing in to the 11th dimension…) So I know I can then either use a scrubber and format (as the drive manufacturer suggests) then reimage and we would be all good to go again.

So to reiterate again, this is not "Installing" a windows ISO, it is mounting an image of a hard disk in virtualbox, only VB only accepts ISO or its native variety of formats.

Best Answer

Select a virtual machine by clicking its name in the VirtualBox window
Click the Machine menu at the top of the VirtualBox window, and click Settings
Click the Storage category in the Settings window
Right-click in the storage tree pane, and click Add Floppy Controller
Right-click the Floppy Controller device, and click Add Floppy Device
Click the Choose Disk button in the prompt window that appears

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

Finally, mount the VDI as a hard disk.