Add the new larger virtual disk image as the primary slave

This is for discussing general topics about how to use VirtualBox.
Post Reply
kdavis
Posts: 7
Joined: 16. Nov 2010, 07:03
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7

Add the new larger virtual disk image as the primary slave

Post by kdavis »

I am creating a new larger virtual disk and need to attach it to the original smaller virtual disk as the primary slave. There are lots of messages on this topic but none that say how to do this. There are descriptions of tick the boxes etc but my GUI in 3.2.10 does not have tick boxes instead it has a directory tree that shows IDE controller and SATA controller and I need to know what do to hear. There are + and - buttons for adding HDD's but do I add to the IDE or SATA controller? and do I do this on the original virtual drive or the new one? Clearly many of the messages on this topic predate the latest version because the GUI is different. Hope you can help. PS I don;t know what version I'm using I just guessed puel
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Add the new larger virtual disk image as the primary slave

Post by mpack »

Your question seems confused. What is your understanding of the term "attach as a primary slave"? In fact the term "primary slave" identifies ones of the channels on an IDE controller. However you mention attaching your new disk to an older one (not possible) and you also ask if you should be using SATA or IDE (the term is meaningless to SATA).

Why not just say in plain words what you are trying to do? If you have a notion that you can enlarge a logical drive by adding additional physical drives... well you can't, at least not if your guest is Win7.
kdavis
Posts: 7
Joined: 16. Nov 2010, 07:03
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7

Re: Add the new larger virtual disk image as the primary slave

Post by kdavis »

OK thanks. Here are the instructions I am following http://www.modhul.com/2008/10/21/re-siz ... mage-file/

I understand everything except "Attach the new disk to your virtual machine that needs its disk expanding as the slave disk". The images shown are not the same as my GUI

Are you saying I'm wasting my time if Windows 7 is my guest OS? If so, what do you suggest I do? I currently have a 20GB Virtual Disk which I want to expand to 30GB. I thought 20GB would be plenty until I loaded Windows 7 - thanks
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Add the new larger virtual disk image as the primary slave

Post by mpack »

Ok, so you are indeed trying to enlarge a drive, and you are following one of the many variable quality / obsolete HOWTOs out there, probably one that uses out of date screenshots which fails to show the new "Storage" section.

Adding a second hard drive is easy: go to the Storage section of VirtualBox, pick one of the controllers shown in the left panel (there may be only one), then click the 2nd '+' sign to add a new hard drive. VBox will add an arbitrary registered VDI file - highlight the light in the left panel then use the right panel to assign the correct VDI.

Choice of SATA or IDE does not matter (and if IDE - nor does the choice of channel), all that matters is that your guest is already set up to use that kind of controller.
kdavis
Posts: 7
Joined: 16. Nov 2010, 07:03
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7

Re: Add the new larger virtual disk image as the primary slave

Post by kdavis »

Thanks - yes I'd already done this - I now have a 30GB 2nd drive that I want to make my ONLY drive. Thing is, how to transfer all the data off the old 20GB drive. I understand I cannot use the same vdi file because it has a unique identifier valid only for the current drive. This is how I came across the idea of cloning the old drive. Is this possible?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Add the new larger virtual disk image as the primary slave

Post by mpack »

You want to know how to image a drive and copy the image to another drive? That isn't really a VirtualBox question, you do it the same way you would if two physical hard drives were involved. I.e. run any of CloneZilla, Acronis, Ghost, dd, etc to make an image and then restore the image onto the other drive using the same tool. I think CloneZilla would be particularly convenient because I believe that it can do a direct copy of the image from one drive to another (ok, so can dd, but I consider dd very much a last resort). You would then run gparted to enlarge the copied partition to fill the new drive. All of these tools must of course run from live CDs.

[edited to fix a typo that was irritatating me]
Last edited by mpack on 22. Nov 2010, 14:56, edited 1 time in total.
kdavis
Posts: 7
Joined: 16. Nov 2010, 07:03
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7

Re: Add the new larger virtual disk image as the primary slave

Post by kdavis »

