I want to install development tools in my virtual machine, but i am having trouble sharing my files to my virtual machine? Any steps on how to do it? Thanks a lot!
Copy all ur files into a folder
Right click that folder
Choose Sharing Tab
Check Share this folder
Aplly, OK
Go to ur virtual machine, Start -> run -> \your machine ip -> Enter
Copy the folder into ur virtual machine.
Related
I am attempting to relocate my DocumentRoot (i.e. localhost) to a synchronised folder (such as Google Drive, Dropbox or Tresorit), but the attempt fails with a 403 error.
On Windows machines I can configure localhost to run from D:/GoogleDrive/SitesG folder; the local site runs perfectly.
On a Mac, however, localhost won't work when running out of a cloud-based storage folder such as Google Drive, Dropbox, Tresorit, etc.
Everything is fine when localhost is at Users/myname/Sites.
However, when I reconfigure the Mac to run from Users/myname/GoogleDrive/SitesG - e.g. by editing the httpd.conf, etc, files - localhost is blocked.
Clearly the problem is to do with permissions on the parent folder (e.g. the Google Drive or Dropbox or Tresorit folder). I can see that the permissions on the various folders are as follows.
drwxr-xr-x 32 myname staff 1024 30 Apr 02:23 Sites
drwxr-xr-x 22 myname staff 704 30 May 21:01 SitesG
drwx------# 61 myname staff 1952 30 May 17:47 GoogleDrive
So my question is: On a Mac (running HighSierra), is it possible to relocate the DocumentRoot to GoogleDrive? Or is there something instrinsic to GoogleDrive that prohibits localhost from being run a Google Drive folder?
Locating an Apache virtual host to a cloud-based storage folder will create many files/folders permissions problems.
Instead of relocating your documentRoot and changing a lot of settings and permissions, you should more easily, for each cloud stored project, create a symlink in your Users/myname/Sites folder, pointing to your GoogleDrive/Dropbox website folder.
Imagine you have a "websiteA" folder inside your Dropbox folder :
1) Go to your "Users/myname/Sites folder" and create such a symlink
cd ~/Sites
ln -s ~/Dropbox/websiteA websiteA
As you can check opening your ~/Sites folder in the Finder, you have created a folder with an arrow on it, pointing to the "websiteA" cloud-based folder.
2) Now, you just have to create a virtual host pointing to ~/Sites/websiteA.
You could, instead, globally change your ~/Sites folder to a symlink pointing to your cloud-based folder, but the project-by-project approch is more flexible as it will allow you to manage both local and cloud-based projects.
Many thanks to #DrFred for the solution above, which I'm confident would work though I have not had the chance to test it.
Here's the solution I devised before receiving any answers. It's very similar to Dr Fred's above, in that both solve the problem with symlinks. I add mine for completeness and extra detail.
As above, I develop on multiple devices (several Macs and Windows PCs, side by side), so my aim was to have a single localhost development folder that would synch almost instantly between different devices without the need to check files into/out of git and without running into the file permissions problems created when using Google Drive to synch code files.
The steps I used to achieve this aim were as follows.
Create a folder called ~/Users/myname/SitesNew on a Mac.
Create a symlink from that folder to an identically named folder in Dropbox on the same Mac. You will then have two identical folders on the Mac:
~/Users/myname/SitesNew <-- Real folder on Mac
~/Users/myname/Dropbox/SitesNew <-- Symbolic folder on Mac
Synchronise Dropbox on all devices (making sure to add the SitesNew folder if you are using selective synch on any device). The symlink folder will now appear as a real folder on Dropbox in the cloud and on the Windows PCs. In my case the new Windows PC folder was at:
D:/Dropbox/SitesNew <-- Real folder on Windows
Update the Apache httpd.conf files on the Mac to recognise localhost at ~/Users/myname/SitesNew.
Update the Apache httpd.conf on the Windows PC to recognise localhost at D:/Dropbox/SitesNew.
From now on, any localhost development work (edit, add, delete) on one device will synch with the localhost on the other, even across different operating systems.
Note 1: This solution works only with Dropbox but not with Google Drive, as Google Drive has problems with symlinks and also messes with permissions in a different way, especially on a Mac.
Note 2: If any files have previously been saved on Google Drive (e.g. originally my Windows sites folder was at D:\GoogleDrive\SitesOld), use chmod both (a) to determine the right values for the permissions (e.g. see https://chmod-calculator.com), and (b) to convert folders and files to the right values.
I have VMware running Ubuntu 14.02 and A Windows 8 Host. I've enabled shared folders and installed VMware tools. Now what I want is to run the web server through /mnt/hgfs/ProjectName
At this point I can access the shared folder from within Ubuntu. I do not have to run sudo to create new folders or files or edit existing. The folder is not mounted as read only and not treated as read only; however, when I try to change the read only attribute within Windows it reverts back afterwards. Is there any clue as to why the web server cannot read the folder as a web server? Even being mounted as read only the web server should be able to read the files.
Turns out the best way to run this is to name the project folder html within vmware and then mount it to the /var/www folder. Now edits have no problem being made and the server runs great for access to both the host and the guest OS.
I copied an existing vagrant config in order to ease the setup. When I run vagrant up, I had expected for a new machine to be setup. Yet instead, it says it starts the default machine which is exactly the same as the vm for my existing project.
I do not want to run vagrant destroy as I do not want to provision both projects again.
Copying the existing vagrant directory also copied the hidden directory .vagrant. There, the references to the created virtual box are stored. Vagrant hence thought it already had set up the machine already and that it was the same one as from the existing project.
Deleting this folder in the new project deletes the reference, so the existing virtual box machines will be kept, and running vagrant up will then provision a new machine and create its own virtual box.
I have a number of projects that use Vagrant and associated VMs. Some are in current development, others are either in maintenance or archived, and I do not need the latter on my laptop. 256GBs fill up fast.
What I'd like to do is move the archived and maintenance virtual machines to an external SSD hard drive, but still have them accessible via the Vagrant command line.
All google queries and searches have only turned up a permanent move to another drive, and nothing about some here and some there.
Is this possible?
You may try to use environment variables for change location setting
i think that may help.
use it in this way VAR="C:\some_location" vagrant up
VAGRANT_DOTFILE_PATH
VAGRANT_HOME
VAGRANT_DOTFILE_PATH can be set to change the directory where Vagrant stores VM-specific state, such as the VirtualBox VM UUID. By default, this is set to .vagrant. If you keep your Vagrantfile in a Dropbox folder in order to share the folder between your desktop and laptop (for example), Vagrant will overwrite the files in this directory with the details of the VM on the most recently-used host. To avoid this, you could set VAGRANT_DOTFILE_PATH to .vagrant-laptop and .vagrant-desktop on the respective machines. (Remember to update your .gitignore!)
So I love it that MAMP Pro makes it super easy to set up hosts and access logs and stuff. But I am now working at a location where all of the local copies of websites are on a shared server, e.g. /Volumes/Server/Websites/MyAwesomeWebsite.
Unfortunately, when I try to select a folder on the server, all the folders are greyed out. And when I type the path in manually and restart Apache, I get the message:
"Some hosts have an invalid disk location. These hosts won't be reachable if you start Apache now."
There's really no point in using MAMP Pro if I can't set hosts up on the shared server... any ideas? Or am I gonna have to stop being lazy and edit the virtual hosts by hand from now on?
I was unable to get it to work, so I rolled back from MAMP Pro to MAMP and started editing the virtual host files by hand. It's actually not bad at all, I put a shortcut in my dock that launches both files in BBEdit, so adding new virtual hosts is still quick and easy.