Category: macos

Add vCPU in VMware Fusion for Windows

Add vCPU in VMware Fusion for Windows

As Windows Pro only supports 2 CPU sockets, after added 4 cores in VMware Fusion, the OS is still shown as 2 vCPU. To avoid this is, need to change cpuid.coresPerSocket to handle more than 2 cores.

Parameters

In .vmx file change following parameter, numvcpus is the total number of cores, which can be changed in GUI. cpuid.coresPerSocket should be changed to half of numvcpus.

numvcpus = "4"
cpuid.coresPerSocket = "2"

References

Odd behavior with Fusion 12.2 and Windows 11

How to disable Android File Transfer in Mac OSx

How to disable Android File Transfer in Mac OSx

Android File Transfer Agent conflicts with Garmin Music, so need to disable it in order to work.

Steps

Open the “Activity Monitor” and kill the “Android File Transfer Agent” process. Open “System Preferences” > “Accounts”. Go to the “Login Items” tab of your user. Remove the “Android File Transfer Agent”.

References

Avoid Android File Transfer starting automatically in Mac OS X after Android device plugin to USB port

Show dd progress in MacOS

Show dd progress in MacOS

The default dd command in MacOS doesn't have progress option.

Solution

Send SIGINFO signal to the dd command.

Press Control-T

By pressing the Control-T character in dd terminal, you are sending the same SIGINFO signal to the dd command.

Run kill command

Run following command in another Shell.

pkill -INFO -x dd

or

kill -INFO <pid>

References

How can I track progress of dd

Make keys behave like Windows on MacOS

Make keys behave like Windows on MacOS

I tried, but failed for Control Arrow Keys. Anyway I decided drop this idea, because it is a partial solution, the Control Arrow Keys doesn't work.

Steps

Create a file ~/Library/KeyBindings/DefaultKeyBinding.dict has following contents

{
  "\UF729"  = moveToBeginningOfLine:; // home
  "\UF72B"  = moveToEndOfLine:; // end
  "$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift+home
  "$\UF72B" = moveToEndOfLineAndModifySelection:; // shift+end
  "^\UF729" = moveToBeginningOfDocument:; // ctrl+home
  "^\UF72B" = moveToEndOfDocument:; // ctrl+end
  "^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl+shift+home
  "^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl+shift+end
  "^\UF702" = "moveWordBackward:"; // ctrl+leftarrow
  "^\UF703" = "moveWordForward:"; // ctrl+rightarrow
  "^$\UF702" = "moveWordBackwardAndModifySelection:"; // shift+ctrl+leftarrow
  "^$\UF703" = "moveWordForwardAndModifySelection:"; // shift+ctrl+rightarrow
}

Alternatively, change Line to Paragraph, depending on your prefers.

References

Make Home & End keys behave like Windows on Mac OS X

Disable Apple mouse swipe action

Disable Apple mouse swipe action

It is very easy for Apple mouse understands wrongly, and take action to back to my previous page. As the result, my few hours working on WordPress disappered.

Change mouse

Then I start using normal mouse, but hard to change between screen using keyboard, my remote control and virtual machine doesn't understand the keys, and holding keyboard actions made wrong password in login screen.

Disable swipe action

Then I found the way to disable swipe action as below

system preferences>trackpad or mouse>more gestures tab>uncheck "swipe between pages".

References

I just accidentally swiped right on my web page...how do I get it back?

Ping fails but nslookup works in MacOS

Ping fails but nslookup works

When performing nslookup, the IP can be returned. But when performing ping, return following error

ping: cannot resolve <hostname>: Unknown host

Causes

Second DNS server issue

The second DNS server isn't resolving the IP address.

Another DHCP server issue

Another DHCP server provide different DNS server.

Fix

killall -HUP mDNSResponder

References

DNS lookup fails but nslookup works

Time Machine stuck at Stopping

Time Machine stuck at Stopping

Recently upgraded my DS1812+ memory, the backup job was stuck, but I don't know whether they are related. Because I was rebooting in the morning, but the backup was stuck at 4pm.

Fix

To fix the issue, run following command

sudo killall backupd

Some people mentioned commands

sudo service com.apple.metadata.mds stop
sudo service com.apple.metadata.mds start

But there is no service command in my MacOS.

References

10.5: How to abort a stuck Time Machine backup