Can't access file in the /mnt/shared on Gennymotion - macos

I had configured shared folder for my virtual device on virtualbox. (Auto mount, Make permanent)
So i access /mnt/shared/[mysharedfolder]/ but it is was empty.
I'm using Mavericks OS. I can see my shared folders but nothing inside them.

Use a fully permission folder (including files) as your vbox shared folder. I use my Public folder in Home directory in Linux.

Related

How can I map a shared folder from my container on Mac?

I have a folder insider a Docker container that is shared through Samba. I can map this folder on Windows without problem running something like:
net use z: \\vm_ip\folder
In the case above, z: is the drive that I created with the content from the shared folder.
How could I map that same folder on Mac?
Step 1 - Sharing folder using Samba
The first thing that you need to do is let the folder that contains the files (project, source codes, settings, etc) that you want to share, visible for MacOS.
To do that, you'll need to share the folder on Docker Container using Samba. I won't describe how to do this here because there are a lot of resources on Internet.
Step 2 - Redirecting the Samba ports on Kitematic
Kitematic is a platform that helps you to configure the container and other settings on Docker. It can be downloaded here: https://www.docker.com/products/docker-toolbox. You DON'T need Kitematic to create the rules to redirect the Samba ports, however, you won't spend 2 minutes for that (instead trying to discover how to do that in the CLI).
Having Kitematic installed on MacOS:
Start Kitematic;
Select the container (panel on left with the title Container) that contains the folder that you shared using Samba;
Image of Panel on Docker
Click on the Settings tab and then the select the tab below called Hostname/Ports
Image of Settings panel on Docker
Now, we add the ports 137, 138, 139 and 445 and redirects it to the same port on localhost.
Step 3 - Mounting the Samba shared folder on MacOS
The last thing that is needed to edit your files on MacOS,is just map on MacOS the folder that is shared on Samba (inside the Docker container). To map that, open the terminal and run the following command:
$ mount_smbfs //guest#localhost:/SharedFolderOnSamba source/
What we're doing is using the method mount_smbfs, telling that we'll connect to the #localhost in the folder SharedFolderOnSamba using the user guest and then, we'll map (create a new Drive) in the source/ folder on the currenct directory of you terminal session on MacOS.
So, pay attention:
You can use any other user to use instead guest;
You must have a source/ folder or define another folder that will be used;
The SharedFolderOnSamba must be change to the name of the folder that you've shared using Samba. To confirm the name of the folder, go to /etc/samba/ and open smb.conf and search by the folder that you've shared.
If you are using Docker For Mac, the /Users folder from your mac is already mounted inside the virtual machine inside the Docker For Mac application runs. It is accessible via /Users inside the vm. That means you can do: docker run -v /Users/some/path:/folder ... in the container's /folder will meant to /Users/some/path in the vm, which maps back to your mac's /Users/some/path.
If you want some other location other than /Users, click on the whale icon at the top of your screen, choose Preferences, and then click on the File Sharing tab. If you have mounted a samba/cifs share somewhere on your mac, you can add that path here.

Issue using Vagrant SSH when vagrant.d folder is on an external exFAT drive

Setting up Vagrant for the first time and I'm using the VAGRANT_HOME environment variable to change the location of the ~/.vagrant.d folder to an external drive (I'm paranoid about SSD wear and tear, sue me). This is causing an issue with the vagrant ssh command as it's complaining about not having the right permissions and I can't use chmod to change the permissions for the file it wants on an exFAT volume.
Is there a workaround? I've checked the documentation and there doesn't seem to be a setting where I can specify a different location for the insecure key, but I might be missing something.
Thanks!
The solution is to move the insecure_private_key file located in the external vagrant.d folder to somewhere in your local home directory and then symlink it back.

Cannot access Vagrant shared folders

I just trying to add Vagrant to my workflow and I have following probably noob problem. I pull standard hashicorp standard 14.04 image, vagrant up it, SSH to it install my python requirements on it and then then try to execute build commands against code in Vagrant shared folder and run in to problems. Basic errors I get say those locations don't exist or cannot be found.
First action I, go ls /vagrant and can see my shared folders. I cannot cd to them from Vagrant machine I have tried to halt the machine.
Vagrantfile shared folder code.
{"virtualbox":{"/vagrant":{"guestpath":"/vagrant","hostpath":"/Users/Kimmo/Documents/Mist.io","disabled":false}}}
I am using Virtualbox as provider newest version.
My dev machine is OSX 10.9.5
There are not access limitations on the folder itself.
Thanks for you help in advance :)
Does /vagrant exists inside the VM just after you start it ?
If no you can add this parameter : "create":true. According to the doc, for the create: true paramater : If true, the host path will be created if it does not exist. Defaults to false.
If the folder /vagrant exists but you can cd or ls it, you can add parameters wich will define the right/owner of this folder:
owner: (string) the user who should be the owner of this synced folder. By default this will be the SSH user. Some synced folder types don't support modifying the owner.
group: (string) the group that will own the synced folder. By default this will be the SSH user. Some synced folder types don't support modifying the group.
Also for the hostpath parameter you have to give him a folder path, not a file path. In your conf I can see: "hostpath":"/Users/Kimmo/Documents/Mist.io". If Mist.io is a file and you want to access this file inside your VM, just give the path to the folder containing this file, /Users/Kimmo/Documents in your case.

How can I set permissions for Magento using a Vagrant shared folder?

I am trying to install a Magento instance using vagrant. I used the MageVagrant repository found here, then modified it so that the default installtion directory on the vagrant machine points to a folder in the /vagrant folder, which is the shared folder (I did this so that I could edit the Magento files on my local machine and store them in version control), so that on my vagrant machine I have a symlink that looks like the following:
/srv/www/magento.localhost.com -> /vagrant/magento.localhost.com
When I try to run the Magento installer, it is fine until I get to the Configuration step of installation, and then I get the following error message:
Path "/srv/www/magento.localhost.com/public_html/app/etc" must be writable.
Path "/srv/www/magento.localhost.com/public_html/var" must be writable.
Path "/srv/www/magento.localhost.com/public_html/media" must be writable.
even though I have run chmod 777 -R on the directories both on my local machine and on the vagrant box. However, it still thinks it is not writable. How can I make these directories writable for the vagrant server?
By default it makes the mounted folder owned by the vagrant user and group, so you could make the web server you are using have permissions for that, or the way I do it is to add another shared folder and explicitly set the permissions on that share to how I want.
Line in my VagrantFile:
config.vm.synced_folder "../project_folder", "/var/www/", owner: "apache", group: "apache"
this will mount the folder "project_folder" which is one level above my vagrant directory to the location "/var/www" inside the virtual machine with the ownership of apache:apache.
This should work.
If you are hosting multiple sites inside the vm I suggest setting this shared folder as the parent of all the sites.

How to create virtual directory in G-WAN webserver

I installed G-WAN webserver , and i create virtual host , in G-WAN we must create folder for virtual host's , now i want to create virtual directory
my installed path is :
/home/gwan/
and myfiles are in
/home/user/
so how can i create virtual directory for virtual host ?
When we created G-WAN, we worked hard to remove any possible configuration issue by not using files where you have to tell the server what to do.
The simplest way to use your files located under /home/user/ is to either copy the G-WAN execuatble there or to copy your www files under the /home/gwan folder.
If you really want to use G-WAN, you should consider to read its documentation or at least its FAQs which both explain how to setup hosts.

Resources