Tuesday, 25 June 2013

Extending a Windows XP partition in VirtualBox

The Problem

My desktop computer runs Ubuntu Linux (on a Mac Mini!), but sometimes I am forced to use Microsoft Word to edit a document that LibreOffice/OpenOffice Writer can't handle, or use iTunes (ech.) to fix the kids' iPad. To do this I use the excellent VirtualBox software to run an Windows XP virtual machine within Ubuntu. I originally created a 10GB virtual disk image, but soon realised that wasn't enough space if I wanted to also backup the 64GB iPad completely. Fortunately, VDI disk images can be increased in size, but my Googling resulted in a variety of methods which were all a bit confusing, so this post summarises what I had to do for my exact situation, which I didn't come across anywhere else.


My Situtation

  • Aim: Grow my disk image storage from 10GB to 80GB
  • Partition type: NTFS
  • Host operating system: Ubuntu 13.04
  • Virtual operating system: Windows XP SP3

How to do it


  1. Locate the disk image: On Ubuntu, VirtualBox stores your machine data in "$HOME/VirtualBox VMs" by default. In there find the appropriate .VDI file. Mine was called "WinXP.vdi".
  2. Expand the VDI image: 
    On Ubuntu you use the "VBoxManage" command to do this. You do not need to "sudo" or be root as the files are all owned by you. This is the command I used to increase it to ~80GB:
    VBoxManage modifyhd "$HOME/VirtualBox VMs/WinXP.vdi" 81920
  3. Extend the NTFS partition: Although you've extended the physical disk image, Windows XP still only thinks it has 10GB because the original partition on the disk was 10GB. We need to extend the NTFS partition into the new space we made. Because I only have one partition which has the operating system and all my data, you can't do this from within Windows XP itself. You need to boot something else to modify the partition. I downloaded the free GParted Live CD ISO image and attached it to my virtual machine using the Settings and Storage menu on Virtual Box. I also made sure the virtual CD-ROM was in the boot order before the VDI image.
    After starting the machine, the GParted interface eventually booted. I could see my 80GB disk with a 10GB NTFS partition on it. I chose the partition, and clicked "Resize" and typed in the full size of the disk (81920 MB). After clicking extend, it only took a few seconds to complete.
  4. Reboot Windows:
    I shut down the machine, removed the ISO image from the Storage menu, and restarted it. Windows XP started up "
    chkdsk" as it noticed something had changed :-) I had no errors or issues, and examination of drive C: showed it was now 80GB in size.  Done!

Conclusion

Virtual machines and virtual disk images are awesome. I'm glad to be finished with meddling with multi-boot and repartitioning real disks. I hope this post was helpful to you.

