Pages

Subscribe

Find us on Google Plus

2014年6月16日月曜日

Debian 系ディストリビューションでの chkconfig

最近、Raspberry Pi をいじってて、OS は Raspbian にしてみたんだけど、netatalk いれて自動起動の設定しようとして、chkconfig が無いことに気付いた。普段、CentOS しか触ってないので、Debian 系のディストリビューションで使えないの知らなかった。。。

調べてみると、apt でインストールできるみたい。

@raspberrypi ~ $ apt-cache search chkconfig
chkconfig - system tool to enable or disable system services

@raspberrypi ~ $ apt-get install chkconfig

無事に設定出来ました。

@raspberrypi ~ $ chkconfig --list netatalk
netatalk                  0:off  1:off  2:on   3:on   4:on   5:on   6:off

2014年6月15日日曜日

Raspberry Pi へ VNC でアクセスする

インストール

$ sudo apt-get update
$ sudo apt-get install tightvncserver

起動

初回はパスワードを聞かれるので設定する。
view-only は使わないと思うので設定しない。

$ tightvncserver 

You will require a password to access your desktops.

Password: 
Verify:   
Would you like to enter a view-only password (y/n)? n

New 'X' desktop is raspberrypi:1

Creating default startup script /home/doi/.vnc/xstartup
Starting applications specified in /home/doi/.vnc/xstartup
Log file is /home/doi/.vnc/raspberrypi:1.log

解像度を指定して起動する場合(下の例では 1400x900 にしていしている)

pi@raspberrypi ~ $ vncserver :1 -geometry 1400x900 -depth 24
A VNC server is already running as :1

確認

TCP5901でLISTENしてるのを確認。

$ lsof -i
COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
Xtightvnc 13154  doi    0u  IPv4  65363      0t0  TCP *:x11-1 (LISTEN)
Xtightvnc 13154  doi    3u  IPv4  65365      0t0  TCP *:5901 (LISTEN)

接続方法

Macからの接続方法は、以下のとおり。

Finderを開いてCommand + k で「サーバへ接続」を表示。

「サーバアドレス」の欄へ次の通り入力、vnc://"RaspberryPiのIPアドレス:ポート番号"

vnc_finder

接続出来ました。

vnc_RaspberryPi