{{Title|title=
Virtual Hard Disk Size Increase
}}
{{Header}}
{{#seo:
|description=Get more disk space. Increase the size of a virtual disk. Expand virtual machine storage capacity. Possible with Qubes, {{q_project_name_long}}, {{project_name_long}} KVM and {{project_name_long}} VirtualBox.
|image=Blocks-968874640.jpg
}}
[[File:Blocks-968874640.jpg|thumb]]
<div class="mininav">
* [[Grow_Virtual_Harddisk|Virtual Hard Disk Size Increase]]
* [[Shrink_Virtual_Harddisk|Shrink Virtual Hard Disk Size]]
</div>
{{intro|
Get more disk space. Increase the size of a virtual disk. Expand virtual machine storage capacity. Possible with Qubes, {{q_project_name_short}}, {{project_name_short}} KVM and {{project_name_short}} VirtualBox.
}}
= Virtual Machines =
If more disk space is required for virtual hard disks, the good news is this is simple for {{project_name_short}} VMs. Nothing special, because it is just another VM image. Any suggestions found for your virtualizer will similarly work for {{project_name_short}}. [[Self_Support_First_Policy|Self Support First Policy]] applies.

'''1.''' Back up important data.

Either move important files via [[KVM#Shared_Folders|shared folders]] or make a full clone of VMs in each snapshot state in case something goes wrong.

'''2.''' Select your virtualizer.

{{Tab
|type=controller
|content=
{{Tab
|title= == VirtualBox ==
|image=[[File:Virtualbox_logo.png|25px]]
|addToClass=info-box
|active=false
|content=
'''3.''' On the host: Make a clone of all states of any existing virtual machine in case something goes wrong.

'''4.''' On the host: Delete all existing VM snapshots.

'''5.''' On the host: Grow the disk.

<u>Either,</u>

* '''A)''' Using the VirtualBox graphical user interface (GUI):

<code>VirtualBox</code> &rarr; <code>File</code> &rarr; <code>Tools</code> &rarr; <code>Virtual Media Manager</code> &rarr; <code>select virtual hdd</code> &rarr; <code>adjust the size slider</code>

<u>or,</u>

* '''B)''' Using the command line. See footnote. <ref>
Find the folder of the virtual hdd.

Run the following command. Notes:

* Adjust the filename of the virtual hdd.
* Adjust <code>100000</code> to, for example, <code>200000</code>.

{{CodeSelect|code=
VBoxManage modifyhd "{{project_name_workstation_short}}-disk1.vdi" --resize 100000
}}
</ref>

'''6.''' Install a partitioning tool.

<u>Note:</u> No longer required for [[Systemcheck#Build_Version|Build Version]] <code>17.3.9.2</code> and above.

<div class="toccolours mw-collapsible mw-collapsed">
Build version <code>17.3.9.2</code> and below, please press on expand on the right.
<div class="mw-collapsible-content">
Install a tool such as <code>gparted</code> that can grow the filesystem.

{{Install_Package|package=
gparted
}}

Start the partitioning tool.

Start a terminal.

{{CodeSelect|code=
lxsudo gparted
}}

Claim the new space.

* Increase the size of the filesystem.
* The user probably does not wish to create a new partition. Instead, the existing partition should be expanded.
</div>
</div>

'''7.''' Partition's type code fix.

<u>Note:</u> No longer required for build version <code>17.4.0.4</code> and above. (Unreleased at time of writing.)

<div class="toccolours mw-collapsible mw-collapsed">
Build version <code>17.4.0.4</code> and below, please press on expand on the right.
<div class="mw-collapsible-content">
This is a fix for [https://forums.whonix.org/t/failed-to-start-systemd-repart-service-repartition-root-disk/21640 Failed to start systemd-repart.service - Repartition Root Disk].

{{CodeSelect|code=
sudo sgdisk --typecode='3:4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709' /dev/sda
}}
</div>
</div>

'''9.''' Reboot.

'''10.''' Done.

The procedure is complete.

}} <!-- close tab: VirtualBox -->

{{Tab
|title= == KVM ==
|image=[[File:Kvm-new-logo.png|25px]]
|addToClass=info-box
|active=false
|content=
'''3.''' On the host: Delete all existing snapshots.

'''4.''' On the host: Increase the disk size.

<code>1G</code> below should be replaced with the amount of memory to be added in gigabytes.

{{CodeSelect|code=
qemu-img resize vmdisk.img +1G
}}

'''5.''' Same instructions as step 6 for VirtualBox and following.

}} <!-- close tab: KVM -->

{{Tab
|title= == Qubes ==
|image=[[File:Qubes-logo-blue.png|25px]]
|addToClass=info-box
|active=false
|content=
'''2.''' Refer to the [https://www.qubes-os.org/doc/resize-disk-image/ Resizing Disk Image] Qubes OS user documentation.

'''3.''' Done.
}} <!-- close tab: Qubes -->

}} <!-- close Controller: KVM and VirtualBox -->

= Build from Source Code =

Refer to [[Dev/Build_Documentation|Build {{project_name_short}} from Source Code]] and utilize this command line parameter:

{{CodeSelect|code=
--vmsize 200G
}}

= See Also =
* [[Shrink Virtual Harddisk]]

= Footnotes =
{{reflist|close=1}}

{{Footer}}

[[Category:Documentation]]