homelab

Moving and extending VirtualBox virtual machines

Moving and extending VirtualBox virtual machines
Photo by Markus Spiske / Unsplash

Running things on Apple hardware here, all those Windows-only software packages are a somewhat of a pain… As good as they are, both Qlik Sense, some of the vendor specific embedded software IDEs and other need-to-have software are Windows-only.

VirtualBox to the rescue. It is free and works really well  (I do hear good things about Parallels too, though). I have used it for years without any real issues, until recently when I simply ran out of disk space on the host iMac where it lives, as well as in the virtual machine itself. The client OS (Windows 10) simply did not have enough space to download and install service packs.

Time to upgrade.

The mission was to move the Windows 10 virtual machine (VM) to a fast, external, large USB3-connected SSD drive. Wasn’t too hard to do, but as there were a couple of challenges it’s worth documenting.

Move the VirtualBox disk file

Pretty simple, the idea is to remove the .vdi file from VirtualBox, copy it to the external drive and then re-attach it to the VM. Well described here, with screenshots and all.

Expand the Virtual Machine disk size

This turned out to be a bit trickier than expected. Sometime during the past years’ of upgrading Windows versions, a 450 MB partition (called “Healthy (Recovery Partition)”) was placed on the VM’s disk. Probably as part of upgrading to Windows 10, I think.

Expanding the VM’s disk is a two-step process, first expanding the max size of the .vdi file itself, then making Windows use the newly allocated space.

Expanding the .vdi file is easy. Shut down VirtualBox on the host (OSX in my case), then use VBoxManage to expand the .vdi file to desired size. Plenty of online tutorials for doing this, the syntax is

VBoxManage modifyhd “<full_path_to_vdi_file>” –resize <new_size_in_megabytes>

Starting up Windows and going into the Disk Management tool, the new space is found at the end of the disk. Which makes it impossible for Windows to extend the primary partition.  Right click on it, and the “Extend Volume…” command is greyed out.

We need to move the 450 MB recovery partition to the end of the disk. There are probably many different disk partitioning programs that can do this, I had success with the free version of EaseUS Partition Master.

After swapping places for the recovery and newly added partitions, the main Windows 10 partition could be extended. After a reboot the partition map looks like this:

Windows 10 partition map after extending disk size
Windows 10 partition map after extending disk size

Mission accomplished.

Göran Sander Stockholm, Sweden

Qlik Sense consultant and toolmaker at Ptarmigan Labs. Ten years at Spotify, Qlik Luminary and Partner Ambassador, author of the open source Butler tools.

All posts by Göran Sander
Keep reading

More about

network

Upgrading firmware on HP ProCurve 1800-24G / J9028B

A recent inventory of network switches showed that the one that is in most active use was on an outdated firmware revision. I really like the switch in question, an HP ProCurve 1800-24G, as it is fanless and thus completely silent. It’s been in 24/7 use for

2 min read
homelab

Installing Debian on old ASUS motherboards

Having a couple of decommissioned ASUS motherboards (M2NPV-VM and A8N-VM CSM), as well as a 19″ cabinet with ATX cases in it, they could together be a setup for lab work, trying out Linux server stuff, as a test bed for network gear etc. Installing Linux (Debian) is

1 min read
homelab

Compiling Zabbix for small headless server

Turns out the Bubba2 (and of course Bubba3) can run latest version (2.0.2) of Zabbix quite ok, at least when only monitoring a handful of servers. I created a brief installation instruction for bubba here.

1 min read