LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 12-12-2018, 03:40 PM   #1
Ubuntero
LQ Newbie
 
Registered: Dec 2018
Posts: 4

Rep: Reputation: Disabled
Use VDI image generated by QEMU in VirtualBox?


Looking for some different method to be able to copy an entire partition and convert it to a VDI virtual disk, I found the following command:

Quote:
qemu-img -O vdi /dev/sdX /path/image.vdi
VDI is a native format of VirtualBox, could it present some differences in the format when creating the VDI virtual disk in this way compared to creating it in VirtualBox?

Have you tried how this works? Copy sector by sector or only sectors in use?
 
Old 12-12-2018, 04:05 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,008

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
There will be no guarantee that a third party program will create a .vdi but it is easy enough to try. I've used it before and generally works. There used to be a few web sites that could create any sort of virtual hard drive file you wanted too.

This is all different than copying. If you have a current .vdi then just copy it. It is a file. There is no real need that I know of to go in and use dd or other tool in this case. If you wish to change format then you might try taking a copy of the file and qemu convert it.

To clone sector by sector it is best that the specifications of the disk be exact. I suppose one could fool with the two formats to try to make a clone of it in different format.

There are better clone operations than sector by sector I'd think for most OS's.

Last edited by jefro; 12-12-2018 at 04:13 PM.
 
Old 12-12-2018, 04:33 PM   #3
Ubuntero
LQ Newbie
 
Registered: Dec 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
There will be no guarantee that a third party program will create a .vdi but it is easy enough to try. I've used it before and generally works. There used to be a few web sites that could create any sort of virtual hard drive file you wanted too.

This is all different than copying. If you have a current .vdi then just copy it. It is a file. There is no real need that I know of to go in and use dd or other tool in this case. If you wish to change format then you might try taking a copy of the file and qemu convert it.

To clone sector by sector it is best that the specifications of the disk be exact. I suppose one could fool with the two formats to try to make a clone of it in different format.

There are better clone operations than sector by sector I'd think for most OS's.
Thanks for answering!

I have not yet tested the execution of this command because I want to make the best decision.

I do not have the VDI file yet. It's exactly what I'm looking for, from the partition or disk, to create a VDI file; I need both modes, sector by sector and only sectors in use.

In the case of sector by sector, I need this to be able to do some tests of information retrieval and forensic investigation (that's why you should not change the content of any sector when going to VDI).

In the VirtualBox forum I have been advised to use a backup tool instead of the VBoxManage command. The problem with this is that I will need twice the total size of the disk since I have to make a copy and then a restoration inside VirtualBox.

With the command published here, if it works correctly, you do not need two copies and therefore less time lost.
 
Old 12-12-2018, 04:57 PM   #4
Ubuntero
LQ Newbie
 
Registered: Dec 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
I do not know if this is a good option. In the qemu documentation I found this about the files created by qemu (VDI): VirtualBox 1.1 compatible image format.
 
Old 12-13-2018, 04:28 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,008

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
I see you have many choices to make.
 
  


Reply

Tags
clone, qemu, virtual box, virtualbox



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Mounting a VirtualBox drive image (vdi) without specifying a loop device frikdt Linux - Virtualization and Cloud 2 02-03-2013 11:34 AM
Install GRUB2 to a virtualbox vdi image kara85 Linux - Newbie 3 07-19-2012 04:17 AM
LXer: How to mount VirtualBox drive image (vdi) in Ubuntu 12.10/12.04 LXer Syndicated Linux News 0 07-13-2012 05:51 PM
VirtualBox virtual disk image backup? .vdi .sav brianpbarnes Linux - Software 3 07-17-2009 02:12 PM
Migrating a VirtualBox .vdi Image to CoLinux MetalSubstance Linux - Software 2 02-25-2008 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration