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 -g
System-wide power settings:
Currently in use:
standby 1
Sleep On Power Button 1
womp 0
autorestart 0
hibernatefile /var/vm/sleepimage
proximitywake 0
powernap 0
networkoversleep 0
disksleep 0
standbydelayhigh 150
sleep 1 (sleep prevented by Google Chrome, mds, coreaudiod)
autopoweroffdelay 28800
hibernatemode 0
autopoweroff 1
ttyskeepawake 1
displaysleep 1 (display sleep prevented by coreaudiod)
highstandbythreshold 50
standbydelaylow 120
sleep参数解析
查看唤醒源
$ pmset -g assertions
Assertion status system-wide:
BackgroundTask 1
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 1
PreventSystemSleep 0
ExternalMedia 0
PreventUserIdleSystemSleep 1
NetworkClientActive 0
Listed 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=TimeoutActionRelease
pid 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=USB
id=501 level=255 0x4=USB mod=1970/1/1 08:00 description=com.apple.usb.externaldevice.14200000 owner=iPad
Idle 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-qos
0 libsystem_kernel.dylib 0x00007fff67c78ad6 __abort_with_payload + 10
1 libsystem_kernel.dylib 0x00007fff67c7a3df abort_with_payload_wrapper_internal + 80
2 libsystem_kernel.dylib 0x00007fff67c7a411 abort_with_payload + 9
3 com.apple.TCC 0x00007fff5e34a59f __CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 163
4 com.apple.TCC 0x00007fff5e348531 __TCCAccessRequest_block_invoke.114 + 500
5 com.apple.TCC 0x00007fff5e348a58 __tccd_send_message_block_invoke + 231
6 libxpc.dylib 0x00007fff67d5d1ff _xpc_connection_reply_callout + 36
7 libxpc.dylib 0x00007fff67d5d187 _xpc_connection_call_reply_async + 69
8 libdispatch.dylib 0x00007fff67abe6c2 _dispatch_client_callout3 + 8
9 libdispatch.dylib 0x00007fff67ad515d _dispatch_mach_msg_async_reply_invoke + 369
10 libdispatch.dylib 0x00007fff67acd5f9 _dispatch_kevent_worker_thread + 1316
11 libsystem_pthread.dylib 0x00007fff67d18a85 _pthread_wqthread + 362
12 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/nas
launchctl stop /Library/LaunchDaemons/nas.raspi.plist
launchctl start /Library/LaunchDaemons/nas.raspi.plist
sshfs
brew install sshfs 2>&1 || true
https://github.com/telepresenceio/telepresence/issues/1654
brew install --cask macfuse
brew install gromgit/fuse/sshfs-mac
brew link --overwrite sshfs-mac