Create virtual machine file from machine with raw disk access_

This is for discussing general topics about how to use VirtualBox.
Post Reply
ulfg
Posts: 3
Joined: 14. Oct 2018, 16:10

Create virtual machine file from machine with raw disk access_

Post by ulfg »

Hi!
I have a virtual machine that has been set up to use "raw hard disk access", as described for example
in chapter 9 of the VirtualBox manual.

This virtual machine is using the linux partitions on a dual boot machine that can run both Win10 and linux. The
virtual linux machine can be run in the Win10 part of this dual boot machine.
Now I would like to be able to export this virtual machine to a file that would contain the entire disk data that is in use
in the virtual machine. This file I would then like to be able to move to another host where the physical linux partition is not present
and run it as a virtual machine there. In practice this would be a way of virtualizing the linux partitions of the original host machine.
Can this be done, and if so how?

Regards
Ulf
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: Create virtual machine file from machine with raw disk access_

Post by socratis »

ulfg wrote:Can this be done, and if so how?
No.

The best thing that you could do is to create a VM from your Linux disk and have that as a different VM. Search for Physical-to-Virtual, or P2V. Simplest, easiest, the script writes practically itself. Why are you trying to make your life difficult? ;)
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.
ulfg
Posts: 3
Joined: 14. Oct 2018, 16:10

Re: Create virtual machine file from machine with raw disk access_

Post by ulfg »

Thank you for very much your answer.
However, I have not been able to find any tool that does what you suggest. The VMWare converter, for example,
can not do this conversion from physical to virtual machine in a standalone home environment. It requires the presence of some kind of VMWare deployment server.
What also should be noted here is that my physical Linux machine does not have a disk of its own, it lives in a partition on a Windows machine disk.
The typical solution for virtualizing a linux machine that is suggested on the net is to use a lowlevel disk copying tool to create a raw disk file, and then
convert this file to a VHD or VMDK file. At least on my level of knowledge this is not so easy since my physical linux machine is on a partition, not a whole disk, and
to be bootable the virtual machine file would need both the root partition and the boot partition, but obviuosly I do not wish to have the Windows partitions
included in the virtual machine. So if you can suggest a specific tool or method that does what you suggest in this case, I would very much appreciate if you could point me
to it.

Regards
Ulf
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: Create virtual machine file from machine with raw disk access_

Post by socratis »

I don't have a specific tool in mind, but I'm trying to think outside the box...

What exactly do you have in your Linux partition that you couldn't use a backup/restore procedure? Anything not reproducible easily except your files? Just backup your files, and restore them in a brand new Linux VM. Done.
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.
ulfg
Posts: 3
Joined: 14. Oct 2018, 16:10

Re: Create virtual machine file from machine with raw disk access_

Post by ulfg »

Well, what I have is a lot of specially installed software, compiled from source, with a bunch of special configurations and bugfixes applied, that took me many hours to figure out. And I did it a year ago, so I don't remember even 10 % of it..
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: Create virtual machine file from machine with raw disk access_

Post by socratis »

Then start looking at a complete backup/restore procedure. Clonezilla comes to mind, not sure it can do exactly what you want.
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.
Post Reply