<< to CrossControl homepage

Support & Service Center

Resize the virtual disk drive of LinX Software Suite DevEnv

Printer-friendly versionPrinter-friendly versionPDF versionPDF version

The virtual machine (VM) is delivered with a dynamic disk with a predefined maximum size. Over time this might not be enough and additional space is required. This article aims to present one available option to increase the size of the virtual disk drive using a computer running Windows. The steps will include screenshots from v3.0.1 of the LinX Software Suite DevEnv, but are applicable for other versions as well since the steps are general.

Overall, there are two steps that’s need to be performed:

  1. Resize the VDI file
  2. Resize the Linux Partition

Preparations

Before altering the VirtualBox Virtual Disk Image (VDI) of the VM, it is highly recommended to back-up the currently used VDI before doing any of the following steps. Mistakes during the process may lead to a broken VDI. Locate the current *.vdi used by LinX, make a copy of it and store on a suitable location. The VM should have been closed properly prior to the copying.

Secondly it is not possible to resize the Linux Partition while the VDI is being used. This is solved by using the live version of GParted to do all the modifications of the VDI. Stable versions of GParted can be found on the following address https://sourceforge.net/projects/gparted/files/gparted-live-stable/. We will be using gparted-live-0.30.0-1-amd64.iso for this example.

Resize the VDI file

VBoxManage is the tool we will be using to resize the VDI file. It is a part of the VirtualBox installation. The tool is used through the command prompt.

  1. Start by opening a new command prompt (press Win-key and type “cmd”)
  2. cd to the location where the *.vdi is stored
  3. Type the following command in the prompt
  • VBoxManage modifyhd "LinX Software Suite DevEnv v3.0.1-disk1.vdi" --resize 60000
  1. This will resize the VDI to 60 000 MB (around 60 GB), adjust accordingly to wanted size
  2. If the command was entered correctly the following output should be displayed
  • VBoxmanage modifyhd "LinX Software Suite DevEnv v3.0.1-disk1.vdi" --resize 60000 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

This concludes the resize of the VDI, now it time to increase the Linux Partition using GParted!

Note: If you receive the error “ERROR: VBOX_E_NOT_SUPPORTED” when running the command modifyhd it normally means that the wanted size is not larger than the current size of the disk. Verify the size of the drive by using the command VBoxmanage showhdinfo "LinX Software Suite DevEnv v3.0.1-disk1.vdi".

Create and setup a new VM in VirtualBox

From here on it will be a bit tougher compared with the prior section, please follow the steps carefully.

1. Create a new VM

  • In VirtualBox create a new VM (Ctrl+N)
    • Name: “GParted”
    • Type: Linux
    • Version: “Linux 2.6 / 3.x (64 bit)” or similar
  • Choose “Do not add a Hard Drive” when prompted. Ignore the warnings

2. Add GParted ISO to the new VM (GParted)

  • Right-click on your newly created VM and select “Settings"
  • Choose “Storage”
  • Select “Controller: IDE” and add a new CD/DVD device
  • When asked if you would like to choose a virtual CD/DVD to add select “Choose disk”
  • Browse for the previously downloaded GParted _ISO gparted-live-0.30.0-1-i686.iso and choose it
  • If there is an “Empty” disk under “Controller: IDE”, you may remove it

3. Add the *.vmi to resize to the GParted VM

  • Select “Controller: SATA” and choose “Add Hard Disk”
  • Select “Choose existing disk”
  • Browse for the disk to resize (LinX Software Suite DevEnv v3.0.1-disk1.vdi)

Verify that the “Storage” settings page is similar or equal to the following screenshot

2018-03-03_162236.jpg

4. Start the new VM (GParted)

  • Start the newly created GParted VM
  • Select "Default settings", then select language when prompted and 0 for default settings
  • When the VM have fully opened the following screen should be visible

2018-03-03_163149.jpg

Resize the Linux Partition

If you have not yet made a backup of the drive which should be modified, this is the last checkpoint! It is time to do the heavy lifting and increase the partition size. It cannot be expanded directly since there is a Linux Swap partition placed in the end of the partition we wish to resize, and it is blocking the expansion. The solution is to first remove the Swap partition and then re-create it.

1. Remove the Linux swap partition

  • Right-click on the “linux-swap” file system and select “Delete”
  • Right-click on the dev/sda2 partition and select “Delete”
  • Perform the scheduled actions by pressing “Apply”
  • Once the actions have been completed, proceed to the next section

2. Expand the partition

  • Right-click on the /dev/sda1 partition and select Resize/Move
    • Expand the partition by either entering the correct values or drag the right arrow to increase the partition size
    • Set “Free space following (MiB)” to 1023
    • Use the provided screenshot as a reference for the settings
  • Once set, schedule the resize action by selecting Resize/Remove

4_.jpg

3. Re-create the Linux Swap partition (part 1)

  • Right-click on the unallocated disk space and select “New”
    • Set “Create as:” to “Extended Partition”
    • Set “New size (MiB)” to 1023
  • Use the provided screenshot as a reference for the settings
  • Schedule the action by selecting Add

6_.jpg

4. Re-create the Linux Swap partition (part 2)

  • Right-click on the unallocated space in the partition created in the last step and select “New”
    • Set “Create as:” to “Logical Partition”
    • Set “File system:” to “linux-swap”
    • Set “New size (MiB)” to 1022
  • Use the provided screenshot as a reference for the settings
  • Schedule the action by selecting Add

8_.jpg

5. Apply the changes

Once all the earlier changes have been made (grow, create extended partition, and create logical partition) it is finally time to apply the changes. At this point the operations should look like the following screenshot:

9.jpg

Press “Apply” and once the operations have been completed it should look like the following screenshot:

10.jpg

It is now possible to close the GParted VM since all the required steps are completed.

Start LinX Software Suite DevEnv

The first time the VM is started the startup-time may increase and you will see the following screen longer than expected. In the background there is disk check running since we have modified the disk and partitions.

2018-03-03_163816_0.jpg

Once it is completed you may start using the VM just as before the disk resize operations. To verify if the disk is increased as planned, open a terminal window and write df –k. The output should show that the size after the expansion.

13.jpg