Page 1 of 1

Adding a Hard Disk to a VM

Posted: 22. Oct 2011, 20:22
by Freedomcoach
I successfully created a Windows XP.vdi from a raw file, added it to Virtual media manager and compressed it using VBoxManage. Now I would like to add or assign this disk to an existing VM and make it bootable. I am not sure how to do this. It looks like I can do it with a combination of VBoxManage storagectl XXXX followed by VBoxManage storageattach. I'd appreciate some help in doing this. Maybe there is an easier less techy method. Also, it would be great if there was some way to test the Windows XP.vdi to see how it is working. Thanks.

Re: Adding a Hard Disk to a VM

Posted: 22. Oct 2011, 20:57
by Sasquatch
Did you read the User Manual yet? That describes what you want to do. You don't need to go the command line way, the GUI works just as well. If you don't have a VM yet, create one, tell it you have an existing VDI and look it up. If you already have a VM, just open the Storage section and add a VDI. Then tell it you want to attach an existing one.

Re: Adding a Hard Disk to a VM

Posted: 22. Oct 2011, 21:49
by Freedomcoach
Thanks, it worked. I was on track before but having difficulty navigating to the right place. Now I want to change the hard disk boot order and use the new hard drive as a boot disk. Not sure how to do this. Can you tell me? I did check the manual and have been continually striving to be as self sufficient as possible.

Re: Adding a Hard Disk to a VM

Posted: 22. Oct 2011, 23:11
by Sasquatch
You can only decide the boot order by either changing the attached disk order in the Storage section, or use F12 when the VM starts to select the disk to boot from. Keep in mind that the bootloader on the disk points to a certain disk too. Others have had issues with that, where one was unable to boot the other OS if the first was the primary disk. That is due to the MBR and bootloader pointing to a set disk.

Re: Adding a Hard Disk to a VM

Posted: 23. Oct 2011, 04:24
by Freedomcoach
Sasquatch, I was successful in booting to the primary slave using F12 but am not seeing how to change the boot order in the storage area.

I only see the ability to add or delete drives but not change the order. Tell me if I'm missing something. Do I need to delete the present master and then add it back in as a primary slave? The primary slave is the vdi disk. The primary master is the old vmdk disk which I'd like to remove. By switching the order I'm able to work with the vdi disk long term which is my preference.

Re: Adding a Hard Disk to a VM

Posted: 24. Oct 2011, 11:26
by mpack
Freedomcoach wrote:Sasquatch, I was successful in booting to the primary slave using F12 but am not seeing how to change the boot order in the storage area.
Detach the drives from the storage controller. Add them back in preferred order.

Re: Adding a Hard Disk to a VM

Posted: 24. Oct 2011, 21:21
by Sasquatch
Freedomcoach wrote:Sasquatch, I was successful in booting to the primary slave using F12 but am not seeing how to change the boot order in the storage area.

I only see the ability to add or delete drives but not change the order. Tell me if I'm missing something. Do I need to delete the present master and then add it back in as a primary slave? The primary slave is the vdi disk. The primary master is the old vmdk disk which I'd like to remove. By switching the order I'm able to work with the vdi disk long term which is my preference.
So you didn't see the 1 and 2 in the F12 menu that show the two HDDs as a choice to boot from?

Re: Adding a Hard Disk to a VM

Posted: 25. Oct 2011, 14:59
by Leak
Sasquatch wrote:So you didn't see the 1 and 2 in the F12 menu that show the two HDDs as a choice to boot from?
Seeing as he was able to boot from the primary slave using F12 I'm pretty sure he did, but all regular BIOSes I've come across not only allow you to define the boot order in terms of Floppy/HDDs/Network/etc. like VirtualBox does but also allow you to configure which hard drive to actually boot from, not just the primary master - or SATA1, since there's no master/slave concept with SATA when it's not emulating a legacy IDE controller.

Re: Adding a Hard Disk to a VM

Posted: 25. Oct 2011, 19:42
by Sasquatch
May be, but in a normal BIOS, you also get the question to boot a certain hard drive. Not much different here. Sure, a normal BIOS allows you to define a priority to the hard drive, and if someone is willing to give a patch for it, they will incorporate it. But for now, a VM is not much like a physical machine, as you would create a separate machine for the other OS instead. Dual booting with VMs is a rare occurrence, there isn't really a reason to do it. Especially if it's easier to create a separate VM.

Re: Adding a Hard Disk to a VM

Posted: 26. Oct 2011, 10:01
by Freedomcoach
I created a clone of my VM that had the two drives connected to it.

When I deleted the vmdk disk, the clone VM booted just fine from the vdi. This was the test I needed to convince me that all was well with the vdi disk.

So, this brings me to end of my saga... I now have a fully functional XP VM with a vdi formatted disk and all is well. The clone VM is deleted since I only created it as a test. I'm a happy camper. Now I just need to learn how to use Ubuntu. It is different.