Posts Tagged VirtualBox

Booting a spanned raw image in VirtualBox

I was given the task of trying to figure out how to boot a spanned DD image file as a virtual machine in the software of my choice.  It was an old image of a Windows 2000 machine that was spanned in 650MB blocks, a total of 10 files.  I originally tried converting each segment into the VirtualBox VDI file just to see if I could get something usable, but that wasn’t successful. I looked online for 40-45 minutes trying to figure out how to merge all the segments into one file.  I had no luck at all with that, but I did get another idea because of a previous assignment in this class (computer forensics).

What I ended up doing was mounting the spanned image on my machine as another “disk” on my computer.  I then used ProDiscover Basic to capture an image of the “disk” – essentially capturing an image of an image. I then used Virtualbox’s command line tool to convert the new DD image file into their virtual hard drive file, a VDI.

Software used: Mount Image Pro, ProDiscover Basic, and VirtualBox.  Mount Image Pro is only a trial version, but it will work perfectly for this.  This is meant for students of my class who already have access to a demo version of ProDiscover Basic. There may be free alternatives out there that can do the same thing and can probably be swapped out easily for those steps.

Here are my steps, with lovely screenshots.

Open Mount Image Pro, click the mount button, click on add image. Browse to where your image is located and select the first file in the span and click open.

After you click on the Mount Disk button a window will pop up where you can select some options. The only way I got this to work was telling it to mount as physical and logical. I left the other 3 options as default.

After it has mounted you may see in the window that there are multiple partitions.You’ll want to pay attention to the As column and in this case, the one called PHYSICALDRIVE2 in my example.

Now open ProDiscover Basic, cancel the prompt to start a new case if that comes up, go to the action menu and click on capture image.  In this box you’ll want to select PHYSICALDRIVE2 as the source drive, choose the destination to save the file, and most importantly, choose the UNIX style DD format.  Click OK and walk away for a few minutes while it captures the image.

After the image has been captured the next step is to use the VirtualBox command line tool to convert it into a VDI file.  I find this to be easiest if you move or copy the DD file into your VirtualBox program files directory (C:\Program Files\Oracle\VirtualBox is the default path).  If you don’t put the file in that directory you’ll have to type out the entire path so the tool knows what file to convert.

Open a command prompt. Change the directory so you are in your VirtualBox installation directory by typing:

cd c:\program files\oracle\virtualbox

Now comes the command to convert the file into VDI format.

vboxmanage convertfromraw filename.dd newfilename.vdi

Hit enter and let it do its thing.  Once it returns a blank line it’s done.

Now you can cut and paste the DD and the VDI files into whatever directory you want.  Open VirtualBox and go through the prompts to create a new machine like you would any other time. Instead of having VirtualBox create a new disk you’ll just tell it to use an existing disk and choose the VDI file.

, , ,

5 Comments

Copying a VirtualBox virtual machine onto another host computer

I came across VirtualBox awhile back and it’s going to be the perfect program for us here since a good chunk of us use Ubuntu but at times need to test things in Windows or use specific programs that are only accessible in Windows.  It takes longer just to restart the computer into Windows than it does to test or use the program we need most of the time, so this will save us some time and be way more convenient.

Before I pushed this out on the next image I needed to find a way to copy the virtual machine I created so that my co-workers could use the same base image file and just configure it the way they want from there.  I found this blog that is my source for this information but it’s slightly different since he is using the Windows version of VirtualBox.

To copy the image to another computer:

  1. Close VirtualBox if it’s running.
  2. Go to your home folder and enable show hidden files through the View menu.
  3. Find the .VirtualBox folder, go to the HardDisks folder and copy the .vdi file you want to use.  In my case  I burned the file to a DVD because we have so many people who will be needing to save this in their home directory.
  4. Now go to the other host computer you want to use that .vdi file on and open VirtualBox if you’ve never opened it on the new host machine before.  This will create the .VirtualBox folder.  Then paste it in the same place (user’s home directory -> show hidden files -> .VirtualBox -> HardDisks).  You might need to create the HardDisks folder yourself.
  5. Edit the permissions of the file in order for it to work.  All I did was right-click on it after moving the file over and give read & write permissions to the owner, which should have your username there.  You can change the permissions to the group and others sections if needed later, but that wasn’t necessary for me.

Once you’ve copied the disk image you need to create a new machine and register that hard disk with VirtualBox on the target host machine:

  1. From the VirtualBox window click the New button.  This will open the New Virtual Machine Wizard.
  2. VM Name and OS Type – Give it a name and pick the type & version of the virtual machine OS.
  3. Memory – Just leave it as the default.  You can change it later if you notice any problems.
  4. Virtual Hard Disk – This is where you select the hard disk you copied in to the home directory earlier.  So click on existing and when the Virtual Media Manager window comes up choose to Add.  It should take you to the correct folder so just select the image file and click open, then select.
  5. You’re done, it’ll take you back to the main window with the new virtual machine you just created based off the existing image file.

If you notice things running slowly you can shut down the machine, go to settings, and change the base memory allocation.  It’ll be screaming at you in red or orange text if you’ve allocated too much.

, ,

14 Comments

Resizing a VirtualBox virtual disk

I’m in the process of putting together a VirtualBox virtual machine for me and my co-workers to use so we can access our Outlook email accounts without rebooting into Windows and so that the web developers can test the pages they work on in IE.

Things were going well with VirtualBox until I realized I didn’t make the size of the disk large enough. I had it set at 5GB, thinking that’d be enough for what we need it for, but apparently not.  So I wanted to figure out how to resize the disk without having to go through creating an entirely new one and having to sit through the installation process all over again. I found this post in the VirtualBox forum about it and followed those directions and elaborating on them with some lovely screenshots.

  1. The first thing you want to do is create a new disk like you would if you were starting over.  File -> Virtual Media Manage -> under Hard Disks click new.  I’ll avoid explaining that process since I’m assuming you already know it if you’re looking to resize it.
  2. Download System Rescue CD.
  3. The next thing you want to do is set it so that the new disk you created is attached to your current virtual machine and change it so the System Rescue CD iso file is mounted.  See the screenshots below:
    settings-hd1
    For the CD click the little button next to the drop down list.
    settings-cd1
    Click the add button, and go to wherever you saved the .iso file.
    settings-cd2
    Press select and you’re done with this part.
    settings-cd3
  4. Now start the virtual machine and boot it to the CD you mounted.  You have to hit enter a couple times, but once you’re prompted type in startx and hit enter.
    startx
  5. When the terminal pops up type in gparted and hit enter.
  6. Right-click on your ntfs partition and click copy, then select the 2nd disk you created and paste over it.
    gparted 2nd HD
    paste old over new
  7. When it prompts you for the size of the disk make sure to pull the arrow all the way over to the right so that the free space following says zero and click paste.resize
  8. Once you tell it to apply the changes it will take awhile so I suggest getting up and going to do something else.  I left work and came back in today to finish this up.  I have no idea how long it took.
  9. When it is finished you need to tell it to use the new disk as the boot partition.  To do that right-click on it and go to manage flags and check the boot box then close it.
    gparted-flagsgparted-flags-boot
  10. Now all you have to do is close out gparted and shut down the virtual machine and change some of the settings from step 3.

After shutting it down what you want to do is go back to step 3 to make your larger HD the primary master, remove (and delete to get that hard drive space back) the old one, and change it back so that you are using the CD drive and not booting off the rescue CD anymore.  I wanted my space back since I wasn’t going to be using that smaller one.

, , ,

9 Comments