Wednesday, February 20, 2008

Expanding a VMWare Virtual Disk

My primary OS is Linux but I have VMWare machines with Windows and other OSes, for testing of tools and softwares.

I keep a basic installation of the Windows OS (XP, Server, etc) in a VMWare machine and keep it updated and patched. Whenever I need to do a software evaluation, I simply use a copy of the basic installation. In this way, I don't spend time re-installing the basic OS for every test.



Today I was in the need to install various softwares which require several GB more than what I have pre-allocated in my basic installations. (I still does not understand what is with so many software coded for Windows the it requires to be installed on "C:". I have always found that so absurd!!! But that is not what I am talking about here.)

So, bottom line, I need to expand the Virtual Disk. After a short search I found that it is actually quite easy. Since I know I will be doing it again in the future I want to have it documented here:
  1. Stop the virtual machine
  2. Identify your virtual disk. Lets call it "mydisk.vmdk"
  3. VMWares have the Virtual Disk manager tool, so lets expand the disk to 20 GB. For that, you will have to do "vmware-vdiskmanager -x 20Gb mydisk.vmdk"
  4. You will see a progress indication showing you that it is doing what you ask.
  5. Once it finish you will need to make the host OS (in this case Windows) to recognize the new capacity of the Virtual Disk
  6. The easiest way to do this is to load the Virtual Disk as a secondary in another Windows VM
  7. Boot the Windows machine a run "diskpart" Windows utility
  8. Here, you can do "list disk" to see the actual disks assigned to your virtual machine
  9. Now identify your new volume "list volume" and select the proper one "select volume=#"
  10. Finally extend it executing the "extend" command
  11. Shutdown the VM and remove the disk.
  12. Boot the VM with the new extended hard disk.
  13. Done.
Following these simple steps you will be able to expand or decrease the size of a virtual hard disk of a VMWare Windows machine. A similar procedure is used with other OS except that you must identify the proper partition manager tool or third party tool.

A more detailed explanation is available here.
{"cc_re__cc_re__cc_by_sa_3_0": ["p-bottom'>\n<div class='cap-left'></div>\n<div class='cap-right'></div>\n</div>\n</div>\n<footer>\n<div class='footer-outer'>\n<div class='footer-cap-top cap-top'>\n<div class='cap-left'></div>\n<div class='cap-right'></div>\n</div>\n<div class='fauxborder-left footer-fauxborder-left'>\n<div class='fauxborder-right footer-fauxborder-right'></div>\n<div class='region-inner footer-inner'>\n<div class='foot section' id='footer-1'><div class='widget Text' data-version='1' id='Text1'>\n<div class='widget-content'>\n<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"http://i.creativecommons.org/l/by-sa/3.0/80x15.png\" /></a> This <span dct=\"http://purl.org/dc/terms/\" href=\"http://purl.org/dc/dcmitype/Text\" rel=\"dct:type\">work</span> by <a cc=\"http://creativecommons.org/ns#\" href=\"http://www.monids.org/\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">William Caban</a> is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\">Creative Commons Attribution-Sha", "'>\n<div class='widget-content'>\n<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"http://i.creativecommons.org/l/by-sa/3.0/80x15.png\" /></a> This <span dct=\"http://purl.org/dc/terms/\" href=\"http://purl.org/dc/dcmitype/Text\" rel=\"dct:type\">work</span> by <a cc=\"http://creativecommons.org/ns#\" href=\"http://www.monids.org/\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">William Caban</a> is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.\n</div>\n<div class='clear'></div>\n<span class='widget-item-control'>\n<span class='item-control blog-admin'>\n<a class='quickedit' href='//www.blogger.com/rearrange?blogID=7159031268574632404&widgetType=Text&widgetId=Text1&action=editWidget&sectionId=footer-1' onclick='return _WidgetManager._PopupConfig(document.getElementById(\"Text1\"));' target='configText1' title='Edit'>\n<img alt='' height='18' src='https://resources.blogblog.com/i"]}