How to re-size a VirtualBox Virtual machine

How to re-size a VirtualBox Virtual machine

forex arab I have recently had to re-size my Ubuntu development VM twice as I keep adding Drupal sites and their files to my local dev environment. 

كيفية شراء وبيع الاسهم السعودية It is basically pretty simple but can be quite time consuming, I am writing this as I wait for one of the steps to complete myself! 

follow site I have just installed a new hard drive for the new VM so I am moving the location of the "Default Machine Folder" as will from the VirtualBox GUI, doing this before making the initial clone is the easiest way to do so. I am planning on using as much of the newly mounted drive as possible so I don't have to do this for a very long time. 

الخيارات الثنائية عصام التداول go to link Step 1 (Optional)
Clone your existing VM so you can always go back to the original if something goes wrong. If you want to change the default location of your VMs beforehand to a new hard drive for example this is the right time to do so, just go to " http://investingtips360.com/?klaystrofobiya=%D8%B4%D8%B1%D8%A7%D8%A1-%D8%B3%D9%87%D9%85&037=87 File > Preferences" and enter the new location before starting the clone operation.

click here http://theshopsonelpaseo.com/?syzen=%D8%A7%D8%B3%D8%B9%D8%A7%D8%B1-%D8%A7%D9%84%D8%A8%D9%8A%D8%B9-%D9%88%D8%A7%D9%84%D8%B4%D8%B1%D8%A7%D8%A1-%D8%A7%D9%84%D8%B0%D9%87%D8%A8-%D9%81%D9%8A-%D8%A7%D9%84%D8%B3%D8%B9%D9%88%D8%AF%D9%8A%D8%A9&446=1a Step 2 (Optional)
Start up your cloned VM just to make sure everything is happy and you won't waste any time resizing a broken VM. If you did change the location of the VirtualBox default machine folder your new VMDK files will be in the new location.

source link follow link Step 3 
So now we need to clone the VMDK file to a VDI file using VBoxManage on the command line. Open a command prompt, CD to your new default machine folder and type the following:

follow url http://skylarkstudios.co.uk/?pomulyyko=%D8%AE%D9%88%D8%A7%D8%B1%D8%B2%D9%85%D9%8A%D8%A9-%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9-%D8%A7%D9%84%D8%AE%D9%8A%D8%A7%D8%B1&46d=e6 "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd "oldname.vmdk" "newname.vdi" --format vdi 

The reason we have to do this is that the VBoxManage application can not re-size a VMDK disk image.

follow Step 4 
The next step is to re-size the disk with the modifyhd application, the numeric parameter in the example below is the number or MB to re-size it to so if you need 450GB the number you need is the result of (450*1024). 

 http://jesspetrie.com/?amilto=%D8%AB%D9%86%D8%A7%D8%A6%D9%8A-%D8%AE%D9%8A%D8%A7%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%AA%D8%AF%D8%A7%D9%88%D9%84-%D8%A7%D9%84%D9%85%D9%85%D9%84%D9%83%D8%A9-%D8%A7%D9%84%D9%85%D8%AA%D8%AD%D8%AF%D8%A9 "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "newname.vdi" --resize 460800 

For more information about this part of the procedure have a look here or just search Google for "Expand a vmdk file". 

توصيات الاسهم السعودية Step 5 
Now you should have a VMDK and a VDI image of exactly the same VM. Now just configure your VM to use the VDI instead of the VMDK using the VirtualBox GUI. Go to " get link Settings > Storage" and remove the VMDK and add the existing VDI. 

You can delete the VMDK file once you have done this if you are planning on using as much of the available space as possible it is probably a good idea!

go Step 6 
Now attach a GParted ISO to the IDE controller of your VM in the GUI and boot in to GParted to assign all that unallocated space to your VM's hard disk.

http://sejrup-it.dk/?centosar=%D8%A7%D9%84%D8%B3%D9%88%D9%82-%D8%A7%D9%84%D8%B3%D8%B9%D9%88%D8%AF%D9%8A-%D8%AA%D8%AF%D8%A7%D9%88%D9%84&af0=df Step 7 
Now boot the VM to the main OS and if you are using Ubuntu you will have to re-size the LVM and file system. Find out the name using "fdisk -l" and "vgdisplay" commands.

Having determined the available free space you have to add to your system do the following:

lvextend -l +9999 /dev/sda2/your-lv-name
resize2fs -p /dev/sda2/your-lv-name

You should now be able to see the extra space available in your file system with "df -h"

Enjoy

Useful Links

Comments

1

I have been trying to get that right for ages, this really helped!

Comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.