My Linux VirtualBox guest OS often runs out of space – I never learn that to build anything in Linux, you need about 10 times the amount of space that you think you need. Also, VirtualBox recommends very small default values, so it is easy to be caught out. Anyway, here are the current steps to re-size a VirtualBox disk, where Linux is the guest OS and Windows is the host OS. In this example I am using VirtualBox 4.2.6 (The approach is valid with more recent versions also). The host OS (the one that is running VirtualBox) is Windows 7 and the guest OS that I wish to re-size is Ubuntu. Please backup everything before continuing as something could always go wrong. Is is possible to convert a.vdi file into a.iso that can be burned to a cd or dvd and make it like an installer. Or Is it possible to convert virtual machines to physical environments? VBoxManage.exe storageattach ' --storagectl IDE --port 0 --device 0 --type dvddrive --medium 'X: Folder containing the.iso' Detach a disk image file To detach an image file the syntax is similar: you just need to replace the file path with 'none'. (Optional) Move the VDI file in Windows If you need to move the VDI file to another location/physical drive with more space, you can do the following. • With VirtualBox shut down, using Windows Explorer move your vdi file (e.g., “ c: MyLinux.vdi“) to its new location (e.g., “ d: MyLinux.vdi“) • Start Oracle VM VirtualBox Manager -> choose File-> “Virtual Media Manager” • Under the “Hard drives” tab, choose your disk (e.g. “ MyLinux.vdi“) and press the “Release” button at the top. • Now with the disk selected press “Release” (this should remove the last location) • Close “Virtual Media Manager”, choose your VirtualBox instance (e.g. Google play store 4.4.4 apk download. MyLinux which should say “Powered Off” underneath) and press the “Settings” button at the top. • Press”Storage” on the left-hand side, and under Controller remove the current drive by pressing the red minus. Then Press the + with the hard drive platters. • It should ask “You are about to add a virtual hard disk to the controller IDE Controller”, pick “Choose existing disk” and browse to the location to which you moved your VDI image (e.g. “ d: MyLinux.vdi“). Press “OK” • Check that your image boots before you go any further. Resize the VDI file • Shut down VirtualBox again. • Make a copy of the VDI file – just in case (“ MyLinux.vdi” -> “ MyLinuxCopy.vdi“) • Go into the Windows command prompt (Start->type “ cmd” into the box) • cd to the location of the VDI file that you wish to resize, e.g., “ d: MyLinux.vdi“ • At the Windows command prompt, type: D: > VBoxmanage modifyhd MyLinux.vdi --resize 100000 this will re-size the drive to 100 GB. Pick a value that suits you. Note, your vdi file will not change in size at this point. The output should look like: D: > VBoxmanage modifyhd MyLinux.vdi --resize 100000 0%.10%.20%.30%.40%.50%.60%.70%.80%.90%.100% D: > Unfortunately that was the easy part! Resize the Linux Partition At this point you need to grow the Linux partition to take up the space of the newly resized vdi file: • Go into “Oracle VM VirtualBox Manager”, choose your Linux image “MyLinux (Powered Off)”. Press “Settings” and under “Storage” when you select your disk you should see “Virtual Size: 97.66GB” for the 100GB that I set and “Actual Size: 18.52GB” if your previous disk was 20GB and now almost out of space!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |