Adding permanent shared folders through VBoxManage (#18756)

This is for discussing general topics about how to use VirtualBox.
Post Reply
Luc123
Posts: 3
Joined: 15. Jul 2019, 12:14

Adding permanent shared folders through VBoxManage (#18756)

Post 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
Last edited by socratis on 15. Jul 2019, 16:57, edited 1 time in total.
Reason: Added ticket related information.
socratis
Site Moderator
Posts: 27330
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: Adding permanent shared folders through VBoxManage (#18756)

Post 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...
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.
Luc123
Posts: 3
Joined: 15. Jul 2019, 12:14

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

Post 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.
socratis
Site Moderator
Posts: 27330
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: Adding permanent shared folders through VBoxManage (#18756)

Post 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
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.
Luc123
Posts: 3
Joined: 15. Jul 2019, 12:14

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

Post by Luc123 »

Maybe I'm wrong, I'd be happy to.

The command I use is as follows:

Code: Select all

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.
socratis
Site Moderator
Posts: 27330
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: Adding permanent shared folders through VBoxManage (#18756)

Post 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.
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.
Post Reply