How to resize a VirtualBox Ubuntu vm hard drive

HowTo : resize ubuntu vm hard drive hosted on Virtual Box


on host (host is the computer having virtualbox) :
  • VirtualBox version should be greater than 4.0.0
  • you should have enough space to clone your VM and available space (using to extend your hard drive)
  • you should have enought space to get gparted livecd (130Mo)

Step by step

original Ubuntu will be called "oU" and the clone "oUextended"

  • on oU menu halt ubuntu (or stop oU using VirtualBox)
  • on virtualbox : right clic on oU, then (context menu) clone "oU" 
    • name the clone "oUextended" (or wathever you want)
  • on host under a shell : go under oUextended directory and use this command to extend for example to 25GB the hard drive :
 c:\Users\myuser\VirtualBox VMs\UBUNTU_EXTENDED_25G>"c:\Program Files\Oracle\Virtual Box\VBoxManage.exe" modifyhd UBUNTU_EXTENDED_25G.vdi --resize 25625  

  • on virtualbox : oUextended/configuration you should show the hard drive size : 25G (==25625MB)
  • on virtualbox : oUextended/configuration you should assert booting on CD before hard drive

  • go to and download the last stable gparted ISO
  • on virtualbox : oUextended/configuration/storage : add a CD and select gparted iso
  • on virtualbox : start oUextended
  • on oUextended : boot menu : select the first and default choice : "GParted Live"
  • on oUextended : anwer gparted question (depending of your preferences) : eg. keyboard azerty / fr / PC Keyboard / 08 French / (0)
  • on oUextended : select the parent ("extended") of the partition you would like to extend : right clic on it / resize / extend to the full free size

  • on oUextended : the parent ("extended") of the partition should have 24Gio size
  • on oUextended : select the partition you would like to extend : right clic on it / resize / extend to the full free size

  • on oUextended : the partition should have 24Gio size
  • on oUextended : clic on "Apply" / wait the operations to finish / clic "Close"
  • on oUextended : clic on "Exit" on the gparted desktop; then select "shutdown" / enter
  • on virtualbox : oUextended/configuration/storage : remove gparted iso CD (should be an empty CD)
  • on virtualbox : start oUextended
Assert the result on ubuntu xterm :
df -kh


Aucun commentaire:

Enregistrer un commentaire

Mots clés du blog

10.1 4G acceptancetest adb androï Android androïd Android7 api appender appengine application applications archive array assistantematernelle astuce auth0 authentication authority automation Axis bash bearer blog boot bootloader bower build bundle c calendrier camille combal cdi certificate cf client cloudfoundry collaboratif command commandes connexion console css cyanogen decrypt démasquées démasquer développement dll dump easter eggs écologie écrit employeur EMUI EMUI5.0 encrypt enfant évènement export-package ExtJS fab fastboot fiche find firefox gadget galaxytab gelf gem git gmail gnupg gooelappengine google gparted gpg gpg2 gps graylog grenoble Grid gui harddrive heroku hover howto HTML http https IE ihm immobilier imprimante innovation insolite instance integration Java JavaScript jenkins jeu jobs json json-schema-validator key keystore labs linux livre log log4j logger logs lombok masquées masquer maven maven-gae-plugin Mémoire microsoft mobile mockito mondialisation monitor MUSE musique en ligne myopera nodejs npm NT NTEventLogger onglet openstack osgi paas package parameters parent php politique prosyst prototype proxies proxy quartz radio rappel recherche regex repository resize RIA ridge rock ROM route ruby rubygems s8500 samsung scheduler scm secret secure sel selenium Serializer server shared shell sign signature slf4j smartphone so société song spy ssh ssl struct swagger swig tâches téléphone téléréalité test thunderbird timeout token Tomcat tooltip tooltips truststore TWRP ubuntu unit test validator verify virgin virtualbox wave waze web WebApp wiki wikimedia wikipédia wikipen wiko windows yahoo youtube yum