Macos setup
Table of Contents
Setup a NFS server on macos and mount it on linux vms.
NFS Server
配置文件:/etc/exports
/Volumes/work -alldirs -rw -mapall=schspa:staff -network 10.211.55.0 -mask 255.255.255.0
mount nfs client.
disable english input method in rime
parallels
mds_stores
mds_stores是Spotlight和finder用到的后台进程,主要用来对磁盘上的文件做索引。
当硬盘上存在大量文件时,会占用大量系统资源来进行index操作。
开启/关闭索引
## 关闭索引sudo mdutil -a -i off## 开启索引sudo mdutil -a -i on## 关闭部分磁盘索引sudo mdutil -d /Volumes/Work
sleep issues
查看休眠参数
$ pmset -gSystem-wide power settings:Currently in use:standby 1Sleep On Power Button 1womp 0autorestart 0hibernatefile /var/vm/sleepimageproximitywake 0powernap 0networkoversleep 0disksleep 0standbydelayhigh 150sleep 1 (sleep prevented by Google Chrome, mds, coreaudiod)autopoweroffdelay 28800hibernatemode 0autopoweroff 1ttyskeepawake 1displaysleep 1 (display sleep prevented by coreaudiod)highstandbythreshold 50standbydelaylow 120
sleep参数解析
查看唤醒源
$ pmset -g assertionsAssertion status system-wide:BackgroundTask 1ApplePushServiceTask 0UserIsActive 1PreventUserIdleDisplaySleep 1PreventSystemSleep 0ExternalMedia 0PreventUserIdleSystemSleep 1NetworkClientActive 0Listed by owning process:pid 948(Google Chrome): [0x00006bdb000196fd] 00:17:41 NoIdleSleepAssertion named: "Playing audio"pid 33480(mds): [0x000067e0000b9657] 00:34:41 BackgroundTask named: "com.apple.metadata.mds.power"pid 208(hidd): [0x00006dbd00099719] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle serviceID:1000004b1 name:AppleUserHIDEventSe product:GT BLE60 eventType:3"Timeout will fire in 60 secs Action=TimeoutActionReleasepid 257(coreaudiod): [0x00005eee000194c3] 01:12:50 PreventUserIdleSystemSleep named: "com.apple.audio.~:AMS2_StackedOutput:0.context.preventuseridlesleep"Created for PID: 2665.pid 257(coreaudiod): [0x00005eee000594c5] 01:12:50 PreventUserIdleDisplaySleep named: "com.apple.audio.~:AMS2_StackedOutput:0.context.preventuseridledisplaysleep"Created for PID: 2665.Kernel Assertions: 0x4=USBid=501 level=255 0x4=USB mod=1970/1/1 08:00 description=com.apple.usb.externaldevice.14200000 owner=iPadIdle sleep preventers: IODisplayWrangler
issues
com.apple.parsec-fbf.flush
parsec-fbf agent prevents Idle Sleep (automatic) on macOS Catalina 10.15.2
- fixup:
launchctl unload -w /System/Library/LaunchAgents/com.apple.parsec-fbf.plist
virtualbox crash
Thread 2 Crashed:: Dispatch queue: com.apple.root.default-qos0 libsystem_kernel.dylib 0x00007fff67c78ad6 __abort_with_payload + 101 libsystem_kernel.dylib 0x00007fff67c7a3df abort_with_payload_wrapper_internal + 802 libsystem_kernel.dylib 0x00007fff67c7a411 abort_with_payload + 93 com.apple.TCC 0x00007fff5e34a59f __CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 1634 com.apple.TCC 0x00007fff5e348531 __TCCAccessRequest_block_invoke.114 + 5005 com.apple.TCC 0x00007fff5e348a58 __tccd_send_message_block_invoke + 2316 libxpc.dylib 0x00007fff67d5d1ff _xpc_connection_reply_callout + 367 libxpc.dylib 0x00007fff67d5d187 _xpc_connection_call_reply_async + 698 libdispatch.dylib 0x00007fff67abe6c2 _dispatch_client_callout3 + 89 libdispatch.dylib 0x00007fff67ad515d _dispatch_mach_msg_async_reply_invoke + 36910 libdispatch.dylib 0x00007fff67acd5f9 _dispatch_kevent_worker_thread + 131611 libsystem_pthread.dylib 0x00007fff67d18a85 _pthread_wqthread + 36212 libsystem_pthread.dylib 0x00007fff67d17b77 start_wqthread + 15
fix: https://forums.virtualbox.org/viewtopic.php?f=8&t=97141
ntfs
ntfs-3g
- ntfs not showing on finder
https://github.com/osxfuse/osxfuse/issues/574
add -oallow_other -oauto_xattr
Swap
setup rclone mount
脚本参考: https://github.com/Callumpy/macos-rclone-launchd
cat /Library/LaunchDaemons/nas.raspi.plist
restart
sudo diskutil unmount force ~/Documents/naslaunchctl stop /Library/LaunchDaemons/nas.raspi.plistlaunchctl start /Library/LaunchDaemons/nas.raspi.plist
sshfs
brew install sshfs 2>&1 || true
https://github.com/telepresenceio/telepresence/issues/1654
brew install --cask macfusebrew install gromgit/fuse/sshfs-macbrew link --overwrite sshfs-mac