Ubuntu 18.04.2 インストール直後の設定


2019-03-21 (木)
ホストマシンは CentOS (未だに 6.10 を使ってます。) で、外付けの 2 TB ディスク 1 に VMware でインストールした Ubunto18.04.1 が、調子良く使えるようになっていました。るんるん気分でいたのですが、ある時、VMware がエラーを吐いて起動しなくなってしまいました。調べてみたら、外付け USB ディスクのセクター不良だと言うことがわかりました。よって、このディスクにあるデータをすべて、他の外付け USB ディスク 2 の方へ BackUP ! 
ところが、ただのデータなどは移動できたのですが、VMware 上のゲストである Ubuntu18.04.1 だけが再びエラーを吐き出してストップ。 何度挑戦してもダメなので、諦めて、再度ホスト OS と同じハードディスク上にインストールしなおしすることに・・・・。


今回 CentOS 6.10 をホストとして、VMware にゲストインストールしたのは、Ubuntu18.04.2 。久々の覚え書です。
 



root ユーザのパスワードとログイン

インストールして再起動、解像度などをとりあえず(まだ VMware-tools が入ってないので )設定して見やすいデスクトップ表示にしておいてから、端末上で操作。
https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q10190946705 をそのままなぞらせて頂きました。

  
    & sudo su -
    # passwd root
  
 

この後は root でログインできるように /etc/gdm3/custom.conf と /etc/pam.d/gdm-password をそれぞれの使いやすいエデイタで編集。私は vi です。

  
    & su -
    # vi  /etc/gdm3/custom.conf     
  
 
開いた custom.conf は、vi の場合は i で挿入モードになり、挿入モードを終わるときには Esc --> : (コロン) --> wq (上書き保存) --> 元の端末。

下のような感じで表示されるので [security] の箇所へ AllowRoot=true の文字列を追記して上書き保存します。

  
     # GDM configuration storage
     # 
     # See /usr/share/gdm/gdm.schemas for a list of available options.
      
     [daemon]
     # Uncoment the line below to force the login screen to use Xorg
     # WaylandEnable=false

     # Enabling automatic login
     # AutomaticLoginEnable = true
     # AutomaticLogin = user1
     
     # Enabling timed login
     #  TimedLoginEnable = true
     #  TimedLogin = user1
     #  TimedLoginDelay = 10
     
     [security]
     AllowRoot=true
     
     [xdmcp]
     
     [chooser]
     
     [debug]
     # Uncomment the line below to turn on debugging
     # More verbose logs
     # Additionally lets the X server dump core if it crashes
     #Enable=true    
  
 

次は /etc/pam.d/gdm-password なのですが、これも上記と同じように開いて auth required pam_succeed_if.so user != root quiet_success の行を下のようにコメントアウト。

  
     #%PAM-1.0
     auth    requisite       pam_nologin.so
     #auth   required        pam_succeed_if.so user != root quiet_success
     @include common-auth
     auth    optional        pam_gnome_keyring.so
     @include common-account
     # SELinux needs to be the first session rule. This ensures that any 
     # lingering context has been cleared. Without this it is possible 
     # that a module could execute code in the wrong domain.
     session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so close
     session required        pam_loginuid.so
     # SELinux needs to intervene at login time to ensure that the process
     # starts in the proper default security context. Only sessions which are
     # intended to run in the user's context should be run after this.
     session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so open
     session optional        pam_keyinit.so force revoke
     session required        pam_limits.so
     session required        pam_env.so readenv=1
     session required        pam_env.so readenv=1 user_readenv=1 envfile=/etc/default/locale
     @include common-session
     session optional        pam_gnome_keyring.so auto_start
     @include common-password
  
 

これで root ユーザでログインができるはずですが、エラーメッセージが出力されるかもしれないので、先手を打っておきたいと思います。
root/.profile を開いてみます。

  
    # ~/.profile: executed by Bourne-compatible login shells.
      
    if [ "$BASH" ]; then
      if [ -f ~/.bashrc ]; then
        . ~/.bashrc
      fi
    fi
    
    mesg n || true
  
 

開いてみた root/.profile の最後の行の mesg n || true をコメントアウトし、以下のような文字列を追記しておきます。ちなみに `tty -s`` はシングルクォートではなくバッククォート ( Shift + @ ) です。

  
    if `tty -s`; then
    mesg n
    fi
  

下が編集しなおした root/.profaile です。

  
    # ~/.profile: executed by Bourne-compatible login shells.
      
    if [ "$BASH" ]; then
      if [ -f ~/.bashrc ]; then
        . ~/.bashrc
      fi
    fi
    
    #mesg n || true
    
    if `tty -s`; then
      mesg n
    fi
  

これで root ユーザでログイン可能になりました。参考サイトさんに感謝。



open-vm-tool のインストール

root ユーザで操作します。

  
   # apt-get install open-vm-tools
    デスクトップ拡張もインストールするようなら以下を。
   # apt-get install open-vm-tools-desktop
  



日本語入力に ibus-kasumi を使う

ubuntu は root だと日本語入力がままならないので kasumi をインストールすることに。もちろん root 画面で。
インストールする前に、言語の設定で ibus と mozic が入っているかどうかを確認しておく。インストールされていなかったらインストールしておくこと。

以下のコマンドを端末で実行すると日本語入力 kasumi がインストールされるので、インストール終了後は再起動する。

  
   # apt-get install kasumi ibus-anthy
  

再起動後、設定パネルを出し、地域と言語の項目を開き、入力ソースの + ボタンを押し、日本語を選択し、anthy を追加しておく。 元の、地域と言語の画面へ戻ったら、anthy を上へ持ってくる。日本語(無印)は使わないと思うので、一番下へもってくるか、はずしてしまうか? 私は anthy を 1 番上にし、次が mozic が 2 番めで、日本語(無印)は 1 番下になっています。最後にデスクトップの上のパネルにある日本語入力モードを開いて、anthy を選択。メモ帳か何かで、日本語の切り替えと入力が確実にできるかどうかを確認。



その他もろもろ・・・・

後は自分にとって使いやすいもの、カスタマイズなど・・・

  1. ファイルマネージャの SpaceFM
  2. GNOME Tweaks
  3. クラシックメニュー・インジケーター
  4. Extensions
  5. Files Menu
  6. Extension Shortcuts
  7. Pluma

さてさて、これでまた当分遊べそうですが、壊れた USB 外付けのディスクの代用品を至急に購入せねば・・・・

ページのトップへ戻る