Accessing shared folder via command line?

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
Saeven
Posts: 3
Joined: 20. Jul 2011, 06:40
Primary OS: Other
VBox Version: OSE other
Guest OSses: Ubuntu 11.04

Accessing shared folder via command line?

Post by Saeven »

Hello!

First, thanks in advance for your help!

I posted in Server Fault a few weeks ago (https://serverfault.com/questions/84552 ... d-line-php) in an attempt to learn how to 'cross the shared folder fence' via command line.

My guest is 'host-aware' through shared folders, but it seems this is a one way street.

Anyone have any ideas on how to solve this?

Thanks again!
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: Accessing shared folder via command line?

Post by socratis »

Saeven wrote:My guest is 'host-aware' through shared folders, but it seems this is a one way street.
I'm not sure even what that means. But that's not my only problem. I don't know your host, your guest, where your shared folders are or what you're trying to do. Could you please post the specifications and the problem? I (and others) don't really like visiting 3rd party sites.
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.
Saeven
Posts: 3
Joined: 20. Jul 2011, 06:40
Primary OS: Other
VBox Version: OSE other
Guest OSses: Ubuntu 11.04

Re: Accessing shared folder via command line?

Post by Saeven »

Sure with pleasure; I had put everything on ServerFault, but it's my pleasure to repeat it here.

This guest essentially serves as web server for a Zend Framework 2 project, that serves files mounted on a shared folder. The guest allows developers to develop their code, using libraries that are locked away (on the guest).

The guest's configuration is very simple; it's an nginx server whose root is set to /var/www/html/public.

The contents of /var/www/html are provided by a shared folder called 'webroot' (as configured in VirtualBox).

Code: Select all

sudo mount -t vboxsf -o rw,uid=33,gid=33 webroot /var/www/html
After it is mounted and permissions are set, a symlink is added within the guest:
sudo find /var/www/html -type d -name public -exec ln -s /usr/local/include/core/vendor {}/../vendor \;
The end result, is exactly as expected on the guest side. I can cd /var/www/html and work as though everything were on a single machine. On the host side, this isn't the case. For example, there are files within ./vendor/bin that I would like to access while using Terminal on the host, but the symlink on the host doesn't have the same meaning as the symlink on the guest.

I'm not sure how to formulate this question, but what I'd like to do, is create a kind of bijective experience. If I were able to execute /vendor/bin/foo from either host or guest, life would be grand.

Thanks for your help.

Host: OS X 10.11.6
Guest: Ubuntu 14.04.3 LTS
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: Accessing shared folder via command line?

Post by socratis »

First of all, VirtualBox Shared Folders present a very simplified file system implementation, just enough to read/write files from/to the guest. Many applications can error when using shared folders, because they expect advanced features, like file locking or access controls, which don't exist for shared folders. If you keep using them for anything else than reading files, expect problems sooner or later.

Shares are not bidirectional. In fact no known share is. I would suggest to revisit your thinking and your approach.
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