10 comments:

  1. Useful post!
    I also used a VM to boot windows for such things, but recently I thought I should give a try to running windows apps under Wine.
    MS Office 2010 runs flawless in Ubuntu 13.04, as many other windows games (some quite resource consuming), just after installing two dependencies through wine.
    No more VMs or dual-boot for me :)

    ReplyDelete
  2. I had problems running MS Office 97 and 2003 under Wine, and did not try it again. But maybe things have improved the last few years. I will try it again soon. Thank you for the informations, as Wine is much simpler than VMs.

    ReplyDelete
  3. hi ,am using GPArted Live CD,i want to resize the partition inside VM.It gets booted but the user interface is not coming to resize.What to do ?

    ReplyDelete
    Replies
    1. You only resized the partition underneath. The filesystem is still the old size. You need to resize the filesystem now. e2resize, xfs_resize etc.

      Delete
  4. Kamala McLearan
    Hello Everyone! I'm here to explore blogs and forums about the wonderful and most safe cure for Herpes Simplex Virus(HSV). I was positive to the herpes virus and I lost hope because I was outcast and rejected even by my closest friends. I searched online to know and enquire about a cure for HERPES and I read someone testimony on how she was cured from HSV-2, So I decided to contact the same herbalist because I know that nature has the power to heal everything. I contacted Dr Kham Remedies to know how he can help me and he told me never to worry that he will help me with the natural herbs from God! After 2 days of contacting him, he told me that the cure has been ready and he sent it to me via DHL and it got to me after 3 days! I used the med as he instructed me Twice Daily For Two weeks (MORNING and EVENING) and i was cured! it's really like a dream but i'm so happy! That's the reason I decided to also add more comments of Him so that more can be saved just like me and if you need his help, you can email him on dr.khamcaregiver@gmail.com or visit him on website at: https://linktr.ee/doc_kham

    ReplyDelete

  5. Who are the Best Bitcoin Recovery Experts? Cryptocurrency Tracing and Recovery | Hire A Hacker for crypto recovery

    Alpha Recovery Experts are a trusted and reliable solution for individuals seeking to recover lost or inaccessible cryptocurrency assets. With a team of expert cryptographers and cybersecurity specialists, the recovery expert utilizes cutting-edge technology to navigate the complexities of blockchain forensics and retrieve lost or stolen digital assets. ALPHA RECOVERY EXPERTS proprietary recovery protocols are designed to ensure the utmost security and confidentiality, providing his clients with peace of mind throughout the recovery process. Whether you've lost access to your wallet, forgotten your private keys, or fallen victim to a phishing scam, ALPHA RECOVERY EXPERTS are dedicated to helping you regain control of your cryptocurrency portfolio. The customer-centric approach, combined with their unparalleled technical expertise, has earned the team a reputation as a go-to solution for cryptocurrency recovery. Don't let lost or inaccessible assets hold you back - contact Alpha Recovery Experts today to take the first step towards recovery.

    For More inquiries, contact them at,
    Email; Alpharecoveryexpert@consultant.com
    Homepage; Alpharecoveryexperts.com

    ReplyDelete
  6. When I realized that a substantial amount of Bitcoin had been moved from my wallet without my knowledge or authorization, I felt completely overwhelmed. Those funds represented years of hard work, careful planning, and personal investment. At that moment, I believed everything was gone for good, and I had little hope of ever recovering my assets.After spending countless hours searching for a trustworthy recovery service, I
    WhatsApp:======https://wa.link/vkk2xt
    came across Pro Wizard Gilbert Recovery. From my very first interaction with their team, I felt reassured by their professionalism, transparency, and willingness to understand the details of my situation. They carefully reviewed my case, explained the recovery process in clear terms, and kept me informed throughout every stage of the investigation.The recovery process required patience and persistence, but the team demonstrated exceptional dedication and technical expertise from start to finish. They worked diligently to trace the transactions, analyze the available blockchain data, and pursue every possible avenue to assist with my case.To my immense relief, their efforts resulted in the successful recovery of a significant portion of my lost Bitcoin. Receiving that news was an incredible moment—one that restored not only my assets but also my confidence and peace of mind after months of uncertainty and stress.I am deeply grateful to Pro Wizard Gilbert Recovery for their commitment, professionalism, and unwavering support. Their team stood by me during one of the most challenging financial experiences of my life and provided guidance every step of the way. I highly appreciate the dedication they brought to my case and the positive outcome they helped achieve. Thank you, Pro Wizard Gilbert Recovery, for helping me recover what I feared was lost forever.

    EMAIL========== pro wizard gilbert recovery (@) engineer. com

    TELEGRAM====== http s:// t. me/Pro_Wizard_Gilbert_Recovery

    ReplyDelete

  7. RECLAIM STOLEN CRYPTO with ALPHA RECOVERY EXPERTS - Crypto Tracing and Recovery Services

    Have you been duped or lost your cryptocurrency due to a fraudulent exchange, phishing attack, or online investment scam? You are not alone, and recovery is possible. Alpha Recovery Experts are ready to assist you recover your stolen digital assets in a safe and effective manner. Their skilled team has extensive expertise tracking, investigating, and recovering missing cryptocurrencies such as Bitcoin, Ethereum, USDT, and other prominent digital currencies. If you happen to have lost your funds to crypto scams, Embark on a journey to reclaim your lost Bitcoin with Alpha Recovery Experts.

    Get in touch With Alpha Recovery Experts through;
    Website Alpharecoveryexperts.com
    Email Add; Alpharecoveryexpert@consultant.com
    WhatsAp; +44(745-742-4681).

    ReplyDelete

  8. Legitimate Crypto Recovery Services - Go to ALPHA RECOVERY EXPERTS

    Alpha Recovery Experts has built a reputation for providing specialized cybersecurity and ethical hacking services aimed at helping clients address complex digital asset challenges. One of the key factors that sets Alpha Recovery Experts apart is its focus on ethical hacking methodologies. Ethical hacking involves the use of authorized security techniques to identify vulnerabilities, investigate incidents, and support recovery efforts while adhering to legal and professional standards. By combining technical expertise with a structured investigative approach, the company works to assist clients in understanding what happened to their digital assets and what recovery options may be available.

    In addition to recovery services, Alpha Recovery Experts emphasizes cybersecurity awareness and risk mitigation. The company recognizes that preventing future incidents is just as important as addressing existing problems. Through security assessments, best-practice recommendations, and educational guidance, clients can gain valuable insights into protecting their cryptocurrency wallets, accounts, and sensitive digital information from evolving cyber threats.

    For individuals and organizations seeking support with cryptocurrency-related security concerns, the company positions itself as a resource focused on technical expertise, ethical practices, and client-centered solutions.

    WhatsApp; +44(745)742-4681
    Email: (Alpharecoveryexpert@consultant.com)

    ReplyDelete