Convert VirtualBox fixed disk to dynamic disk and vice versa

WBOY
Release: 2024-03-25 09:36:42
forward
827 people have browsed it

When creating a virtual machine, you will be asked to select a disk type. You can choose fixed disk or dynamic disk. What if you choose fixed disks and later realize you need dynamic disks, or vice versa? Good! You can convert one to the other. In this post, we will see how to convert VirtualBox fixed disk to dynamic disk and vice versa.

Convert VirtualBox fixed disk to dynamic disk and vice versa

A dynamic disk is a virtual hard disk that initially has a small size and grows in size as you store data in the virtual machine. Dynamic disks are very efficient at saving storage space because they only take up as much host storage space as needed. However, as disk capacity expands, your computer's performance may be slightly affected.

Fixed disks and dynamic disks are commonly used storage types in virtual machines. Fixed disks have a fixed size and do not support dynamic expansion, but they are better than dynamic disks in terms of performance because no additional resources are required to resize the disk. However, as usage increases, fixed disks may run out of storage space.

How to convert VirtualBox fixed disk to dynamic disk and vice versa?

If you want to convert VirtualBox fixed disk to dynamic disk or vice versa, please follow the steps below to solve the problem.

  • Make sure you have enough space
  • Change the storage format of the virtual disk
  • Delete the renamed VDI and add a new VDI
  • Let’s talk about it in detail.

    Make sure you have enough space

    Before performing a storage type conversion, be sure to check and confirm that your drive has enough free space to accommodate a separate disk image. For example, if the virtual disk you plan to convert is 70GB in size, you will need at least 70GB of free disk space to perform the conversion operation. This is because the conversion process requires the creation of a new disk image file, which will be the same size as the original virtual disk. It is very important to ensure that you have enough space to avoid running out of space issues during the conversion process, preventing the operation from completing successfully. because

    After the conversion is complete, if everything goes well, you can delete the original virtual disk file to free up disk space, but please make sure there is enough space initially.

    To check the size of a disk, in VirtualBox, right-click the disk, select Settings > Storage, click on your VDI, and check the virtual size of the file. If you have enough space, go ahead and convert. If you don't have enough space, make some and then move on to the next step.

    Read: How to improve the running speed of VirtualBox virtual machine

    Modify the storage format of the virtual disk

    Convert VirtualBox fixed disk to dynamic disk and vice versa

    Before changing the format, please shut down the running virtual machine. Once done, follow the steps mentioned below.

    • Open Command Prompt by searching in the Start menu.
    • Now, enter the following command to reach the default installation location of VirtualBox application, if you have given a custom location, make necessary changes in the command given below.
    cd "C:Program FilesOracleVirtualBox"
    Copy after login
    • Now we need to list all the vm to get their location, for this you have to run the following command.
    VBoxManage.exe列出硬盘
    Copy after login
    • You need to copy the location of the VDI and insert it into the following command to change its format.

    Convert from fixed to dynamic

    “VBoxManage.exe clonmedium disk”源代码。vdi”目的地。vdi" -变体标准
    Copy after login

    Convert from dynamic to fixed

    “VBoxManage.exe clonmedium disk”源代码。vdi”目的地。修复
    Copy after login

    If you can't run the command and it says there is a syntax error, just write ' -variant ' manually and rerun it. Also, if you don't want to go to the trouble of reconfiguring the VDI like I did, make sure the source and destination are in exactly the same location but with different filenames.

    Now, we need to reshuffle the cards. To do this, go to the location of the VDI, change the name of the source file to something else, and then rename the destination to match the name of the original file.

    Read:VirtualBox displays black screen instead of booting guest OS

    3] Delete the renamed VDI and add a new VDI

    Convert VirtualBox fixed disk to dynamic disk and vice versa

    Now we don't need the old VDI anymore, we can delete it and add the new VDI. Follow the steps mentioned below to remove the inaccessible VDI image.

  • Start Oracle VirtualBox.
  • Go to File > Tools > Virtual Media Manager.
  • Click Refresh.
  • Select the VDI in question and click Release.
  • Now, click Remove.
  • If there are multiple inaccessible VDIs, make sure to delete them all.
  • Perform the steps given below to add a new VDI image.

  • Select the virtual machine and click Settings.
  • Now, go to Storage and click on the second plus sign ( ) icon next to "Controller:IDE".
  • Click Add, go to the location where the file is stored, and add it.
  • After adding the VDI to the Hard Disk Select utility, select the VDI from the Not Attached section and click Choose.
  • Finally, click OK
  • That's it! Start VDI when changing storage format.

    Read: How to enable drag-and-drop support in VirtualBox?

    Which is better, dynamic allocation or fixed-size VirtualBox?

    The main difference between dynamic allocation and fixed size is that fixed size allocates all space to the drive at once, while dynamic allocation only takes up space when the VM needs it. So if your VM doesn't use all the hard drive size, the dynamic allocation won't take up all the space, but the fixed size will take up all the space. In other words, dynamic allocation grows as the VM grows, while fixed size takes up all the space at once. However, when it comes to performance, fixed is better.

    Read:VirtualBox cannot connect USB device to virtual machine

    How to convert fixed disk and dynamic disk in VirtualBox?

    To convert from fixed to dynamic, use the
    "VBoxManage.exe clonmedium disk" source code. vdi "destination.vdi" - variant standard,
    However, to convert from dynamic to fixed, use the
    "VBoxManage.exe clonmedium disk" source code. vdi" destination. Fix
    Enter VirtualBox's directory in Command Prompt.

    Also Read: How to install VirtualBox Guest Additions on Windows.

    The above is the detailed content of Convert VirtualBox fixed disk to dynamic disk and vice versa. For more information, please follow other related articles on the PHP Chinese website!

    Related labels:
    source:mryunwei.com
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!