Thứ Ba, 29 tháng 1, 2013

Resize VirtualBox disk for WinXP guest

Resizing a virtualbox virtual disk is not a trivial task. Although it has a direct method to resize the virtual disk, it involves several steps to make Windows XP guest OS realize about this change. I will show all steps needed to increase the size of a Windows XP guest OS.


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:
1VBoxManage modifyhd winXP.vdi --resize 20000
This changes your virtual disk file to be able allocate 20000MB.

Step2 – Clone your actual virtual disk

We are going to clone our actual disk to a new one cloning all the contents:
1VBoxManage clonehd winXP.vdi winXP20.vdi
This will take some time depending on the amount of data of your disk.

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:
1VBoxManage list vms
Once you identify your virtual machine name or UUID (a lot of hexadecimal numbers) you can replace your current disk through command line (you can do it also through the GUI)
1VBoxManage modifyvm "VirtualMachine Name" --hda none
2VBoxManage 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

Học lập trình web căn bản với PHP

Bài 1: Các kiến thức căn bản Part 1:  https://jimmyvan88.blogspot.com/2012/05/can-ban-lap-trinh-web-voi-php-bai-1-cac.html Part 2:  https://...