Getting Good Performance with VMware Workstation Player

VMware Workstation Player has always been my favorite solution for desktop virtualization. It’s free, well-featured and easy to use. The main issue with it is the performance, especially the anomalously high disk utilization. Installing a guest system on a SSD is not always possible and affordable, and the excessive access may cause unwanted waste on the limited lifetime of the SSD.

Anyway, it accesses the disk frequently for reasons. Only a few years ago, many PCs were running with 512 MB of RAM. It was hard to allocate adequate memory for a guest system so there were many techniques developed to make the virtualization possible. Basically, they are the equivalences of virtual memory or SWAP.

However, things are much different now, where modern PCs are easily 8, 16 or even 32 GB of memory (the price is currently insane though LOL). I am using a laptop with 12 GB RAM, so allocating 4 GB of memory is usually sufficient for most of guest operating systems and at the same time should not create any significant negative impact to the host system. The following three tweaks should prevent the unnecessary disk access.

First, disable the virtual memory or swap in guest system. This is very optional because an operating system usually has highly optimized strategies of how to use virtual memory or swap. As long as you don’t open too may programs or pages, the systems will stick to physical memory. Disabling virtual memory restricts the flexibility. However, if you are very annoyed the noise of disks like me, you can turn it off.

Second, disable Memory Trimming. Memory Trimming is helpful when the overall RAM is low. It shrinks the guest RAM by storing inactive chunks of memory to the hard disk when the host needs more memory. In other words, it’s the host-managed virtual memory for a guest system. It can be disabled by adding the following line in the virtual machine configuration file (.vmx):

MemTrimRate= "0" 

Finally and most importantly, disable the virtual machine paging file (uuid.vmem). If you only want to use the guest system like a normal computer, and you have no need for crash recovering or creating snapshots (you don’t have snapshots in Player anyways), then there is no need to have a copy of the guest RAM in you disk. Disabling the file will make your life so much better. Just add the following line in the configuration file:

mainMem.useNamedFile = "false"

Now, your guest system only accesses your disk when it actually accesses its own disk. For any PC with sufficient RAM, the performance increase is very obvious.

References:
http://sanbarrow.com/vmx/vmx-advanced.html#mainmem
https://pubs.vmware.com/workstation-9/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-A968EF50-BA25-450A-9D1F-F8A9DEE640E7.html

Enable NVIDIA Optimus on Linux Deepin

Of course there is no real NVIDIA Optimus on Linux, but I found an article that gives some workaround: https://bbs.deepin.org/forum.php?mod=viewthread&tid=132312. Below are the steps described in the article.

Install drivers

sudo apt-get install bumblebee-nvidia nvidia-driver nvidia-settings

Verify the installation

sudo apt-get install mesa-utils

note: mesa-utils package provides useful tools to show glx information

optrun glxinfo | grep NVIDIA

note: this step checks whether the installation succeeded.

optirun glxgears -info

note: if you see a notice of your graphics card, you are good.

Run games with your nvidia graphics

Primusrun game

or

optirun game

to run steam games:

https://support.steampowered.com/kb_article.php?ref=6316-GJKC-7437

Windows 10 update KB3201845 causes disk usage issue

2 days ago, my girlfriend was playing World of Warcraft on my desktop computer which had just applied a new Windows 10 update, and she told me my computer was super laggy, and after restarted the computer a few times it did not get any better. So I took a look.

Process System was apparently accessing my disk like no tomorrow. Then I opened Resource Monitor to find out what files was it really working with. And it turned out to be something I had never seen:

C:\Windows\Temp\WPR_initiated_DiagTrackAotLogger_WPR System Collector.etl

And what is WPR exactly? After some search on Google, I found that it stands for Windows Performance Recorder, and its purpose , as it claims, is to track the performance and the resources consumption of a computer. Such thing should be used to help improve the performance, but funny enough, it made my computer barely usable. (link)

I kept searching, and finally I found temporary solution, but a solution nonetheless. (link)

wpr -cancel

I wrapped it into a .bat file, and told my girlfriend to execute it as admin should it happen again.

Things weren’t done yet. Yesterday my laptop received windows update as well, the same issue appeared. So I have become certain that something in this update was awfully wrong. Although thanks to the SSD, my laptop was still quite responsive, this shall not be tolerated. And I searched on Google again, and this time, I noticed many more users are suffering from the same issue than I did it the first time. And under the post I found the temporary solution, I found the ultimate fix (hopefully):

Go to All settings -> Privacy -> Feedback & diagnostics
change “Send your data to Microsoft” to Basic/Enhanced

I noticed significant change with my disk usage when I switched to Basic.

 

 

 

Fix for “internal error” connecting with RDP

The windows remote desktop has stopped working for me for a couple of days, and at the same time FIFA 17 was not launching either, but crashing at the language select screen. I never thought they’d be the same issue, until I fixed one and the other was also magically fixed!

The symptom was that, when clicking “connect”, the following error message popped up “An internal error occurred.”. Sometimes instead of the error message, it stuck at “initiating remote desktop connection”. Then I launched Ubuntu in a virtual machine, and I could connect to the remote desktop using a client in Ubuntu. Another thing I noticed is that, on my Windows, when I chose to connect to a target that did not exist, it still got the same error or simply stuck. This means two things:

  1. The remote server is working
  2. The connection is working

So I started to look on the internet and eventually I found this fix:

netsh winsock reset all

http://superuser.com/a/984351/671434

Now everything is working. Cheers!