A method for VirtualBox of VDI files under Ubuntu

Source: Internet
Author: User
Tags uuid

I had a problem using VirtualBox, I copied a VDI file that was originally installed on the OS and used it as a system disk for the new virtual machine.

But when I add a new virtual disk through Virtual Disc Manager, VirtualBox prompts for this error message:

A hard disk with UUID {966f9f2d-f670-42ca-8ac1-245b3d424339} or with the same properties (' D:virtualboxvb_winxpwinxp.vdi ' ) is already registered.

The VirtualBox command is visible in detail: http://www.virtualbox.org/manual/UserManual.html

The solution to this problem:

1, can be for the existing. VDI to generate a new UUID, syntax is:

Vboxmanage Internalcommands Setvdiuuid already have. VDI

2. To replicate a VDI reuse, it must be implemented through the Vboxmanager command, the syntax is:

Vboxmanage Clonevdi already have. VDI new. VDI

3. Turn VDI into VMDK

Vboxmanage Clonehd has. VDI new. VMDK--format VMDK

4, Vboxmanage command has many enhancements, you can refer to Userguide.

View VDI file information Vboxmanage Showvdiinfo already have. VDI

Compressed VDI file Volume Vboxmanage Modifyhd the UUID of the VDI file or already has. VDI--compact

VirtualBox replication of VDI files and modification of VDI UUID

1. Copy vdi file: Vboxmanage Clonehd

Because VirtualBox does not allow the registration of duplicate UUID, each VDI file has a unique UUID. So if you want to copy a VDI file and register again in the VBox, a simple copy is not going to work. At this point we need to use the command Vboxmanage Clonehd, which sets a UUID for the new file when cloning the VDI file: To run this command, open the command prompt and go to the installation directory in virtual box. Examples are as follows:

The code is as follows:

D:program filesoraclevirtualbox>vboxmanage Clonehd "E:virtualboxubuntu 12.04Ubuntu 12.04.vdi" "E:virtualboxubuntu 12.04ubuntu_12.04.vdi "

The results are as follows:

0%.. 10%.. 20%.. 30%.. 40%.. 50%.. 60%.. 70%.. 80%.. 90%.. 100%

Clone hard disk created in format ' VDI '. Uuid:cf70d484-a3f0-4a87-953b-d1c8ec602c59

2, modify the VDI uuid:vboxmanage internalcommands sethduuid

When the same error occurs for two VDI uuid, you can use the command vboxmanage internalcommands sethduuid to modify the UUID for the VDI file, as follows:

The code is as follows:

D:program filesoraclevirtualbox>vboxmanage internalcommands Sethduuid e:virtualboxwin7_ultimate_sp1_1win7_ Ultimate_sp1.vdi

The results are as follows:

UUID changed to:3b5f507c-dda7-409c-a2ef-ee075435558d

However, when there are spaces in the path, double quotes are added to the path, as follows:

The code is as follows:

D:program filesoraclevirtualbox>vboxmanage internalcommands sethduuid "E:virtualboxubuntu 12.04.vdi"

The results are as follows:

UUID changed TO:04094FB4-0A42-413A-A25D-9D02D804BD2A

Note: When using the Vboxmanage command, you need to switch to the VirtualBox installation directory at the command line first.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.