嵌入式技术论坛
直播中

fansz

8年用户 1181经验值
擅长:制造/封装
私信 关注
[经验]

在windows上使用VMware Player虚拟机的小技巧

有在windows上面使用VMware Player虚拟机,并使用使用vmhgfs挂载windows上面的目录,使用上倒是挺方便。
但是编译大些的项目,相比虚拟机里面的linux上面ext4文件系统就慢多了。
现在调整了一缓存相关的参数,快多了。以编译F133的工程为例,原来2分半,现在20秒。
具体参数细节可以再自己研究调整下。
当然,有了缓存意味着2边同步的时间会变长,不过我的应用主要是在win上面编写和调试。linux里面用docker主要做编译工作,所以两边不会对同一个文件进行读写,且两边切换是手动的,过程至少也要几秒,所以问题不大。

$ vmhgfs-fuse -h

$ vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other,entry_timeout=3,negative_timeout=3,attr_timeout=3,auto_cache

测试好后建议直接写到/etc/fstab中

$ cat /etc/fstab

...

.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other,entry_timeout=3,negative_timeout=3,attr_timeout=3,defaults 0 0

vm+vmhgfs 默认参数

$ vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other

$ time scons -j12

real 2m27.556s

user 0m35.779s

sys 0m46.991s

vm+vmhgfs 调整参数

$ vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other,entry_timeout=3,negative_timeout=3,attr_timeout=3,auto_cache

$ time scons -j12

real 0m20.262s

user 0m50.965s

sys 0m21.402s

vm+ext4

$ time scons -j12

real 0m9.358s

user 1m4.950s

sys 0m19.415s


原作者:aozima

更多回帖

发帖
×
20
完善资料,
赚取积分