pwshub.com

How to Increase Virtual Machine Size in VirtualBox

A simple tutorial on how to increase virtual machine size in VirtualBox.

VirtualBox is one of the popular virtualization software that allows you to create and manage virtual machines (VMs).

One of the common issues that you may face is the running out of disk space on VMs which you created in VirtualBox. You may have specified a size while creating the VM, but as time goes on, you end up with low disk space issue.

In this article, I will talk about how to increase the size of your VirtualBox virtual machines.

The below instructions are for VirtualBox 7.0 and above.

  • Open VirtualBox and ensure all your VMs are shutdown.
  • From the menu, select File > Tools > Virtual Media Manager.
  • On the hard disk tab, select the name of your virtual machine whose size you want to increase.
  • Click on properties from the toolbar (or right click > properties).
VM size before expansion
  • At the bottom, under the Attributes tab, you should see a size bar. Increase it to your desired size for your VM.
  • Click on apply. You should see the new size in the main page of the VirtualBox when you select your VM.
Increase VM Size in VirtualBox
Size is reflecting as physical storage – but not yet ready
  • But the steps are not complete yet.
  • Boot into your guest virtual machine.
  • If it’s a Linux VM, open a terminal and run df -h to see whether the new size is showing. In most of the cases, it should not. Because, when you increase your VirtualBox size for the VM, the guest VM OS doesn’t know about the extra size. Because it was NOT part of the guest VM’s partition table when you last booted into it.
  • As, you can see in the below example, the size is still showing as the old size.
VM size is still showing old number
  • To continue, open Gparted or any other partition editor from your guest VM.
  • Analyse your guest VM partition table. You should see the additional size is shown as “unallocated space”. You need to resize your root partition to use this newly allocated space.
Unallocated new space
  • Select the partition and choose resize/move from the Gparted context menu.
  • Choose the new size as equal to the old size + the additional size. You can simply put 0 in Free space and gparted will take care of the rest.
  • Click on Resize. And in the main Gparted window, click Apply (green tick mark).
Resize the VM partition to fill up the newly allocated size
Provide the size to resize partition
Applying the change
  • GParted essentially runs the below command internally to resize the partition.
resize2fs -p /dev/sda2
  • Once complete, close GParted and you should see your VM partition now has the extended size.
VirtualBox VM now reflects new size

For Windows VM or if you don’t have GParted in your guest VM

  • There could be situations where your VM does not have the GParted installed OR, you are using Windows. For those cases, download the GParted LIVE ISO file from the website. Download link.
  • After download, open VirtualBox and attach the ISO file as a Storage > IDE device optical drive (see below).
  • Press OK and boot your virtual machine.
  • You should see the partitions of your Windows VM or any other VM in GParted LIVE distribution.
  • Now you can follow the above steps to resize. Once complete, reboot GParted LIVE distribution.
Attaching GParted LIVE ISO to your VM
You can use GParted LIVE ISO also to configure the Guest VM partition

Wrapping up

I hope using this guide you can resize your VM size to a proper number. Overall, it is a seamless process that should not fail. But if you want to increase the size of your critical production virtual machine, then do a clone before resizing.

Source: debugpoint.com

Related stories
9 hours ago - VDI (Virtual Desktop Infrastructure) solution enables users to access virtual desktops and applications remotely through a centralized, secure, and scalable platform. It’s ideal for individuals and organizations managing remote workers or...
6 days ago - OutOfMemoryError: Java heap space can cripple your application, so every developer must know how to identify and resolve these errors
1 week ago - Business process management (BPM) tools help organizations design, execute, analyze, and optimize their business processes. Manual workflow planning and execution are time-consuming and require a lot of effort from employees. Business...
1 month ago - Find the best video editing software for beginners and professionals in our comprehensive guide. Compares features, ease of use, and pricing to help you create stunning videos without the hassle. The post Best Video Editing Software in...
1 month ago - Podcast tools help with creating, editing, distributing, and monetizing podcasts by offering features such as audio recording, hosting, analytics, and audience engagement to streamline the entire podcast production process. Podcast tools...
Other stories
1 hour ago - This release candidate, a near-final look at Deno 2, includes the addition of Node's process global, better dependency management, and various API stabilizations, and more.
1 hour ago - Published: September 19, 2024 The CSS Working Group has combined the two CSS masonry proposals into one draft specification. The group hopes that...
1 hour ago - Stay organized with collections Save and categorize content based on your preferences. Published: September...
3 hours ago - DNS monitoring tool is a cloud-based scanner that constantly monitors DNS records and servers for anomalies. This tool aims to ensure that users are sent to genuine and intended website pages, instead of fakes or replicas. It alerts users...
4 hours ago - Email spoofing is a malicious tactic in which cybercriminals send fake emails that look like they come from trusted organizations or individuals. When unsuspecting users act on these emails, they may unknowingly share sensitive data,...