Using a local editor with Vagrant - macos

I typically use the atom editor for any coding work and have folders on my computer with the code. After doing some updates on my Mac OS computer, some ruby gems stopped worked, rvm no longer responded and homebrew gave me a ton of trouble. I want to prevent this from happening again and figured I'd use Vagrant instead. I like it so far and it works fine, however I want to use my Atom editor nevertheless.
Normally I work on projects using gulp or grunt and they compile the files whenever any changes are made. While I have managed to connect to Vagrant with FileZilla, I have no idea how to connect atom to it. All I need is to edit the files in the Vagrant VM, as I would if they were stored in regular directories on my Mac. Any idea how to solve this?

you can certainly use your current workflow but you do not necessarily need to connect to your vm using Filezilla or another protocol.
The best is to look at Synced Folders and synchronized your project directory. By default vagrant synchronized your current directory (where the Vagrantfile is store) to the /vagrant directory in the vm. so if you can place your project directory within the same folder, they will be automatically synchronized.
If Atom (I am not user of this editor) have a special folder where you store your project files, you can add this folder as synchronized folder. Add the following to your Vagrantfile
config.vm.synced_folder "/Users/fhenri/project/tac.local", "/project"
In my case this synchronized my host (mac os) folder /Users/fhenri/project/tac.local to the vm folder /project so whenever I make a change in this folder, I can see the exact same change from the vm.
If you use ruby and gems, it might be good to install the gem locally (within your project structure that you can share between the host and the guest) so they are automatically reflected in the 2 environments when you make a change.
When you're using gulpor grunt you would launch them from the vm, working on a synchronized folder and all the changes you will make from the mac os host would automatically be picked up on the vm. I remember when working with default Virtual box sharing folder, automatically is not flash light, you should allow a few seconds delay but still it is working.
If performance is becoming an issue, you can look at nfs synchronization type by making the change
config.vm.synced_folder "/Users/fhenri/project/tac.local", "/project", type: "nfs"
It should improve a bit

Related

Missing lxss folder in Windows, can't access Ubuntu's files

I installed a Linux Ubuntu subsystem onto my Windows 10.
Ubuntu itself works fine and I can access all the Windows files without a problem.
But somehow I can't access the files the other way around, meaning I can't find the lxss folder where all the files from Ubuntu are stored.
I already made all folders visible, even the system ones. There just isn't a lxss folder.
In fact, there is not a single lxss folder on the whole drive.
Ubuntu must save the files somewhere, I just don't know where...

React-native packager does not detect changes made on host computer when running in vagrant VM's synced folder

I am running a vagrant VM on OSX. I have set up a synced folder for the VM in which I run react-native packager. When I edit files on my host computer, the packager does not automatically detect that the file has changed. This works if I edit the file directly in the VM. I have checked that the file actually changes on the VM when I edit it on my host computer. Has anybody had the same problem or figured out a solution how to get this working?

Meteor Vagrant: Where should the project code files be?

I have successfully configured Meteor on my Windows machine via vagrant along with running the sample app in the browser by following the tutorial given at https://gist.github.com/ahoereth/2607d2ee99103a0a9bc9.
For the last two hours, I have explored all of the Window's directories in search of the code created by meteor create sampleapp command, but I can't find any clue where the code is. As vagrant claims that code is in the Windows directory not the VM box, can anyone give me a hint where it could be hiding?
The directory that's shared with the Windows host is the /vagrant directory. In the VM, the home directory might be different, and won't be visible from Windows.
However, if you want to run the Meteor app from the shared directory, be prepared for a world of pain whenever you install a package that has a : in its name, as Windows won't support that character in the filename, and you'll get a cryptic error in the VM.
Since packages in Meteor 0.9+ regularly have : in their names, developing Meteor apps in the VM/Windows shared directory is a no-go.

How to setup remote debugging in PyCharm on Windows with Vagrant?

I have been able to setup Vagrant on Windows 7 64-bit for a django project. The Vagrant instance is running the application with postgres as backend. I have setup port forwarding, so I am able to access through my browser on local machine. I have also setup remote interpreter in PyCharm. But, I am unable to figure out how to open the project, which is on vagrant instance, in PyCharm 3.0. I also have the source code on my local machine.
Any ideas?
Thanks
Synced Folders may be something you are looking for.
NOTE: by default Vagrant use VirtualBox's vboxsf for synced folder and share your project directory (where the Vagrantfile resides) to /vagrant within the guest.
However, vboxsf has known performance issues with large number of files and directories. You can try to move the project to /vagrant (or whatever synced folder) so that both the host (Windows 7) and guest can access the project easily. See if it works well. If you see slowness try moving to NFS or sshfs.
Reference
Vagrant shared and synced folders
What is the difference between shared folder and synced folder in Vagrant?

Create a symlink to a directory on another network machine

This is the problem: I am creating some files on a machine running some process, and I would like to have a second machine to create a symlink to this folder.
Not sure thou what should I do to make this happen. should I make a dir on my main machine and share it with the second? otherwise ls -s won't work if I specify a network path to the main machine (they are on the same network, but one just run terminal, no GUI or X server; the main machine is a mac with OSX lion on it).
The objective is to have machine 1 make these files, and machine 2 makes a symlink to this folder, use these files, then remove the symlink. I could copy the files over to the second machine, but these are pretty big files, and I have very little space available on the second machine (it is not a computer in the common form of the term...it is a SOC on a custom board, that I'm checking out, similar to the raspberry pi or the beagle bone).
Thanks

Resources