CentOS-7-x86_64-Minimal-1708 VMware® Workstation 12 Pro 12.5.6 build-5528349
yum -y install perl gcc make kernel-headers kernel-devel
1. 使用ISO映像文件: C:\Program Files (x86)\VMware\VMware Workstation\linux.iso 2. 勾选已链接
linux.iso文件在VMware安装目录下找。php
mount /dev/cdrom /mnt cp /mnt/VMwareTools-10.1.6-5214329.tar.gz ~/ cd ~ tar zxvf VMwareTools-10.1.6-5214329.tar.gz cd vmware-tools-distrib/ ./vmware-install.pl
//...一直回车直至出现一下信息表明安装完毕 To enable advanced X features (e.g., guest resolution fit, drag and drop, and file and text copy/paste), you will need to do one (or more) of the following: 1. Manually start /usr/bin/vmware-user 2. Log out and log back into your desktop session 3. Restart your X session. Enjoy, --the VMware team
umount /mnt
1. 选择:老是启用 2. 添加目录便可
cd /mnt/hgfs ls
设置成功的话,能够看到共享的文件夹node
windows共享目录没法建立软连接, 有些项目像laravel,node_modules安装的时候会出现问题。我是经过rsync同步的方式,同步共享目录里的项目到另外一个linux目录下。虽然不是很优雅,可是比较实用
rsync -vzrtopgu --progress /mnt/hgfs/www/blog /srv/projects/
vim /opt/scripts/rsync.php <?php function rsync_projects() { $command = 'rsync -vzrtopgu --exclude=index.php /mnt/hgfs/www/blog /srv/projects/'; $output = []; exec($command , $output); $str = '---------' . date('Y-m-d H:i:s') . '---------' . PHP_EOL; if($output) { foreach ($output as $val) { $str .= $val . PHP_EOL; } } @file_put_contents('/opt/scripts/rsync.log', $str, FILE_APPEND); } rsync_projects();
同步后的项目入口文件index.php开头处加入linux
require '/opt/scripts/rsync.php';
rsync.php
的同步命令是rsync -vzrtopgu --exclude=index.php /mnt/hgfs/www/blog /srv/projects/
。排除了index.php
laravel
开发项目/mnt/hgfs/www/blog
, 实际运行项目/srv/projects/blog
。每次想要查看修改代码效果的时候会访问/srv/projects/blog
入口文件index.php
,同时执行rsync.php
脚本同步文件。这样作实际上比加到crontab执行或者监测文件变化同步都简单实用