How can I resize my Virtual Machine, it is only 10GB and I need probably 50GB for this.
Is it easy to resize the image?
|
How can I resize my Virtual Machine, it is only 10GB and I need probably 50GB for this. Is it easy to resize the image?
| ||||
|
feedback
|
|
No easy way, I'm afraid. I had to do the same thing last week and this is the only help that I got to: http://crookedspoke.wordpress.com/2008/03/15/resize-disk-image/ This is what you've got to do:
| |||||||||
feedback
|
|
You want (at least wanted year and a half ago) to resize virtual disk used by your virtual machine. You're using VirtualBox, so it's most likely a VDI file. VDI files can be fixed or dynamic. Fixed one has all blocks (units of data in VDI files, each one has 1MB by default) allocated from the beginning, so 10GB image's size is 10GB (a bit more actually, because you have some metadata, but it would be presumably even less than 50KB in your case). Dynamic file grows as you write to it, at the beginning having 0 preallocated blocks (VDI consists only of metadata). PrefaceI describe only expanding of the image. It's up to you what you'll do with a new space. Your partitions with file systems can be resized after expanding or you can create new partitions. It's a separate problem, but Tomas Sedovic pointed you to GParted Live CD, which can help you in performing such tasks. Personally I prefer Parted Magic, because it has other useful tools on ISO. Expanding fixed VDIIf you have fixed VDI, then you can use my little tool called vidma - Virtual Disks Manipulator. There is ready to use Vidma supports resizing in-place, i.e. it can resize your image without creating new file. In your case it would mean that you need only 40GB and a few MBs of free space to expand your image from 10GB to 50GB. It's very useful (and the main reason I wrote this tool), but if anything goes wrong (Murphy's laws are merciless) and you don't have copy of your image, then you have a real problem. That's why it's not recommended, especially for inexperienced users. To continue you must have 50 GB and a few MBs of free space.
Before deleting old image, you should carefully check whether newimage.vdi works without problems.
Expanding dynamic VDISince VirtualBox 4 you can resize dynamic VDI using
This command expand VDI file to 51200MB, i.e. 50GB. It will be done in-place and number of allocated blocks won't be increased, so you don't really need additional 40GB, but it's obviously required to be able to fully utilize resized image. EDIT To get a better grasp of | ||||
feedback
|
|
Consider the easiest thing to do: add another virtual hard drive. 10GB is sufficient for a "system" partition, even for Windows. Then you add a 50GB "d:" drive. In VirtualBox you just use the Virtual Media Manager, make the drive, and add it to your machine. Advantage: you can revert it independently of the system partition. You can even wipe and reinstall the system partition and not have your "data" partition be affected. Another one is that you can use it in more than one virtual machine (not at once, I think), INCLUDING a Windows AND a Linux guest. Nice! If Windows is your guest OS, 10GB is enough for Windows and any other "uncool" Windows programs (most) which install all kinds of stuff in the registry and in the Windows directories. Some stuff can be installed on the data partition, like graphics libraries for programs etc. | |||
|
feedback
|
|
This articles gives step-by-step instructions on how it can be done with screenshots. There is also another good article on how to do this here. | |||||||
feedback
|