rss

How to resize a VirtualBox Ubuntu vm hard drive

HowTo : resize ubuntu vm hard drive hosted on Virtual Box

Pre-requisites

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  
 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%  

  • 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 http://gparted.sourceforge.net/download.php 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

Resources


Aucun commentaire:

Enregistrer un commentaire

Mots clés du blog

acceptancetest androï Android androïd Android7 api appender appengine application applications archive array assistantematernelle astuce auth0 authentication authority automation Axis bash bearer blog bower build bundle c calendrier camille combal cdi certificate cf client cloudfoundry collaboratif command commandes connexion console css démasquées démasquer développement dll dump easter eggs écologie écrit employeur EMUI EMUI5.0 enfant évènement export-package ExtJS fiche find firefox gadget gelf gem git gmail gooelappengine google gparted 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 rock route ruby rubygems s8500 samsung scheduler scm sel selenium Serializer server shared shell 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 ubuntu unit test validator virgin virtualbox wave waze web WebApp wiki wikimedia wikipédia wikipen windows yahoo youtube yum