VBoxManage sharedfolder C:/ not kept in OVA

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
axel3rd
Posts: 3
Joined: 24. Sep 2018, 10:06

VBoxManage sharedfolder C:/ not kept in OVA

Post 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
axel3rd
Posts: 3
Joined: 24. Sep 2018, 10:06

Re: VBoxManage sharedfolder C:/ not kept in OVA

Post 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).
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VBoxManage sharedfolder C:/ not kept in OVA

Post 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.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: VBoxManage sharedfolder C:/ not kept in OVA

Post 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.
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.
axel3rd
Posts: 3
Joined: 24. Sep 2018, 10:06

Re: VBoxManage sharedfolder C:/ not kept in OVA

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