搭建了Win8(host)+Vagrant+Virtualbox+ubuntu(guest)的环境,在同步方式的问题上遇到了一些问题
使用Virtualbox共享文件夹
将node_modules链接到ubuntu本地分区,工作正常,但是文件访问效率比较差,在执行构建任务时,构建速度与与本地磁盘的构建相差4-5倍。
使用rsync同步文件夹
在构建速度上可以得到保证,但是单向文件夹同步用起来会有一些不方便。
使用smb同步文件夹
在使用smb进行文件夹同步时,遇到共享文件夹内无法建立node_modules的软链接的问题,google了多种方案未果。
想知道大家使用Vagrant在window下开发nodejs时都使用怎样的文件夹同步方式。
I don’t use Vagrant, but directly use Win7 + Virtual Box + Ubuntu.
My method:
1. Share a folder under Windows (don’t ask me how to share it, use Baidu by yourself, the same below)
2. Use mount.cifs to mount this folder to a directory in Ubuntu
3. Then just access this directory directly
The efficiency is acceptable.
rsync is very inconvenient. In fact, I have always wanted to change to using NFS to share files, but the efficiency of shared folders in Windows is acceptable, and I am too lazy to do it.
Conclusion,
First of all, thank you all for your replies. As for the friend who is always complaining, I won’t comment further.
First of all, let’s talk about why we have to do everything we can to develop directly under window. There are three main points
The final solution chosen is window + vagrant + ubuntu +virtualbox
Ubuntu builds Samba and opens files for editing directly under window, which basically solves the problems encountered before. The build speed and file synchronization speed have basically reached a level that I am satisfied with.
Just use webstorm directly under win. Why use a virtual machine? ?
phpstorm webtore rubymine pycharm jetbrain both have ftp direct editing and ftp autoupload functions
You can also change to a mac...