Ubuntu16.04サーバにNetatalkをインストールすることでOSX Time Machineのサーバとしても利用することができます。NetatalkはAppleのAFPプロトコルによるオープンソースのファイルシェアサーバです。
標準リポジトリでは最新のものが提供されていないためソースからコンパイルするかPPAを導入します。
ソースからのコンパイル
以下のサイトを参照してください。開発ツールの導入やコンパイル時の条件設定など初心者には敷居が高いため次のPPAの導入をお勧めします。
http://netatalk.sourceforge.net/wiki/index.php/Install_Netatalk_3.1.11_on_Ubuntu_16.04_Xenial
PPAの導入
PPAによるパッケージの検索
上記サイトで検索した結果から以下を採用。
sudo add-apt-repository ppa:sico/netatalk
sudo apt-get update
netatalkのインストール
sudo apt-get install netatalk
netatalk -V と afpd -V でバージョンなどを確認します。現時点での最新バージョンは3.1.11です。
netatalk -v
netatalk 3.1.11 - Netatalk AFP server service controller daemon
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. Please see the file COPYING for further information and details.
netatalk has been compiled with support for these features:
Zeroconf support: Avahi
Spotlight support: Yes
afpd: /usr/sbin/afpd
cnid_metad: /usr/sbin/cnid_metad
tracker manager: /usr/bin/tracker daemon
dbus-daemon: /usr/bin/dbus-daemon
afp.conf: /etc/netatalk/afp.conf
dbus-session.conf: /etc/netatalk/dbus-session.conf
netatalk lock file: /var/lock/netatalk
afpd -v
afpd 3.1.11 - Apple Filing Protocol (AFP) daemon of Netatalk
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. Please see the file COPYING for further information and details.
afpd has been compiled with support for these features:
AFP versions: 2.2 3.0 3.1 3.2 3.3 3.4
CNID backends: dbd last tdb mysql
afp.conf: /etc/netatalk/afp.conf
extmap.conf: /etc/netatalk/extmap.conf
state directory: /var/lib/netatalk/
afp_signature.conf: /var/lib/netatalk/afp_signature.conf
afp_voluuid.conf: /var/lib/netatalk/afp_voluuid.conf
UAM search path: /usr/lib/netatalk//
Server messages path: /var/lib/netatalk/msg/
/etc/netatalk/afp.confを編集します。
sudo pico /etc/netatalk/afp.conf
[username1]
path = /home/username1
rolist = username1
[TimeMachine]
path = /mnt/timemachine
time machine = yes
; Set volume size to 10000 (10GB)
vol size limit = 10000
valid users = username1
spotlight = no
Ubuntuサーバ側のユーザusername1を指定します。username1にのみTime Machineへのアクセス権を付与します。
username1は予めUbuntuサーバ側に登録しているユーザです。
path = /mnt/timemachine も任意ですがユーザusername1によるアクセス権を付与します。
sudo mkdir /mnt/timemachine
sudo chown -R username1:username1 /mnt/timemachine
avahi-daemonをインストールします。
sudo apt-get install avahi-daemon
NetatalkとAvahi-daemonを再起動してOSXからTime Machineディスクの選択をして下さい。
$ sudo service netatalk restart
$ sudo service avahi-daemon restart