Attach disk .vdi on the virtual media manager in command line

Discussions related to using VirtualBox on Linux hosts.
Post Reply
MattaM
Posts: 4
Joined: 1. Jul 2017, 16:24

Attach disk .vdi on the virtual media manager in command line

Post by MattaM »

Hi

I have an project personnal on virtualbox, create an cluster of machine virtuels.
I have an cluster of 5 servers physical with an common stockage by Ceph.
Now my project is good, but for finish my project, i have need help on attach an disk .vdi on the virtual media manager in command line without interface of virtualbox.
If it's possible, what is a method ?

Tank you
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Attach disk .vdi on the virtual media manager in command line

Post by mpack »

https://www.virtualbox.org/manual/ch08. ... rageattach

e.g.

Code: Select all

VBoxManage storageattach <Your VM name> --storagectl <name of controller to receive media> --port <IDE or SATA port> --medium <filename>
This is only an example. There are lots of optional features of this command.
MattaM
Posts: 4
Joined: 1. Jul 2017, 16:24

Re: Attach disk .vdi on the virtual media manager in command line

Post by MattaM »

Thanks for reply,

I know this command, i don't want add an disk on the virtual machine, but on the hypervisor directly.

When i add an virtual machine on hypervisor by the config file, i have error message :
VirtualBox error: rc=0x80bb0001 Could not find an open hard disk with UUID {66bcc100-03aa-4104-8487-3bc12a552636} (0x80bb0001)

It is said, the UUID disk is not known by hypervisor and the virtual machine is not add.

Tank you.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Attach disk .vdi on the virtual media manager in command line

Post by mpack »

I do not understand this statement :-
MattaM wrote: i don't want add an disk on the virtual machine, but on the hypervisor directly.
The only place you can add media to is the virtual machine. I'm not sure of what "the hypervisor directly" means. This could mean to a running VM, or you could simply mean to the global media registry. The latter is easy: VirtualBox doesn't have a global media registry, media must be registered with an individual VMs. I have a feeling that the former may only be possible with certain controllers that allow "hot" changes, otherwise guest OS's would not allow it.

As to the error message: that seems to be saying to me that you're trying to add a difference image (snapshot or linked clone) before you've added the parent image.
MattaM
Posts: 4
Joined: 1. Jul 2017, 16:24

Re: Attach disk .vdi on the virtual media manager in command line

Post by MattaM »

Hi,

Thank you for your reply.

I not have snapshot in my virtual machines, i have 5 servers physical on which i have virtual machines, and when move an machine on one of other servers, i registing this machine by the command " registervm " with the config file .vbox directly.

In the config file, the disk it's already parametre, and when register machine, the disk is not connu by le server Virtualbox and the machine is not register and the error message appears.

If i mount the disk in the " Virtual Media Manager " in the PhpVirtualBox, then i can register virtual machine in the server and it's good.

Else i have to create an new machine and declare the disk, in the virtual machine.

In PhpVirtualBox, i can resgister the disk, therefore there must be an command for register disk by API of PhpVirtualBox, and therefore an command on the VBoxManager of VirtualBox.

I wait your reply.

Tank you.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Attach disk .vdi on the virtual media manager in command line

Post by mpack »

I don't use phpVirtualBox, but it's possible that it's using one of the programming APIs, and not VBoxManage. The only command line commands that I know of are the ones I've already mentioned.
MattaM
Posts: 4
Joined: 1. Jul 2017, 16:24

Re: Attach disk .vdi on the virtual media manager in command line

Post by MattaM »

Hi,

Thanks you for your time, i will see on the forum of phpVirtualBox.

Cordialy.
Post Reply