Before doing any change to your disks, it is highly recommended to make a backup of your disks images. Keep in mind that I’m only listing the steps I’ve followed to re-size a virtual box guest disk. You may find other problems I have not had. Do it at your own risk.
I am on a Linux host machine, but commands should be the same on Windows hosts.
You will need to boot your virtual machine with a GParted Live distribution (or any other Linux Live with Gparted like Ubuntu). If you don’t have the iso start by downloading it from here (~130MB):
http://sourceforge.net/projects/gparted/files/gparted-live-stable/
Store it somewhere in your host disk.
Step1 – resize your actual virtual disk
VirtualBox has a powerful command line tool: VBoxManage. I am going to use it.Go to where you store your virtual machine disk. In my case it is called winXP.vdi. To resize it to 20GB:
1 | VBoxManage modifyhd winXP.vdi --resize 20000 |
Step2 – Clone your actual virtual disk
We are going to clone our actual disk to a new one cloning all the contents:1 | VBoxManage clonehd winXP.vdi winXP20.vdi |
Step3 – Replace your VM current disk with the cloned one
First you need to know your Virtual Machine name. VBoxManage has a modifier to list all virtual machines on the system:1 | VBoxManage list vms |
1 | VBoxManage modifyvm "VirtualMachine Name" --hda none |
2 | VBoxManage modifyvm "VirtualMachine Name" --hda winXP20.vdi |
Step4 – Boot with Gparted to resize partition
Through GUI, set your virtual machine CD/DVD to load the GParted Live iso you have downloaded and check that CD/DVD will be the first media to use on boot.Boot your virtual machine and follow instructions on screen. It will appear something similar to:
Select your partition, right click on it and select resize/move:
Once selected your changes, apply them:
If next error happens, simply boot into WinXp normally, run chkdsk and then boot again into GParted to resize the partition.
If you are trying to resize main disk, WinXP will ask to perform action on reboot, as it needs unique access to HDD
To be able to boot into WinXp, select the option on Grub or simply remove the iso file from the CD/DVD.
Không có nhận xét nào:
Đăng nhận xét