[GRLUG] VirtualBox question

Bill Littlejohn billl at mtd-inc.com
Thu Mar 5 11:05:37 EST 2009


On Thu, Mar 5, 2009 at 8:14 AM, John-Thomas Richards <jtr at jrichards.org>wrote:

> On Thu, Feb 26, 2009 at 02:43:11PM -0500, Bill Littlejohn wrote:
> > On Thu, Feb 26, 2009 at 2:30 PM, John-Thomas Richards <jtr at jrichards.org
> >wrote:
> >
> > > My laptop came with a restore partition for another OS.  I would like
> to
> > > install this operating system in a virtual machine with VirtualBox.  My
> > > Google-fu is failing me because all I can find is references to
> > > installing a virtual machine *into* a physical partition, not
> installing
> > > a virtual machine *from* a physical partition.  Anyone here have a clue
> > > if this is possible?
> > > --
> > > john-thomas
> >
> > Sure - just copy the partition to a different drive.
> > There are a couple of ways I can think of.
> > What I would do requires an external USB hard drive of equivalent (or
> > larger) capacity to your laptop hard drive.
> > Boot from a live-cd, then dd your laptop drive to the USB drive. This
> will
> > overwrite anything on the USB drive with the copy.
> > Setup your VM and connect the USB drive to it. You should be able to boot
> > the restore partition from there.
> > I assume the drivers would be somewhat borked since it's likely preloaded
> > with your laptop hardware drivers. You'll want to install the virtual
> > hardware drivers as soon as possible to straighten things out.
> > Bill
>
> Here is what I have done so far.  I created a 30GB virtual disk (should
> be more than enough for what I need; once this is up and running I can
> delete another sizable virtual disk that I will no longer need, thus
> freeing up more disk space).  I then booted into that virtual machine
> with a Knoppix iso and created two partitions; one 10GB partition to
> hold the restore files and one 20GB partition to hold the operating
> system and applications.  I was able to format both partitions with
> NTFS.  I downloaded a Vista Recovery Disk iso that boots to install from
> the restore partition.  It works up to the point it looks for the
> recovery files on the recovery partition.  The problem is it cannot find
> the files on the restore partition since they are not there yet.  For
> the life of me I cannot figure out this shared folders thing with a
> Linux host and a Linux guest (since I need to copy the files first).
> The VirtualBox user manual is not very helpful on this point.
> --
> john-thomas
> ------
> I may disagree with what you have to say, but I shall defend, to the
> death, your right to say it.
> Voltaire (1694-1778)
> _______________________________________________
> grlug mailing list
> grlug at grlug.org
> http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
>

I haven't used the shared folders feature, but certainly you would have to
install the V.B. tools into the running livecd environment for it to work. I
used an external USB drive instead.
You can't access your system /dev/sda1 partition directly from the VM,
because your running your system off that disk - thus the need to make a
copy of the partition.
Assuming you have an external drive with enough free space attached as
/dev/sdb, you could do
"dd if=/dev/sda1 of=/dev/sdb1/restore.img"
If you wanted to write the image to your home folder and then get folder
sharing working, then you could do
"dd if=/dev/sda1 of=/home/me/restore.img"
After you have the image file, and can access it from the VM, then just do
the reverse _in the VM_ to write it to the virtual disk partition. i.e. "dd
if=/dev/sdb1/restore.img of=/dev/sda1"
Be sure you understand where dd is reading and writing before executing the
commands - it can hose your system quickly if you reverse the commands. "man
dd"
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shinobu.grlug.org/pipermail/grlug/attachments/20090305/319076ca/attachment-0001.htm 


More information about the grlug mailing list