[solved] Hot Swap hard drive

Discussions about using Linux guests in VirtualBox.
Post Reply
noobmeister
Posts: 3
Joined: 16. Mar 2017, 00:08
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: CentOS, Windows, Ubuntu

[solved] Hot Swap hard drive

Post by noobmeister »

Hello Everyone,

I was running a previous version of VB (5.x.xx not sure exactly which version). I upgraded to 5.1.16 last week; and now I have lost the ability to add a hard drive to my live Linux Guest. Any idea why this is?


Thanks!
noobmeister
Posts: 3
Joined: 16. Mar 2017, 00:08
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: CentOS, Windows, Ubuntu

Re: [solved] Hot Swap hard drive

Post by noobmeister »

This was my own error.

I did not realize that the hard drive ports were limited to 2. And, I had a RAID CentOS guest running with two hard drives. After removing one of the hard drives, I was able to see the add(+) button become available again.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [solved] Hot Swap hard drive

Post by socratis »

Just a clarification. With older VirtualBox versions the "Port Count" for the SATA controller were statically assigned at 20(?), 30(?), I don't remember exactly. Now they're "dynamic", as in it will adjust itself to the number of disks that you have available. So I think that you could simply add another disk and the PortCount would adjust itself to 3. And so on...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: [solved] Hot Swap hard drive

Post by mpack »

That's assuming he's using SATA of course. IDE is rather more restricted on drive count, and certainly doesn't allow hot swapping.
noobmeister
Posts: 3
Joined: 16. Mar 2017, 00:08
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: CentOS, Windows, Ubuntu

Re: [solved] Hot Swap hard drive

Post by noobmeister »

socratis: Yes you are correct. The port count was adjusted to my number of disks; after increasing this I was able to see the add (+) button again. Without the need to remove a disk first.

mpack: yes, I was using SATA.
foo_
Posts: 19
Joined: 12. May 2018, 15:18

Re: [solved] Hot Swap hard drive

Post by foo_ »

Command for removing a HD while the machine is running:

Code: Select all

vboxmanage storageattach "NAME OF THE VM" --storagectl "SATA" --port 1 --device 1 --medium none
Command for adding a HD while the machine is running:

Code: Select all

vboxmanage storageattach "NAME OF YOUR VM" --storagectl "SATA" --port 1 --device 0 --type hdd --medium "/DIR TO YOUR VDI/NAME OF YOUR VDI.vdi" (or UUID instead of filename)
Note, only guest SATA controllers supports hot plug/swap
Last edited by foo_ on 26. May 2018, 10:52, edited 1 time in total.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [solved] Hot Swap hard drive

Post by socratis »

noobmeister wrote:now I have lost the ability to add a hard drive
foo_ wrote:Command for removing a HD
foo_,
I'm not quite sure why you felt the need to comment to a 1-year old thread, that was already marked as [Solved] by the OP, with something that is the opposite of what the OP was asking for...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
foo_
Posts: 19
Joined: 12. May 2018, 15:18

Re: [solved] Hot Swap hard drive

Post by foo_ »

Was searching for the vboxmanage commands to hot swap HDs on VMs and this is one of the first results that comes up in Google.
Last edited by socratis on 26. May 2018, 11:27, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
Post Reply