CoLinuxインストールdebian設定編

CoLinuxインストールネットワーク設定編 が最大の山なので、ここが終われば後は簡単です。いつも通り debianの基本設定を行っていきます。

最初 vi も何も入っていませんので、debianを最新の環境まで持っていきます。
注意; keybordがUSタイプになっています。変更するには→CoLinux TIPS

  • IPアドレスの設定

Bridgeの場合

# ifconfig eth0 192.168.0.111  <--お使いのLANから空いているIPアドレス
# route add default gw 192.168.0.1  <--ゲートウェイ

NATの場合 (CoLinuxインストールネットワーク応用編 参照)

# ifconfig eth0  192.168.100.2         等
# route add default gw  192.168.100.1  等
  • UNIXパスワードの設定
# passwd
Enter new UNIX password: 表示されないので注意
Retype new UNIX password:
passwd: password updated successfully
  • 一般ユーザーの追加
# adduser ユーザ名    
Adding user `ユーザ名'...
Adding new group `ユーザ名' (1000).
Adding new user `ユーザ名' (1000) with group `username'.
Creating home directory `/home/username'.
Copying files from `/etc/skel'
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for kaihatsu
Enter the new value, or press ENTER for the default
        Full Name []:      (改行)
        Room Number []:    (改行)
        Work Phone []:     (改行)
        Home Phone []:     (改行)
        Other []:          (改行)
Is the information correct? [y/N] y

ユーザ名 の部分は好きな名前を入力してください。

  • ネームサーバの設定 (IPアドレスは置き換えてください)
# echo "nameserver 192.168.1.1" > /etc/resolv.conf
  • パッケージ一覧のダウンロード、最新環境へ更新
# apt-get update
# apt-get dist-upgrade

実行してしばらく経つといろいろと聞いてきます。基本的にはデフォルトで構いませんが、例を次に挙げておきます。

What interface should be used for configuring packages? → Dialog → OK
See only guestions that are of what priority and higher? → medium → OK
Do you want system wide readable home directories? → Yes
Do you want to upgrade glibc now? → y
Do you wish to restart services? → y
May I update your system? → y
Should man and mandb be instaled 'setuid man'? → No
LILO won't work if you don't do this〜 → OK
  • apt-get installの使い方
# apt-get install パッケージ名

依存関係があると、他のファイルも一緒に入れるか聞いてきます。

Do you want to continue? [Y/n]

ので、入れる場合はY。

  • viやtelnet等インストール
# apt-get install nvi telnetd
  • 忘れないうちにIPアドレスの設定
# vi /etc/network/interfaces
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian  installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
   address 192.168.100.2  ←変更する
   netmask 255.255.255.0
   gateway 192.168.100.1  ←変更する

DHCPクライアントとする場合は以下の様に。

auto eth0
iface eth0 inet dhcp              ←このように
#iface eth0 inet static           ←以下アドレスなどはコメントアウト
#   address 192.168.0.40
#   netmask 255.255.255.0
#   gateway 192.168.0.1
  • sambaのインストール (Windowsとのファイル共有)
# apt-get install samba
Do you wantto continue? [Y/n] y

この後、各種初期設定のためにいくつかの質問に答える必要があります。カーソルキーで選択し、Tabでボタン間を移動します。

Workgroup/Domain Name?

自分の利用するワークグループ、ドメインを大文字で入力し、OK。

これ以降は基本的にはデフォルトでOKです。

Use password encyption? → Yes
Modifysmb.conf to use WINS settings fron DHCP? → No
How do you want to run Samba? → daemonsを選択 → OK 
Create samba password database, /var/lib/samba/passdb.tdb? → YES

これでsambaのインストールは完了です。次にsamba用のパスワードを設定します。

# smbpasswd -a -U ユーザ名
New SMB password:
Retype new SMB password:

設定ファイルの編集。

# vi /etc/samba/smb.conf

基本的な設定項目です。参考にして無い項目は書き足してください。

[global]
  coding system = euc                    ←この行と
  dos charset = CP932                    ←この行と
  unix charset = EUC-JP                  ←この行は新規追加になるので[global]の下あたりに書いておく
  workgroup = WORKGROUP
  encrypt passwords = true
[homes]
  comment = Home Directories
  browseable = no
  writable = yes                         ←noをyesに変更する

sambaの再起動

# /etc/init.d/samba restart
Stopping Samba daemons: nmbd smbd.
Starting Samba daemons: nmbd smbd.

WINDOWS PC のエクスプローラから

\\IPアドレス\

を開くと colinuxのホームディレクトリがが見えるようになります。

  • NFSサーバのインストール(Linuxでのファイル共有)
#apt-get install nfs-user-server

設定ファイルを編集して、共有フォルダを指定します。

※例:/homeをリードオンリーで全員から見れるようにする。

#vi /etc/exports
/home    192.168.100.0/255.255.255.0(ro,no_root_squash)

nfsの再起動

#/etc/init.d/nfs-user-server restart
Stopping NFS servers: mountd nfsd.
Starting NFS servers: nfsd mountd.

以上でDebianの環境は整ったと思います。

では、次に CoLinuxインストール開発環境の構築編 へ進み、SH用のクロスコンパイル環境も構築しちゃいましょう。

Debian FAQ も参考にしてみてください。

関連リンク

  1. CoLinuxインストール導入編
  2. CoLinuxインストール基本設定編
  3. CoLinuxインストールネットワーク設定編
  4. CoLinuxインストールdebian設定編
  5. CoLinuxインストール開発環境の構築編
  6. CoLinuxインストールQt/Embedded編
  7. CoLinuxインストールネットワーク応用編
  8. CoLinux TIPS
  9. Debian FAQ

自動リンク

コメント欄