{{Header}} {{Title|title= Virtual Hard Disk Size Increase }} {{#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]]
bdev_allow_write_mounted=1 to allow claiming the new space.
Elaborated below.
{{IconSet|h1|5}} Inside the VM: Claim the new space.
{{IconSet|h1|6}} Inside the VM: Reboot.
{{IconSet|h1|7}} Done.
= Virtual Machines =
If more disk space is required for virtual hard disks, the good news is that this is simple for {{project_name_short}} VMs. Nothing special is required, 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.
{{IconSet|h1|1}} Back up important data.
Either move important files via shared folders
* [[VirtualBox/Guest_Additions#Shared_Folder|VirtualBox: Shared Folder]]
* [[KVM#Shared_Folders|KVM: shared folders]]
or make a full clone of VMs in each snapshot state in case something goes wrong.
{{IconSet|h1|2}} Select your virtualizer.
{{Tab
|type=controller
|linkid=virtualizer-choice-grow
|content=
{{Tab
|title= == VirtualBox ==
|image=[[File:Virtualbox_logo.png|25px]]
|addToClass=info-box
|active=false
|content=
{{IconSet|h1|3}} On the host:
{{IconSet|h1|4}} Make a clone of all states of any existing virtual machine in case something goes wrong.
{{IconSet|h1|5}} Delete all existing VM snapshots.
{{IconSet|h1|6}} Grow the disk.
Either,
* {{IconSet|h3|A}} Using the VirtualBox {{gui}}:
VirtualBox → File → Tools → Virtual Media Manager → select virtual hard disk → adjust the size slider
or,
* {{IconSet|h3|B}} Using the {{cli}}. See footnote.
Find the folder of the virtual hard disk.
Run the following command. Notes:
* Adjust the filename of the virtual hard disk.
* Adjust 100000 to, for example, 200000.
{{CodeSelect|code=
VBoxManage modifyhd "{{project_name_workstation_short}}-disk1.vdi" --resize 100000
}}
{{IconSet|h1|7}} During VM boot:
{{IconSet|h1|8}} Restart the virtual machine and stop at the [[grub]] boot menu.
{{IconSet|h1|9}} At the boot menu, boot into [[Persistent Mode|persistent mode]] - [[sysmaint]] session and make a [[Grub#Temporary_Kernel_Boot_Parameter_Change|Temporary Kernel Boot Parameter Change]] by changing bdev_allow_write_mounted=0 to bdev_allow_write_mounted=1 for this boot only.
Alternatively, advanced users can make [[Grub#Permanent_Configuration_Changes|Permanent Configuration Changes]]. This is more complicated.
{{IconSet|h1|10}} Inside the VM:
{{IconSet|h1|11}} [[Grub#Inspect_Kernel_Command_Line|Inspect Kernel Command Line]].
Optional. For verification of kernel boot parameter change.
{{CodeSelect|code=
cat /proc/cmdline {{!}} grep --color bdev_allow_write_mounted
}}
Expected output:
bdev_allow_write_mounted=1{{IconSet|h1|12}} Version-specific notice. * [[Systemcheck#Build_Version|Build Version]]
17.4.0.5 and above: No special notice.
* Older build versions: See footnote.
{{IconSet|h2|1}} Install a partitioning tool.
Note: No longer required for [[Systemcheck#Build_Version|Build Version]] 17.3.9.2 and above.
17.3.9.2 and below, please press Expand on the right.
gparted 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.
17.4.0.4 and above.
17.4.0.4 and below, please press Expand on the right.
1G below should be replaced with the amount of disk space to be added in gigabytes.
{{CodeSelect|code=
qemu-img resize vmdisk.img +1G
}}
{{IconSet|h1|6}} During VM boot:
{{IconSet|h1|7}} Restart the virtual machine and stop at the [[grub]] boot menu.
{{IconSet|h1|8}} At the boot menu, boot into [[Persistent Mode|persistent mode]] - [[sysmaint]] session and make a [[Grub#Temporary_Kernel_Boot_Parameter_Change|Temporary Kernel Boot Parameter Change]] by changing bdev_allow_write_mounted=0 to bdev_allow_write_mounted=1 for this boot only.
Alternatively, advanced users can make [[Grub#Permanent_Configuration_Changes|Permanent Configuration Changes]]. This is more complicated.
{{IconSet|h1|9}} Inside the VM:
{{IconSet|h1|10}} [[Grub#Inspect_Kernel_Command_Line|Inspect Kernel Command Line]].
Optional. For verification of kernel boot parameter change.
{{CodeSelect|code=
cat /proc/cmdline {{!}} grep --color bdev_allow_write_mounted
}}
Expected output:
bdev_allow_write_mounted=1{{IconSet|h1|11}} Follow the same version-specific instructions as in the VirtualBox section to claim the new space. {{IconSet|h1|12}} Reboot. {{IconSet|h1|13}} Done. The procedure is complete. }} {{Tab |title= == Qubes == |image=[[File:Qubes-logo-blue.png|25px]] |addToClass=info-box |active=false |content= {{IconSet|h1|3}} Refer to the [https://www.qubes-os.org/doc/resize-disk-image/ Resizing Disk Image] Qubes OS user documentation. {{IconSet|h1|4}} Done. }} }} = Build from Source Code = Refer to [[Dev/Build_Documentation|Build {{project_name_short}} from Source Code]] and use this command line parameter: {{CodeSelect|code= --vmsize 200G }} = See Also = * [[Shrink_Virtual_Harddisk|Shrink Virtual Hard Disk Size]] = Footnotes = {{reflist|close=1}} {{Footer}} [[Category:Documentation]]