{"id":288,"date":"2010-12-27T16:43:30","date_gmt":"2010-12-27T21:43:30","guid":{"rendered":"http:\/\/blog.alanporter.com\/?p=288"},"modified":"2010-12-27T16:43:30","modified_gmt":"2010-12-27T21:43:30","slug":"how-to-resize-a-virtualbox-disk","status":"publish","type":"post","link":"https:\/\/alanporter.com\/blog\/2010\/12\/27\/how-to-resize-a-virtualbox-disk\/","title":{"rendered":"How to resize a VirtualBox disk"},"content":{"rendered":"<p>I primarily run Linux, but occasionally need to run something in Windows.\u00a0 So I use the open source VirtualBox program to run Windows XP in a box (where it belongs).<\/p>\n<p>Most of the time, I create a new VM for a specific task.\u00a0 For example, around tax time, I might create a VM that has nothing in it except WIndows XP and Turbo Tax or Tax Cut &#8212; or better yet &#8212; Tax Act.\u00a0 To make this a little easier, I create a VM that has a fresh copy of Windows XP on a 10GB hard disk, and then I made a compressed copy of the disk image file.\u00a0 It compresses nicely down to 700MB, just about right to fit on a CD.\u00a0 So step one of doing my taxes is to copy this disk image file, uncompress it, and create a new VM that uses that disk.<\/p>\n<p>That is, I treat the Windows OS as <em>disposable<\/em> &#8212; create a VM, use it, save my files somewhere else and then throw the VM away.<\/p>\n<p>Every once in a while, though, I need more than the 10GB that I originally allocated to the VM.\u00a0 For example, iTunes usually needs a lot more storage than that.\u00a0 So I need to resize the Windows C: drive.\u00a0 It turns out that this is very easy to do with the open source tool &#8220;<strong>gparted<\/strong>&#8220;.\u00a0 This comes included in Ubuntu Live CD&#8217;s, so I just boot the VM into an Ubuntu Live CD session and prepare the new, larger disk.<\/p>\n<p>Here&#8217;s the step-by-step, gleefully stolen from the <a href=\"http:\/\/forums.virtualbox.org\/viewtopic.php?t=585\">VirtualBox support forums<\/a>.<\/p>\n<ul>\n<li>Make sure you have an Ubuntu Live CD, or a &#8220;<a href=\"http:\/\/www.sysresccd.org\/Download\">System Rescue D<\/a>&#8220;.<\/li>\n<li>Create a new hard disk image (*.vdi file) using Virtual Disk Manager.\u00a0 In VirtualBox, go to <em>File<\/em> \/ <em>Virtual Disk Manager<\/em>.<\/li>\n<li>Set your current VM to use the new disk image as it&#8217;s second hard disk and the Ubuntu Live CD (or System Rescue CD) ISO file as it&#8217;s CDROM device.<\/li>\n<li>Boot the VM from the CDROM.<\/li>\n<li>If you&#8217;re using the System Rescue CD, start a graphical &#8220;X-windows&#8221; session by typing <code>startx<\/code> at the command prompt.<\/li>\n<li>When your X-windows starts up, open up a terminal and type <code>gparted<\/code>.<\/li>\n<li>You&#8217;ll need to create a partition on the new disk.\u00a0 So in gparted, select the new disk and the <em>Device<\/em> \/ <em>Create Partition Table<\/em>.<\/li>\n<li>Then select the windows partition and choose <em>copy<\/em>.<\/li>\n<li>Select the second hard disk, right click on the representation of the disk and click <em>paste<\/em>.<\/li>\n<li>Gparted will prompt you for the size of the disk, drag the slider to the max size.<\/li>\n<li>Click apply and wait&#8230;<\/li>\n<li><strong>Important<\/strong> &#8211; when it is done, right click on the disk and choose <em>Manage Flags<\/em>, and select <em>Boot<\/em>.<\/li>\n<li>Exit gparted and power off the VM.<\/li>\n<li>Change the VM settings to only have one disk (the new bigger disk) and un-select the ISO as the CDROM.<\/li>\n<li>Boot the VM into your windows install on it&#8217;s new bigger disk!\u00a0 The first time it boots up, Windows may do a disk check and reboot.<\/li>\n<\/ul>\n<p>Once you&#8217;re happy with the new larger disk, you might want to delete the old, smaller one.<\/p>\n<p>This method should work the same, regardless of whether the host OS is Linux, Windows or Mac OS.<\/p>\n<p>Keep that Ubuntu Live CD around &#8212; it really comes in handy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I primarily run Linux, but occasionally need to run something in Windows.\u00a0 So I use the open source VirtualBox program to run Windows XP in a box (where it belongs). Most of the time, I create a new VM for a specific task.\u00a0 For example, around tax time, I might create a VM that has [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,15],"tags":[],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-software","category-tips-tricks","count-0","even alt","author-alan","last"],"_links":{"self":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/comments?post=288"}],"version-history":[{"count":0,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/posts\/288\/revisions"}],"wp:attachment":[{"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/media?parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/categories?post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alanporter.com\/blog\/wp-json\/wp\/v2\/tags?post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}