[GRLUG] VirtualBox question

Bill Littlejohn billl at mtd-inc.com
Fri Feb 27 10:57:48 EST 2009


On Fri, Feb 27, 2009 at 10:18 AM, John-Thomas Richards <jtr at jrichards.org>wrote:

> On Fri, Feb 27, 2009 at 10:06:27AM -0500, Bill Littlejohn wrote:
> > On Fri, Feb 27, 2009 at 8:58 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?
> > > >
> > > > 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
> > >
> > > My drive is partitioned thusly:
> > >
> > > /dev/sda1       /media/restore_partition
> > > /dev/sda2       swap
> > > /dev/sda3       /
> > > /dev/sda4       /home
> > >
> > > Is booting from a live CD necessary?
> > > --
> > > john-thomas
> > >
> >
> > No, booting from a live cd isn't necessary. That's just a simple way to
> get
> > the bootloader and the restore partition onto the second drive without
> > worrying too much about partition tables and boot loaders.
> > When I did this, I setup the disk more or less how I thought the restore
> > expected the disk to look like.
> > I copied the bootloader and the restore partition to the target drive,
> and
> > had a a second partition there just so the number of partitions was
> right.
> > The restore isn't likely to ask anything and will put everything on the
> > second partition. That worked out fine in my case.
> > Can you tell me how big those partitions are, how much space is
> available,
> > and where you want to put your new VM?
> > Bill
>
> me at rondo:~$ df -h
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/sda3              28G  9.8G   17G  38% /
> /dev/sda4             108G   65G   38G  64% /home
>
> The VM would go into /home/me.
>
> Would it work to make an .iso out of the partition?  I can install from
> an .iso in VB.
> --
> john-thomas
> ------
> As a well spent day brings happy sleep, so life well used brings happy
> death.
> Leonardo da Vinci (1452-1519)
> _______________________________________________
> grlug mailing list
> grlug at grlug.org
> http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
>

I have no idea about the ISO, I would not think that would work.
Virtualbox can boot a raw partition, so it's possible to do something like
this
http://mesbalivernes.blogspot.com/2008/01/virtual-box-booting-from-existing.html
but that kind of thing seems kludgy and dangerous to me.
What you really need to do is get the restore partition and bootloader on to
a second drive, be it virtual or physical, and boot that in the VM. 38GB of
free space doesn't leave much room for playing around though.
If you have a spare drive large enough to copy your existing drive into,
then you can attach that to the VM and boot the VM using a live CD ISO,
repartition the drive to turn sda2,sda3,sda4 into one ntfs partition, reboot
the VM without the live cd and run the restore, then when it's all done and
youv'e successfully booted the restored OS, shrink the OS partition as small
as practical (and obviously somewhat <38GB).
After all that you'll have a working VM, and all you have to do is convert
the physical drive into a virtual one and change the VM config to use the
new virtual disk.
I may be wrong, but other methods seems to get rather complicated rather
quickly.
This of course all hinges on having another 130GB+ drive laying around.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shinobu.grlug.org/pipermail/grlug/attachments/20090227/87ef01cc/attachment.htm 


More information about the grlug mailing list