Page 1 of 1

VBoxManage sharedfolder C:/ not kept in OVA

Posted: 24. Sep 2018, 10:28
by axel3rd
Hello,

I'm creating a VirtualBox OVA (with packer), to have a small Linux (Ubuntu) usable on Windows.
A main feature is to have the host C: shared in guest host. It is working like a charm when OVA packaged on Windows.

When the OVA is packaged on MacOS (the only non-virtualized OS I have in CI process), the C: shared folder configuration is lost ; ie: When OVA is imported on Windows, the shared folder configuration is empty.

Technically, the

Code: Select all

VBoxManage sharedfolder add vm-name-xxx --name c --hostpath C:/ --automount
has no error but seems but seems no impact :(

Due to sharing C: is perhaps specific to Windows host, is there some know limitation with this command is passed on Linux(-like) host ?

Infos:

Code: Select all

~$uname -a
Darwin xxxx 17.7.0 Darwin Kernel Version 17.7.0: xxxx

~$ VBoxManage --version
5.2.18r124319
Many thanks in advance of any idea or tips.
Best regards

Re: VBoxManage sharedfolder C:/ not kept in OVA

Posted: 24. Sep 2018, 11:11
by axel3rd
My apology, my previous description was false ; VBoxManage is explicit about errors when used manually (outside packer):

Code: Select all

~$ VBoxManage sharedfolder add "my-vm-xxx" --name c --hostpath "C:" --automount
VBoxManage: error: Shared folder path 'C:' is not absolute
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component SharedFolderWrap, interface ISharedFolder, callee nsISupports
VBoxManage: error: Context: "CreateSharedFolder(Bstr(name).raw(), Bstr(hostpath).raw(), fWritable, fAutoMount)" at line 1031 of file VBoxManageMisc.cpp
There is no error when command is like:

Code: Select all

~$ VBoxManage sharedfolder add  "my-vm-xxx" --name c --hostpath "/C:" --automount
... but in this case, when OVA is imported under Windows and started, there is error about sharing folder: The shared folder 'c' could not be set up: Shared folder path '/C:' is not absolute

I should find a format supported on cross-hosts (Windows/MacOS/Linux).

Re: VBoxManage sharedfolder C:/ not kept in OVA

Posted: 24. Sep 2018, 12:33
by mpack
What it says. "C:" is a not a path. "C:\" is a path, but only on Windows hosts, whereas this is the Mac hosts forum.

Incidentally, it is incredibly unwise to share the root folder of your drive with a VM, unless you particularly want all your personal and financial details broadcast on the Internet.

Re: VBoxManage sharedfolder C:/ not kept in OVA

Posted: 24. Sep 2018, 13:40
by socratis
axel3rd wrote:I should find a format supported on cross-hosts (Windows/MacOS/Linux).
Unfortunately such a magic format does not exist. It's Windows that ruins the party.

Re: VBoxManage sharedfolder C:/ not kept in OVA

Posted: 24. Sep 2018, 18:51
by axel3rd
What it says. "C:" is a not a path. "C:\" is a path, but only on Windows hosts, whereas this is the Mac hosts forum.
I'm fully agree, but I build this VM on a MacOS host, to have an Ubuntu usage on Windows ... with C: shared (locally on computer, for some development process, VirtualBox is more simple to use that Cygwin & co.).
Unfortunately such a magic format does not exist. It's Windows that ruins the party.
UNC path ("\\?\C:\") usage fails too :(. Updating the "SharedFolder" in ".vbox" file before export works ... but is is shitty.