Page 1 of 1

Adding permanent shared folders through VBoxManage (#18756)

PostPosted: 15. Jul 2019, 12:19
by Luc123

ModEdit; related ticket: #18756: Adding permanent shared folder through VBoxManage
Hello,

I'm looking for a way to add permanent shared folders via VBoxManage while the VM is running.

The documentation of the "sharedfolder" command says about the "transient" option: "Specifies that the share is transient, meaning that it can be added and removed at runtime and does not persist after the VM has stopped."
When I try to add a shared folder without the transient option, I encounter the error: The machine 'xxx' is already locked for a session.

However, I would like to be able to add permanent shared folders via VBoxManage while the VM is running, as this is possible via the VirtualBox graphical interface.

Thank you for your help

Re: Adding permanent shared folders through VBoxManage (#18756)

PostPosted: 15. Jul 2019, 16:56
by socratis
Luc123 wrote:When I try to add a shared folder without the transient option
How? Exactly...

I already told you in the ticket:
How about listing the step-by-step instructions of reproducing what you are seeing? Details!!!
I don't see any details here either...

Re: Adding permanent shared folders through VBoxManage (#18756)

PostPosted: 15. Jul 2019, 17:26
by Luc123
As stated in my answer to my ticket, when reading the documentation this is normal behaviour.

As for the details, there are indeed no more to add: it is not possible to add a shared folder with VBoxManage when the VM is running. I therefore suggest adding this feature.

Re: Adding permanent shared folders through VBoxManage (#18756)

PostPosted: 15. Jul 2019, 17:35
by socratis
You still have not manage to answer a simple question; what is the exact command that you used?!?

Because VBoxManage supports that. So, post the exact command and the problem that goes along with it.
 Edit:  

I'm sorry, it seems that I need more coffee. You said "a running VM", and that is indeed returning an error: :(
$ VBoxManage list runningvms
"VM" {245cb3e1-fd0c-40c8-9d8f-65f279be38c9}
$ VBoxManage sharedfolder add VM --name Shared --hostpath "/Users/Shared/"
VBoxManage: error: The machine 'VM' is already locked for a session (or being unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1023 of file VBoxManageMisc.cpp

Re: Adding permanent shared folders through VBoxManage (#18756)

PostPosted: 15. Jul 2019, 17:48
by Luc123
Maybe I'm wrong, I'd be happy to.

The command I use is as follows:
Code: Select all   Expand viewCollapse view
VBoxManage sharedfolder add "VM_NAME" --name asharedfolder --hostpath C:\Windows\

The error encountered is as follows:
VBoxManage.exe: error: The machine 'VM_NAME' is already locked for a session (or being unlocked)

This command works well by adding the "transient" option.

Edit: I'm a little disappointed in this moment of hope.

Re: Adding permanent shared folders through VBoxManage (#18756)

PostPosted: 15. Jul 2019, 17:55
by socratis
It seems that I was editing my post, while you were posting yours. I was mistaken, I completely missed the "running VM" part, mea culpa... :?

I was able to replicate the issue, as far back as 5.2.24, just a quick test to see whether 5.2.x series was affected as well. And it is.