VirtualBox allows you to select an automatically or permanently allocated hard drive when creating a new virtual hard disk file. Portable hard drives are faster to create and can increase storage size. Fixed-size hard drives are also faster in use but cannot increase in size when they are filled. However, you can convert between the two formats and hard drive sizes if you want.
- How to regain access to the hard drive, fix the error of not opening the hard drive
- Instructions on how to install Windows 7 from HDD
- How to set up BIOS to boot from USB/CD/DVD, external hard drive
- 8 ideas from old hard drives
Step 1 – Locate the VBoxManage command and open Command Prompt
VirtualBox offers the capability to switch between fixed and removable hard drives, however, this option is not available in its graphical user interface. To do so, you need to utilize the VBoxManage.exe command.
To proceed, you must specify this command. In Windows, you can locate it in the VirtualBox program folder, typically located at “C:Program FilesOracleVirtualBox”. If you have installed VirtualBox in a different folder, kindly search for it in that particular location.
To open the “Command Prompt” window, go to the “Start” menu, type “cmd” and hit “Enter”.
Type “cd” into the Command Prompt, indicating the path to the directory which contains the VBoxManage command (enclose the command within quotation marks).
To quickly accomplish this task, follow these steps:
1. Open a Command Prompt Window.
2. Locate the folder icon in the file manager’s address bar.
3. Click and hold the folder icon.
4. Drag and drop the folder icon onto the Command Prompt.
If you are using the default path, it will have the following format:
“cd “C:Program FilesOracleVirtualBox”” can be rewritten as “Navigate to the folder “C:Program FilesOracleVirtualBox”.”
Note: These instructions are specifically for using VirtualBox on a Windows operating system. If you are using VirtualBox on macOS or Linux, you can directly open Terminal and execute the vboxmanage command in the usual manner, similar to other commands.
Step 2 – Locate the path to the drive you want to transfer
To view the list of virtual drives on your computer, execute the following command in the Command Prompt window:
VBoxManage.exe lists hard drives.
Please review the list and provide the file path to the virtual disk you wish to convert. For example, if you want to convert a virtual drive linked to a virtual machine named “Windows”, observe the output below: the path to the virtual disk in the system is C:UserschrisVirtualBox VMsWindowsWindows.vdi.
Step 3 – Convert Virtual Hard Drive
At present, you can utilize the VBoxManage command to convert virtual drives between fixed and removable formats, or vice versa.
To convert from a fixed hard drive to a removable hard drive, you can follow these instructions:
1. Start by shutting down your computer and disconnecting all power sources.
2. Open the computer case to access the internal components.
3. Locate the fixed hard drive that you want to convert.
4. Disconnect the cables (SATA or IDE) attached to the fixed hard drive.
5. Remove any mounting screws or brackets securing the fixed hard drive in place.
6. Carefully slide out the fixed hard drive from its slot.
7. Obtain a compatible removable hard drive.
8. Connect the cables (SATA or IDE) to the removable hard drive.
9. Secure the removable hard drive in the appropriate slot.
10. Attach any necessary mounting screws or brackets to ensure stability.
11. Close the computer case.
12. Reconnect the power sources and start up your computer.
13. Check if the removable hard drive is recognized by your operating system.
14. Format the removable hard drive if necessary, following the prompts provided by your operating system.
Note: The specific steps may vary depending on your computer model and the type of hard drive you are working with. It is advisable to consult the manufacturer’s instructions or seek professional assistance if needed.
Please ensure that you possess either a portable hard drive or an available one that can be used as a new portable hard drive.
Connect the stationary hard drive to the computer using either a SATA cable or a USB cable (if the fixed hard drive has a USB port). Ensure that the connection is secure and stable.
Open the hard drive on Windows Explorer or Finder on Mac to examine the available files and folders. Ensure that you create a backup of all critical data before proceeding with the conversion.
To format the new portable hard drive, follow these steps based on your operating system:
1. Open Windows Explorer.
2. Right-click on the hard drive.
3. Select “Format” from the context menu.
4. Choose the necessary options for formatting.
1. Open the “Utilities” folder.
2. Launch “Disk Utility.”
3. Select the hard drive from the list.
4. Click on the “Erase” button to format the drive.
After the formatting process is finished, you are able to transfer data from the fixed hard drive to the removable hard drive by simply dragging and dropping files and folders.
Please verify the copied data on the portable hard drive to ensure that no information is lost during the conversion process.
After finishing the conversion process, you can disconnect the desktop hard drive and proceed to use the newly converted portable hard drive as you normally would.
VBoxManage.exe clonemedium disk “C:path to root_file.vdi” “C:path to_destination_vdi” -variant Standard
For instance, if the source hard drive is located at C:UserschrisVirtualBox VMsWindowsWindows.vdi and you wish to create a new hard drive named “Windows-dynamic.vdi” in the same directory, you would execute the following command:
VBoxManage.exe clonemedium disk “C:UserschrisVirtualBox VMsWindowsWindows.vdi” “C:UserschrisVirtualBox VMsWindowsWindows-dynamic.vdi” –variant Standard
Rewritten in Vietnamese:
VBoxManage.exe clonemedium disk “C:UserschrisVirtualBox VMsWindowsWindows.vdi” “C:UserschrisVirtualBox VMsWindowsWindows-dynamic.vdi” -category: Standard.
To convert a virtual hard drive from removable to fixed, you can run the following command:
Please use the following command in VBoxManage.exe to clone the drive “C:pathtosource.vdi” and save it as “C:pathtodestination.vdi” with the parameter “–variant Fixed”:
“VBoxManage.exe clonemedium disk”
For example, to create a new disk named “Windows-fixed.vdi” in the same directory as the source hard drive located in “C:UserschrisVirtualBox VMsWindowsWindows.vdi”, you would run the following command:
VBoxManage.exe clonemedium disk “C:UserschrisVirtualBox VMsWindowsWindows.vdi” “C:UserschrisVirtualBox VMsWindowsWindows-fixed.vdi” with the Standard variant.
VBoxManage.exe clonemedium disk “C:UserschrisVirtualBox VMsWindowsWindows.vdi” “C:UserschrisVirtualBox VMsWindowsWindows-fixed.vdi” –Standard variant.
Step 4 – Delete the old virtual hard drive
The aforementioned command is employed to clone the entirety of the current hard drive. As a result, you will possess both the original file system as well as the new file system.
To start, you should remove the current virtual hard drive from VirtualBox. Open VirtualBox, right-click on the virtual machine that is utilizing the virtual disk, and choose “Settings”.
Choose “Storage” option to see the connected storage devices. Right-click on the original “VDI” and choose “Delete Attachment”. Afterwards, click on “Agree”.
The upcoming procedure will remove the original file from the hard drive. Please keep in mind that if you haven’t already, you can create a backup of the original files on your hard drive to safeguard against any potential errors that may arise during this process.
To view the list of virtual hard drives on a computer, you can run the following command in a Command Line Window:
Please use the following command in VBoxManage.exe to list the hard drives: “VBoxManage.exe list hdds”.
Please provide the UUID of the original hard drive that you wish to erase. You can copy the UUID by left-clicking on it and then right-clicking.
To remove the original hard drive from the VirtualBox registry and delete it, execute the given command. You can simply right-click in the Command Prompt window to paste the UUID.
VBoxManage.exe closemedium UUID –delete (Đóng đối tượng UUID và xóa nó)
“VBoxManage.exe closemedium UUID –delete (Close and delete the UUID object)”
Step 5 – Rename the new hard drive
You should now rename the file in the new hard drive to have the same name as the original file. Simply open the “File Browser” or “Windows Browser” window to access it.
To rename the VDI file, right-click on it and choose “Change name”. Then, modify the name to the original one. As an illustration, let’s rename the file we previously created as “Windows-fixed.vdi” to “Windows.vdi”.
After renaming the hard drive, remove the old name of the hard drive from VirtualBox. To do this, open VirtualBox and go to File > Manage Virtual Media. Look for the original name of the renamed hard drive, indicated by a yellow warning icon on the left side. Right-click on it and choose the Delete option. Confirm the deletion by clicking Delete again, then close the window.
Step 6 – Insert the hard drive into VirtualBox
To perform the same steps in VirtualBox, follow these instructions:
1. Right-click on the virtual machine.
2. Choose “Settings” from the drop-down menu.
3. In the “Settings” window, click on “Storage”.
4. Right-click on “controller: SATA” under the “Storage Tree” section.
5. Select “Add Hard Disk” from the options provided.
Choose “Select Survival Disk” and locate and choose the file you have recently renamed.
Please click on OK to close the virtual machine settings window. You can now start the virtual machine as you normally would. The hard drive will be recognized as either a fixed or removable hard drive, based on your configuration settings.
It is finished. You have successfully changed from a hard drive to a removable drive in VirtualBox, or vice versa.