Step 2: Click Edit Virtual Machine Settings, select the hard disk, and click Extend, as shown in the figure below:
Step 3: Enter the disk size you want now (if you originally had 200G, and now you want to expand it to 10G, enter 210G), click Expand, as shown in the figure:
Step 4: In the pop-up window, click OK, as shown in the figure:
Step 5: Start the virtual machine, right-click the mouse, select Open Terminal, and enter the following command to download the gparted tool:
sudo apt install gparted
Step 6: Enter the following command to open the downloaded tool for operation:
sudo gparted
So far, our expansion is complete! Can come to verify. Close the terminal, go back to the desktop, click the file in the left column, right-click the mouse in the main directory, select properties, and you can see the remaining size of your current disk. As shown in the picture: