Clone existing Windows and use in VirtualBox

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
Rich2020
Posts: 8
Joined: 22. Sep 2016, 23:08

Clone existing Windows and use in VirtualBox

Post by Rich2020 »

Hi all,

I'm really not sure of the terminology here, so please bare with me.

Basically, I have Windows running on my machine. I want to save my Windows to an image, and then load it into virtual box. I do not want to have to re-install any application or copy my data over - I want a complete copy of my Windows and I want to load it and use it in VirtualBox which will be running on another machine (a Macbook, in fact).

Is this possible?

Thanks
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Clone existing Windows and use in VirtualBox

Post by socratis »

Yes, it can be done.
- Search for Disk2VHD, a Microsoft tool to save your physical disk in the VHD format.
- Install VirtualBox in your MBP.
- Convert the VHD to VDI which is native to VirtualBox. See 8.24. VBoxManage clonemedium.
- Create a new VM as close to the original as possible. When prompted for a disk, choose the VDI you just created.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Rich2020
Posts: 8
Joined: 22. Sep 2016, 23:08

Re: Clone existing Windows and use in VirtualBox

Post by Rich2020 »

socratis wrote:Yes, it can be done.
That was fast! Thank you so much!
Rich2020
Posts: 8
Joined: 22. Sep 2016, 23:08

Re: Clone existing Windows and use in VirtualBox

Post by Rich2020 »

socratis wrote: - Create a new VM as close to the original as possible. When prompted for a disk, choose the VDI you just created.

Oh, sorry, I just read this correctly. What does "as close to the original as possible" mean?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Clone existing Windows and use in VirtualBox

Post by socratis »

Memory-wise it would be good to have pretty much the same amount, but it's not crucial. The CPU you can't change, it is what it is. The most important part is to get the HD interface and controller. That is, if your physical system had IDE, configure the VM with IDE. If it had SATA and it matches, use that one, otherwise you can always fall back to IDE (I think).
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Rich2020
Posts: 8
Joined: 22. Sep 2016, 23:08

Re: Clone existing Windows and use in VirtualBox

Post by Rich2020 »

Riiiiight, got you. Thanks! I was worried that you had meant that the new VM might be different in that some things will not work (programs, etc).

Thanks again!
Rich2020
Posts: 8
Joined: 22. Sep 2016, 23:08

Re: Clone existing Windows and use in VirtualBox

Post by Rich2020 »

Hi, I did as suggested, but when I start my VM called "Clone", I get a message telling me that no bootable medium can be found. I then went to the settings of the VM/Storage and added an optical drive with a Windows 10 x64 ISO. The VM then starts, but it wants me to install Windows. I don't understand why it wants that as I was expecting my VM to boot up and be exactly the same as my current system (from which the clone was created using the tools described above).

I also tried changing the boot order so that the HD boots first, but it just says "cannot read from the boot medium! System halted"
Any ideas?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Clone existing Windows and use in VirtualBox

Post by mpack »

Take another look at Disk2VHD, and this time make sure to image the entire drive (i.e. including the boot sectors), and not just the primary partition.

Also, the VHD must be mounted in the VM before you start the VM - please describe how you did this.

Unmount the CD media from the VM - that can only be a confusing irrelevance.
Rich2020
Posts: 8
Joined: 22. Sep 2016, 23:08

Re: Clone existing Windows and use in VirtualBox

Post by Rich2020 »

Hi,

I did image everything and I tried to insert an image.... but I cannot. So, here is the broken link:
postimg dot org/image/uhe23vzy5/

Please insert the h t t p bit and replace dot with a .

I mounted the VHD by selecting "use an existing virtual hard disk file", when creating a new VM. I selected Windows 10 64 bit, just as my OS is now and assigned 10 of my 16GB RAM (I tried with lower values, too).
I unmounted the CD media from the VM as well as the floppy disk, so that only my mounted VHD remained. I tried various combinations, too, adding CD media, changing boot orders, etc.
Attachments
Capture.png
Capture.png (18.06 KiB) Viewed 40730 times
Last edited by mpack on 23. Sep 2016, 17:24, edited 1 time in total.
Reason: Add local attachment.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Clone existing Windows and use in VirtualBox

Post by mpack »

If you have the disk attached to the VM, and if VirtualBox tells you that the disk isn't bootable, then it isn't bootable. I don't know what to tell you other than that: I'm not there to debug your procedure.

Even as a new user you can attach images locally - there is not need for you to provide offsite URLs, obfuscated or not.

What is the guest OS? I mean of course a precise version, not just "Windows".
Rich2020
Posts: 8
Joined: 22. Sep 2016, 23:08

Re: Clone existing Windows and use in VirtualBox

Post by Rich2020 »

Oh right, I did not see the upload attachment option hiding at the bottom (I was looking at the BBCode options). I've attached it now.

I'm not sure what a guest OS is, but as I've mentioned, I've selected Windows 10 64-bit from the dropdown when I created a new VM. My current system, the one on which I am running Virtual box is also Windows 10 64 bit.

Does that help?
Attachments
Capture.PNG
Capture.PNG (18.06 KiB) Viewed 40730 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Clone existing Windows and use in VirtualBox

Post by mpack »

If the original Win10 system uses an EFI BIOS then it probably can't be virtualized as a VirtualBox VM. You haven't given me anything to prove that EFI is involved, but if it's a new laptop (i.e. that shipped with Win10) then it's quite possible or even likely.

In any case were you intending to stop using it on the laptop? Otherwise you wouldn't be able to activate it, even if you got it to boot.

Oh wait... the original host was OS X with Bootcamp? In that case it's definitely EFI, and it isn't a normal PC boot, it's a secondary boot in a dual boot host. I'd think that was hard to virtualize, but I'll leave the final word on that for Apple owners. The activation comment still applies.
Rich2020
Posts: 8
Joined: 22. Sep 2016, 23:08

Re: Clone existing Windows and use in VirtualBox

Post by Rich2020 »

Yes, it is a MBP laptop that I have. I'd like to move my entire windows file system into a VM, onto an external HD. I then want to delete my bootcamp partition and use regular OS X, running Virtual box with my Windows VHD mounted.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Clone existing Windows and use in VirtualBox

Post by socratis »

It took you 8 posts to state the problem correctly? That should have been your first post! This is not your typical "Windows" computer. It's a dual boot EFI-to-BIOS to who knows what. Although the procedure we described actually works. See: viewtopic.php?f=8&t=51608 so, you something is not working in your case.

Another procedure that you can try is described in: http://c-notes.net/2014/11/converting-a ... irtualbox/ although I can't say that I have seen anyone else try it. It converts the raw VMDK that you assign to the Bootcamp partition [1], in a VDI [2]. In theory it could work, but I don't know what happens with the bootloader. The blogger seems to be happy with it.

[1]: sudo vboxmanage internalcommands createrawvmdk -filename windows.vmdk -rawdisk /dev/disk3 -partitions 2
[2]: sudo vboxmanage clonehd windows.vmdk windows.vdi --format VDI
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Clone existing Windows and use in VirtualBox

Post by mpack »

I'll move this to "OS X Hosts" since it clearly isn't a generic "Using VirtualBox" discussion.
Post Reply