appreciate your assistance. This brings us back to the original question. What you are describing is similar to the instructions I was following so that would mean that somewhere along the way I would have to attach the new larger drive as a slave to the original drive. I don't know how to do this.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Add the new larger virtual disk image as the primary slave

Post by mpack »

kdavis wrote:somewhere along the way I would have to attach the new larger drive as a slave to the original drive.
No such operation exists. A clearer translation of that instruction would be "add the new drive as a 2nd drive in an existing VM" - two messages back you said you already did that.

All of that master/slave nonsense is nowadays simply a way of labelling the four channels available on an IDE hard disk controller. (Primary Master, Primary Slave, Secondary Master, Secondary Slave). The boot drive is traditionally on the first channel, hence a second drive is traditionally on the second (Primary Slave). The original meanings of these terms became obsolete long ago - they linger only as channel IDs, and now of course IDE itself is obsolete. SATA just uses channel numbers, so the SATA equivalent of "attach hard disk as primary slave" would be "attach hard disk to SATA channel #1" (#0 being the first channel). Mention of SATA is just for information: don't use it unless you were using it already in that VM, otherwise you almost certainly don't have drivers installed for it.
kdavis
Posts: 7
Joined: 16. Nov 2010, 07:03
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7

Re: Add the new larger virtual disk image as the primary slave

Post by kdavis »

Thanks - it's too complicated I'm just going to transfer all the data from the original VM to a shared folder in the host then delete that VM and associated vdi and transfer the data from the same shared folder to the new larger VM. Just have to reinstall the OS and couple of programmes. Thanks anyway
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Add the new larger virtual disk image as the primary slave

Post by mpack »

kdavis wrote:Thanks - it's too complicated I'm just going to transfer all the data from the original VM to a shared folder
Well, ok, but be aware that if it was that easy then people wouldn't look for ways to enlarge an existing disk. In particular many Windows applications rely on registry entries to make sense of stored data: you will have the data without the registry.

You might want to look at CloneVDI (see sticky in Windows Hosts forum). This is a user friendly (GUI based) applet which can clone and enlarge a VDI in one step, with just a few mouse clicks. It can also optionally increase the partition size in the same step, but some people have reported that the latter causes corruption so you might be better advised to still use a gparted live CD for that. Unfortunately, CloneVDI is a Windows application, however it might be possible for you to borrow a Windows laptop or suchlike to run it on (cloning a VDI copied to an external drive), or you can run it from within the VM you want to clone, very carefully entering "\\.\PhysicalDrive0" as the source file to be copied, and <any shared folder you like>\filename.vdi as the destination filename. The intent here is to make CloneVDI image your VMs boot drive to an enlarged clone VDI file.
kdavis
Posts: 7
Joined: 16. Nov 2010, 07:03
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7

Re: Add the new larger virtual disk image as the primary slave

Post by kdavis »

really appreciate your knowledge - thanks. I have in the last 24 hours done what I said I was going to do and it all seems to be working OK. While it was a hassle - It was a good excuse the clean out data and files and disregard old software. I now have a brand new 30GB drive that is running like a charm and, I might add, the size of the new VM will more than meet my requirements. My word of advice to anyone setting up Virtualbox for the first time is to over estimate the amount of storage they will require AND to select the expandable disk option because the beauty of this is that while they may over estimate their requirements, the VM will only use the space that is required up to the limit they set.

On another note, is the vdi file secure? While I have set a password to the OS, I wonder if the vdi file that sits on the host drive is secure and is there any way of encrypting it? Thanks again!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Add the new larger virtual disk image as the primary slave

Post by mpack »

kdavis wrote:On another note, is the vdi file secure? While I have set a password to the OS, I wonder if the vdi file that sits on the host drive is secure and is there any way of encrypting it? Thanks again!
I'm no expert on Windows encryption. What you are asking is the same as asking "what if I take the hard drive out of a password protected PC and attach it to another PC. Can I access the data"? That's a question which Microsoft can best answer.
kdavis
Posts: 7
Joined: 16. Nov 2010, 07:03
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7

Re: Add the new larger virtual disk image as the primary slave

Post by kdavis »

Thanks again for your constructive assistance and especially your time.
Post Reply