LoginSignup
3
3

More than 3 years have passed since last update.

ChromeOSの/etcを弄る

Posted at

概要

  • chromeosではデフォルトでは、/etc以下のファイルを編集することはできません
  • linuxとしての設定を変えるには/etcのファイルを編集する必要があります
  • 環境は cloudready 83.4.27(Home Build)です

シェルの確保

  • chromeos本体のLinuxのシェルが必要です
    • chromeos上のコンテナで動くLinuxのシェルとは別物です
  • chromeブラウザ上で、ctrl+alt+tを入力します
  • ブラウザ上で新たなタブが開いてcroshといるメンテナンス用のシェルの一種が立ち上がります
  • croshはメンテナンス用のコマンドに限定されていますが shell コマンド入力すると通常のLinuxのシェルが立ち上がります
  • さらに sudo bash とするとrootのシェルが立ち上がります
    • そのままsudoを使い続けてもよいです

rootパーティション(/)の再マウント

  • 以後、rootでの作業です
  • デフォルトではrootパーティションのRWでの再マウントは禁止されています。
# mount -o remount,rw /
mount: cannot remount /dev/dm-0 read-write, is write-protected
  • セキュリティ機構を無効化して再起動します。再度、有効化はできないので覚悟が必要です
# disable_verity
# shutdown -r now
  • chromeosが再起動したらrootのシェルを用意してrootパーティションを再マウントします
# mount -o remount,rw /

編集例

# vi /etc/avahi/avahi-daemon.conf
  • before
[server]
host-name-from-machine-id=yes
  • after
[server]
host-name=rivoli
host-name-from-machine-id=no
  • これで他のPCからホスト名 rivoli.local でアクセスできるようになります
$ ping rivoli.local
  • 本当はこのやり方よりもちゃんとhostnameを設定した方がいいと思います(やり方が未調査)

参考URL

3
3
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
3
3