Mac mini NAS

From LinnDocs
Jump to: navigation, search

This describes how to setup a Mac mini with an external USB drive as a NAS.


  • Mac mini with Mountain Lion
  • Monitor dongle as described here
  • WD My Passport 2TB USB drive
  • PC/Mac/iPad running a VNC viewer to remotely control the NAS

For initial setup ONLY, a monitor, keyboard and mouse will need to be connected to the Mac

Setup headless server

  • Enable screen sharing
    • Preferences -> Internet & Wireless -> Sharing
    • Enable Screen Sharing service
    • Ensure screen sharing is ON
    • Make a note of the address to connect to


    • In the Computer Settings dialog
      • Check both the boxes
      • Enter password to use for connection


  • Enable auto-login
    • Preferences -> Personal -> Security & Privacy-> General
    • Ensure Disable automatic login is un-checked


  • Disable downloaded from internet warning
    • Start terminal
    • Finder -> Applications -> Utilities -> Terminal
    • Enter the command defaults write LSQuarantine -bool NO and press enter


  • Disable sleep mode(s)
    • Preferences ->Hardware -> Energy Saver
    • Set both Computer Sleep and Display Sleep to Never


  • Restart Mac and ensure it starts up and logs in without user intervention
    • Apple -> Restart

Configure Remote Access

  • Install a VNC viewer on the PC/Mac to be used for remote access
    • On Windows suggest RealVNC
    • On Mac suggest Chicken VNC
    • On iPad there is VNC Viewer for £6.99, but this is untested
  • Open the VNC client and check connection to the Mac
    • Check the Mac is viewable and controllable from the VNC viewer

Check Operation

  • Close VNC viewer (F8 to exit full-screen mode)
  • Shutdown the Mac
  • Make headless
    • Disconnect monitor, keyboard and mouse from Mac
    • Connect the monitor dongle (described above) to Mac
  • Check operation
    • Power up Mac
    • Wait until powered up (after jingle)
    • Connect remotely using VNC viewer as described above

If this can now control Mac then headless operation is correctly setup

Setup Media Server

  • Install USB drive
    • Plug in USB drive and wait for it to be detected
    • Format drive for Mac OSX as described here
    • Create a folder called Music on this drive, to store the audio files
  • Install Media Server
  • Add to automatic startup
    • Preferences -> Users & Groups -> Current User -> Login Items
    • Click + and select Applications -> Asset


  • Set watched folders
    • Start Asset UPnP
    • Select Configure
    • Add the Music folder on the USB drive
    • Press the Apply button


Final Checks

  • Using Kinsky (from any machine on network)
    • Check Asset is listed in the Libraries list
    • Check audio content from USB drive is visible in library
  • Restart
    • Restart the Mac
    • Wait for it to fully start up
    • Using Kinsky check that Asset is visible, and audio content shows in library

Add Disk 'No-Sleep' Functionality

To prevent the USB hard drive from spinning down, which can lead to audio dropout, a utility is run once per minute to write (and flush) to the drive

  • Install the script ( in the root of the USB Drive

import time

f = open( '/Volumes/USBDrive1/timestamp.txt', 'at+' )
f.write( time.asctime( time.localtime() ) + '\n' )
  • Create the plist file ~/Library/LaunchAgents/com.user.clock.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"    "">  
<plist version="1.0">
  • Add this file to the launchctl executor
launchctl load ~/Library/LaunchAgents/com.user.clock.plist