Page 1 of 2
Copy Windows 10 VM to physical hard disk
Posted: 4. Sep 2020, 00:13
by spiri
Hello,
I have some troubles installing a Windows 10 system on my hard disk because of scary error messages after the partitioning setup.
Code: Select all
windows detected that the EFI system partition was formatted as ntfs. format the efi system partition as fat32 and restart the installation.
I selected the first unallocated space of my first hard disk (SSD). I splitted my SSD in two parts, one time for Windows 10, and the other part for my Linux.
The ISO image is too big to burn it on a DVD/RW and I don't have a double-layered disk.
This means I burned the Windows Image on my Arch Linux machine with windows2usb (available on AUR) to my external SSD.
Also I'm not sure if the error messages disappear with a double-layered disk, because I did some noise in my UEFI BIOS and I regenerated some firmware keys which leads me to invalid firmware I guess.
So there is my question if this works well, when I create a Windows 10 VM, create a file in RAW format and write it from linux live system with dd on my hard disk? Because creating Windows 10 VM's is working for me.
Do you have any further suggestions to me?
--- after further testing ---
I created a 50GB VM in VirtualBox and exported to RAW image file. Then I started it with qemu. Windows booted to recovery mode and I selected Exit recovery mode and boot to Windows 10.
It worked but the VM seems to be very slow. Maybe the wrong options in my qemu command?
Code: Select all
qemu-system-x86_64 -hda windows_10.raw -m 4G -smp 2
I'm using two cores because on my host I have 4 hyper-threaded cores.
Do you know if it works copying a RAW Windows 10 VM created with VirtualBox to physical disk on bare metal?
Re: Copy Windows 10 VM to physical hard disk
Posted: 4. Sep 2020, 01:09
by scottgus1
We don't support Qemu here, so you'd need to ask them about the Qemu question.
You're trying to do a V2P, which is really a P2V, for Physical To Virtual, backwards). With an existing Linux OS that will be more complicated. And I don't think just 'dd'ing the Windows 10 guest disk to the physical disk will work. Windows itself has three partitions, and you'll need to integrate Windows into Linux's booster.
For your project to have dual-boot Linux/Windows on the physical PC, I think you need to forget about using Virtualbox as an intermediary step and get on your Linux distro's forum asking them how to add Windows in a dual-boot.
And if you care a lot about that Linux install, take disk image backups and practice restoring them first.
Re: Copy Windows 10 VM to physical hard disk
Posted: 4. Sep 2020, 10:24
by mpack
DDing a Windows 10 disk image to another PC should work just fine (once you get past the inevitable crashes), but that doesn't seem to be what's being discussed. It seems like the OP is trying to blit a disk image onto a partition, and that certainly won't work. You would have to move only the partition, and then apply expert knowledge to fix up the partition map and boot manager. Unfortunately EFI makes this much more complicated than it used to be... and so do boot managers for that matter.
Re: Copy Windows 10 VM to physical hard disk
Posted: 4. Sep 2020, 12:42
by spiri
Ok thank you for the replies so far.
Yes, I mean to create a RAW image with VBoxManage and dd'ing the entire disk on the first sector of my hard disk. Would look like this:
Code: Select all
dd if=windows_10.img of=/dev/sda status=progress bs=4M
So if I copy the entire image at the beginning of my hard disk, this should work fine?
Because the size of my VM is 50GB and the size of my disk is 500GB.
Would I need to fix the partition map and boot manager then?
Re: Copy Windows 10 VM to physical hard disk
Posted: 4. Sep 2020, 15:27
by spiri
So if I understand this completely right, you can definitely do V2P you just have to convert the VDI to RAW and dd the RAW image with boot sector and all of its partitions to /dev/sda?
I'm sorry I'm showing you a line of qemu but I actually need this to test if it works on a different architecture. Afterwards I want to cross-install Arch Linux so I have a multiboot.
Does V2P offers any disadvantages over installing the software directly on bare metal?
I would really appreciate any further help because I don't want to make errors when I work with dd on my physical disk.
Re: Copy Windows 10 VM to physical hard disk
Posted: 4. Sep 2020, 15:45
by mpack
I wouldn't wish dd and raw images on my worst enemy. Use the free version of Macrium Reflect, run it inside the VM to image the Win10 disk, create a rescue CD or USB to use on the physical PC for restoration.
Re: Copy Windows 10 VM to physical hard disk
Posted: 4. Sep 2020, 23:34
by spiri
Ok. Why would dd not be an option for this?
Re: Copy Windows 10 VM to physical hard disk
Posted: 5. Sep 2020, 09:16
by mpack
I did not say dd wasn't an option, I said I would not wish that option on my worst enemy. It will take 10 times as long, create huge files, require intermediate manual processing (i.e. by you) to make it work at all.
Use a tool (e.g. Macrium Reflect Free Edition) that's made to do one job well, not several jobs badly.
Re: Copy Windows 10 VM to physical hard disk
Posted: 5. Sep 2020, 23:51
by spiri
Macrium Reflect is not the software I need, I could just make a system image backup and restore it from the windows recovery option.
But I do not have such a double-layered disk, where I can save more than 4GB of data.
Re: Copy Windows 10 VM to physical hard disk
Posted: 6. Sep 2020, 08:39
by mpack
In that case you can forget the whole thing, because all options involve converting the VDI to a new file that's a restorable backup image. The difference is that Macrium Reflect files are smaller (they do smart backups plus compress the output), plus they will automatically convert between imcompatible hosts during the restore, e.g. reduce or expand partitions to fit the new host hard disk, convert between MBR and GPT partitioning etc.
But sure, if you think you can do it with dd raw images or System Backup then hey, good for you - go for it! You're the expert after all.
Re: Copy Windows 10 VM to physical hard disk
Posted: 6. Sep 2020, 14:40
by spiri
Unfortunately, redeploying a rescue image to new hardware is not part of the Macrium Reflect Free Edition.
EDIT: I will look for a trial version because the rescue image is only a half GB big, I could burn this to disk.
Re: Copy Windows 10 VM to physical hard disk
Posted: 6. Sep 2020, 15:22
by spiri
Also redeploying a rescue image with a 30 days Trial version is not possible.
Re: Copy Windows 10 VM to physical hard disk
Posted: 7. Sep 2020, 11:59
by mpack
You don't need the Redeploy feature.
Also, you want the free version, not a trial version.
Seriously, do you believe I told you about Macrium Free without ever having tried it myself? I use it all the time, I know for certain that it works for P2P, P2V and V2P. Stop making life difficult for yourself, just get it done.
Re: Copy Windows 10 VM to physical hard disk
Posted: 7. Sep 2020, 12:43
by spiri
Well, I did not found any other option to create a bootable file.
Re: Copy Windows 10 VM to physical hard disk
Posted: 7. Sep 2020, 15:24
by scottgus1
Macrium Reflect runs inside the running OS, whether in guest or physical PC.
Reflect can make a disk image file of an existing computer saved to an external drive. This external drive does not have to be a burned DVD, it can and very often is another disk drive. Then you attach the disk drive to the other computer, physical or virtual, boot the computer with Macrium's boot ISO or CD, and copy the image onto the computer's hard drive.
However, Spiri, I think we need to have a "can't see the forest for the trees" session, or as Stack Exchange calls it, a "frame challenge".
You want to have Windows 10 dual-boot with your existing Arch Linux on your computer. You have installed Windows 10 in a VM and are spending a lot of time trying to get the VM's OS onto your computer's drive for the dual-boot.
Why not forget about the VM and just research and ask from Arch Linux's instructions and forums how to install Windows 10 as a dual-boot with existing Linux? Someone else has done this before, for sure. There is nothing new under the sun.