After you add a new blank virtual hard drive to the virtual machine configuration, it remains invisible to the operating system unless you initialize it.
To initialize a new hard drive in Windows 11, you will need to do the following:
Open the start menu by clicking on the Windows logo and choose Settings.
On the left, choose System and scroll to the Storage menu item.
Under Storage management, expand the Advanced storage settings sub-menu and select Disks & volumes.
Find the new virtual hard drive from the list and click Initialize.
In older versions of Windows, you can initialize a new drive by locating the Disk Management utility in the Control Panel, launching the Initialize and Convert Disk wizard, and creating a new volume on that disk afterwards.
Initializing a new virtual hard disk in a Linux guest OS comprises two steps: (1) allocating the virtual hard disk space and (2) mounting this disk in the guest OS.
To allocate the space, you need to create a new partition on this virtual hard disk using the fdisk
utility:
Note: To use the fdisk
utility, you need the root
privileges.
Launch a terminal window.
To list the IDE devices present in your virtual machine configuration, enter:
By default, the second virtual hard drive appears as /dev/hdc
in your Linux virtual machine. To work with this device, enter:
To get detailed information about the drive, enter:
To create a new partition, enter:
To create the primary partition, enter:
Specify the partition number. By default, it is 1
.
Specify the first cylinder. If you want to create a single partition on this hard drive, use the default value.
Specify the last cylinder. If you want to create a single partition on this hard drive, use the default value.
To create a partition with the specified settings, enter:
When you allocated the space on the newly added virtual hard disk, you should format it by entering the following command in the terminal:
Note: <FileSystem>
stands for the file system you want to use on this disk. It is recommended to use ext3
or ext2
.
When the added virtual hard disk is formatted, you can mount it in the guest OS.
To create a mount point for the new virtual hard disk, enter:
To mount the new virtual hard disk to the specified mount point, enter:
Once you have mounted the virtual hard drive, you can use its space in your virtual machine.