Physical to Virtual Convertor with broad support for source physical machines

Discussions related to using VirtualBox on Linux hosts.
Post Reply
vbox_lover
Posts: 6
Joined: 18. Sep 2019, 13:42
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Centos 7

Physical to Virtual Convertor with broad support for source physical machines

Post by vbox_lover »

Is there any tool to convert physical servers to virtual, something similar to VMware vCenter Converter,with broad support for source physical machines like Ubuntu, Centos, Redhat, Windows 7, Windows 8.

I started using Virtualbox recently, truly its simple and easy, if someone can guide me how physical Linux machine can be moved to Virtualbox without data loss and downtime, will be very useful, for windows machine from google I found ( disk2vhd , there may be better tool than this. )
multiOS
Volunteer
Posts: 1223
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux, BSD
Location: United Kingdom

Re: Physical to Virtual Convertor with broad support for source physical machines

Post by multiOS »

You could add CloneVDI to your list. - viewtopic.php?t=22422

If you download the app and read the release notes.text file you will find instructions for P2V. It's a Windows app, but runs well under WINE on both Linux and MacOS.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Physical to Virtual Convertor with broad support for source physical machines

Post by mpack »

CloneVDI probably can't be used for P2V on a Linux host, unless Wine somehow makes the "\\.\PhysicalDriveN" Windows drive naming scheme work on Linux. CloneVDI will not recognize Linux disk device names.

You probably need to use a Linux specific imaging tool. The only one I know of (but have not used) is CloneZilla, which used to be just a wrapper around dd, I don't know if it's any less dumb now. Support for physical machines shouldn't be a big problem. You can always boot from a live CD if CloneZilla was to be unavailable for some reason.
vbox_lover
Posts: 6
Joined: 18. Sep 2019, 13:42
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Centos 7

Re: Physical to Virtual Convertor with broad support for source physical machines

Post by vbox_lover »

Thanks for the clarification, but I am trying to find solution without downtime, I already attempted creating same OS on virtualbox, and then using rsync of physical server like below, but this method isn't robust solution, regarding dd I read few articles, it doesn't seem reliable.

From local to Virtualbox OS

Code: Select all

rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} root@192.168.3.67:/
Last edited by socratis on 18. Sep 2019, 20:10, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Physical to Virtual Convertor with broad support for source physical machines

Post by mpack »

dd ought to be reliable, it's too simple/dumb to have bugs. All it does it copy sectors, if that doesn't work then the OS can't be working either!

By dumb I mean that it will have no smarts whatever. It will have no ability to make or restore a sparse image of a drive, or to adjust for drive size mismatches, or sector size mismatches, or EFI vs MBR BIOS mismatches.
vbox_lover
Posts: 6
Joined: 18. Sep 2019, 13:42
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Centos 7

Re: Physical to Virtual Convertor with broad support for source physical machines

Post by vbox_lover »

Consider

Code: Select all

/dev/sda   - will be OS 
/dev/sdb   - say other data in 2nd drive
then

Do you mean to say just below is enough ?, any block size you recommend ?

Code: Select all

dd if=/dev/sda of=/mnt/external_disk/mydisk.vhd
Last edited by socratis on 18. Sep 2019, 20:11, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Physical to Virtual Convertor with broad support for source physical machines

Post by fth0 »

mpack wrote:It will have no ability to make or restore a sparse image of a drive
Regarding dd (and therefore Clonezilla), it's not as simple/dumb as you think: Try 'dd if=/dev/zero of=test1G bs=1G count=1 conv=sparse' on a Linux shell and check the result with 'du -h test1G'. ;)

PS: In fact, dd originally was written to convert and copy files, and one of its original tasks was to convert files between ASCII and EBCDIC.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Physical to Virtual Convertor with broad support for source physical machines

Post by mpack »

Really?? All dd output files I've ever seen have been raw. OTOH all useful sparse formats would need a header, which implies functionality way beyond what I thought dd had. Checking ...

Hold up. I just looked up the command definition, and the dd version of "sparse" doesn't do anything that requires smarts. It just skips zero blocks. What use is that? What I meant by a sparse backup is one that automatically eliminates all unnecessary data from the backup: zero sectors, no longer used sectors, swap partitions et al.
vbox_lover
Posts: 6
Joined: 18. Sep 2019, 13:42
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Centos 7

Re: Physical to Virtual Convertor with broad support for source physical machines

Post by vbox_lover »

I found interesting p2v tool from oracle, haven’t tested yet, this weekend will be testing it
https://docs.oracle.com/cd/E20065_01/do ... 9/ptov.htm
I don’t know how this works, here is scenario my current hard disk is 300GB SAS, which is nearly 95% full, in such cases where p2v tool will store iso image before serving via apache server.

does it serve iso image as binary stream while downloading by client ?
Or do I have to attach extra storage for temporary storage.

I see few moderators here are from oracle, hope one of you clarify my doubt.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Physical to Virtual Convertor with broad support for source physical machines

Post by fth0 »

mpack wrote:Really??
The origins of dd are from a time when we both were quite young. ;) Tape backups were prohibitively expensive then. Admins didn't like GUIs and used X11 mainly (if at all) to open multiple xterms for shells, in which they used the (over 100) common command line tools like ls, dd and tar.
mpack wrote:the dd version of "sparse" doesn't do anything that requires smarts. It just skips zero blocks. What use is that?
It's kind of comparable to the standalone usefulness of the VirtualBox VDI compact functionality. But with dd the admin could solve the problem from your question itself by creating the zero blocks beforehand with 'dd if=/dev/zero of=emptyspace bs=1G || rm emptyspace'.
Post Reply