LoginSignup
59
62

More than 5 years have passed since last update.

RaspberryPiをモニタ無し、キーボード無しでセットアップする

Last updated at Posted at 2014-06-05

ArchLinux / Raspbianをインストールして動かしてログインするところまでまとめています。
テレビにつなげば良いんですが面倒くさかったので!

前提条件

  • Macを使う
  • LinuxディストロはArchLinux or Raspbian
  • 有線LANがあってDHCPが動いている

用意するもの

それぞれアーカイブをダウンロードしておきましょう。

手順

SDカードにイメージをコピーする

Apple-Pi Bakerを使ってディスクイメージをSDカードにインストールします。

  1. Apple-Pi Bakerを起動します。
  2. MacにSDカードを挿入します
  3. Apple-Pi Bakerの SD-Cards 部分で認識されるのでクリックします
  4. IMG fileの右側にある をクリックしてディスクイメージファイルを選択します
  5. IMG to SD-Cardをクリックします
  6. 3分ほどで焼き上がります

kobito.1401980213.047385.png

RaspberryPiを起動する

RaspberryPiにSDカードを挿入して、Ethernetケーブルを接続し、電源を入れてください。

検索する

pingコマンドでネットワークを検索しましょう。わたしの自宅は192.168.0.0/24を使用しているので、おもむろにブロードキャストへ問い合わせました。

[key@mbp-retina] ping 192.168.0.255
PING 192.168.0.255 (192.168.0.255): 56 data bytes
64 bytes from 192.168.0.16: icmp_seq=0 ttl=64 time=0.093 ms
64 bytes from 192.168.0.3: icmp_seq=0 ttl=255 time=0.832 ms
64 bytes from 192.168.0.1: icmp_seq=0 ttl=255 time=1.129 ms
64 bytes from 192.168.0.15: icmp_seq=0 ttl=255 time=1.824 ms
64 bytes from 192.168.0.5: icmp_seq=0 ttl=64 time=3.306 ms
64 bytes from 192.168.0.12: icmp_seq=0 ttl=64 time=163.979 ms
64 bytes from 192.168.0.11: icmp_seq=0 ttl=64 time=191.068 ms
64 bytes from 192.168.0.16: icmp_seq=1 ttl=64 time=0.125 ms
64 bytes from 192.168.0.3: icmp_seq=1 ttl=255 time=0.891 ms
64 bytes from 192.168.0.1: icmp_seq=1 ttl=255 time=1.206 ms
64 bytes from 192.168.0.15: icmp_seq=1 ttl=255 time=1.916 ms

arpを使ってMacアドレスも確認してみます。

[key@mbp-retina] arp -a
? (192.168.0.1) at 0:1b:8b:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.2) at d8:30:62:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.3) at 0:26:bb:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.4) at (incomplete) on en0 ifscope [ethernet]
? (192.168.0.5) at 28:e7:cf:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.6) at 0:26:bb:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.7) at 0:1d:73:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.8) at 0:8:9b:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.9) at 0:17:ab:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.10) at 4:db:56:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.11) at e4:98:d6:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.12) at d8:30:62:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.14) at 4:1e:64:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.15) at f0:b4:79:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.17) at b8:27:eb:xx:xx:xx on en0 ifscope [ethernet]
? (192.168.0.18) at 0:23:18:xx:xx:xx on en0 ifscope [ethernet]

RaspberryPiのEthernetアドレスはハードウェアから読み込んでいないようです(参考)。ベンダIDはB8:27:EBなので、どうやら192.168.0.17がRaspberryPiのようです。

SSHで接続する

pingが通ればSSHでログイン出来ます。デフォルトユーザでRaspberryPiへログインしましょう。

distribution username password
ArchLinux root root
Raspbian pi raspberry
[key@mbp-retina] ssh root@192.168.0.17
root@192.168.0.17's password:
Welcome to Arch Linux ARM

     Website: http://archlinuxarm.org
       Forum: http://archlinuxarm.org/forum
         IRC: #archlinux-arm on irc.Freenode.net

[root@alarmpi ~]#

以上でログイン出来るようになりました!

ArchLinuxパッケージのアップグレード

pythonがないとansibleが動かない…。
pacmanコマンドを使ってシステムアップグレードとパッケージインストールする。

pacman -Syu python2

Raspbianパッケージのアップグレード

aptitude update
aptitude -y dist-upgrade

参考

59
62
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
59
62