Michael D. Green

Blogger, Consultant, Technologist and Very Opinionated.

How to Increase the Hard Drive Size of a Ubuntu Desktop Virtual Machine Using Hyper-V and GParted

01 Jan 2019 » technology

Blogs - Michaeldeongreen

By default, when you use Quick Create in Hyper-v to create a Ubuntu Desktop VM, you will only be given 12GB of hard drive space. At this time there is no way to set the size of the hard drive before Quick Create provisions the Ubuntu Desktop VM. Luckily, you can use software called gparted to increase the size of the virtual hard drive.

Tools Needed!

  • gparted
  • Hyper-V
  • Windows 10

Download gparted iso, which can be found here:

In Hyper-V, on the top menu, choose Action then Quick Create and Choose Ubuntu 18.04 LTS. Create Virtual Machine & wait for the image to download
Blogs - Michaeldeongreen

Once the image has been downloaded, choose Edit Settings and disable Checkpoints
Blogs - Michaeldeongreen

Go ahead and connect and start the Ubuntu Desktop installation
Blogs - Michaeldeongreen

**Once done, log into the new VM, open up a terminal and type in


    df -h

. You will notice that the main drive is at 44% capacity**
Blogs - Michaeldeongreen

Once the installation is complete, shutdown your new VM. In Hyper-V, select your new VM and go to SCSI Controller and add a DVD Drive
Blogs - Michaeldeongreen

In the DVD Drive settings, point the image file to the gparted iso you downloaded
Blogs - Michaeldeongreen

Next, go into the Firmware settings and move the DVD Drive up in the boot order section
Blogs - Michaeldeongreen

Next, we want to add more hard drive space, so go into Hard Drive setting under SCSI Controller and press Edit
Blogs - Michaeldeongreen

In the menu wizard, you want to choose ‘expand’ and add more hard drive space. I have chosen to make the drive 30GB.
Blogs - Michaeldeongreen

Connect to the VM. You will see the gparted menu and you can just push enter on everything
Blogs - Michaeldeongreen

When you enter gparted, you will see the below and you will want to push Fix
Blogs - Michaeldeongreen

You will then be presented with disk information. Noticed the unallocated space at the bottom, which is the space we just added using Hyper-V
Blogs - Michaeldeongreen

Next, you will want to choose your root drive (mine is /dev/sda1), right-click and choose Resize
Blogs - Michaeldeongreen
Blogs - Michaeldeongreen

You will want to use the mouse cursor and hover over the right arrow and drag it all the way over to give drive/dev/sda1100% of the unallocated space and press Resize/Move
Blogs - Michaeldeongreen

After this is done, press theApplybutton located in the top menu and selectApplywhen asked are you sure you want to perform the operation
Blogs - Michaeldeongreen

Once the space has been allocated, exit gdeparted by going to the top menu, selectingGPartedand then Quit. Once you go to the main gparted screen, choose Exit and then Shutdown
Blogs - Michaeldeongreen

Note: If you get the error in the screenshot below (happens on my laptop but not my desktop), you will want to go into the Windows Task Manager, got to Details, find thevmwp.exeand end the task
Blogs - Michaeldeongreen
Blogs - Michaeldeongreen

**Now, connect to your VM, go to terminal and type in

    df -h

Ubuntu should recognize the new space you just gave the hard drive via gparted**
Blogs - Michaeldeongreen