Chromebook向けLinux(Crostini):安全な開発 — Google I/O 2019
このページのタイトル、字幕、要約、読書メモは保存済みの AI 翻訳です。誤りが含まれる場合があります。タイムスタンプは原文と同じです。原文の字幕を開き、元の動画と照合できます。
Googleのエンジニアが、Chromebook向けLinux(Crostini)が開発者のワークロードを仮想マシン内に隔離しつつ、Chrome OSのユーザーデータを安全に保つ仕組みを説明します。
文字起こしの出典:YouTubeの手動字幕。VidleafによるAI句読点付与。元の文言とタイムスタンプのアンカーは保持されています。元の文字起こしは以下でご覧いただけます。
AI生成の要約
Sudha Broslawsky、Dylan Reid、Tom Buckleyが、開発者が新しいフレームワークを採用するのではなく、シンプルさとセキュリティのバランスを取ることで安心を得る手段として、Chromebook上のLinux(Crostini)を紹介します。I/Oでの発表以来、Chromebook上のLinuxはお気に入りのエディタ、IDE、ツールを実行でき、50%以上のChromebookでサポートされています。セットアップは数回のクリックで完了し、VMがダウンロードされ、コンテナがバックグラウンドで設定され、Git、Vim、APT、.debサポートを備えた標準的なDebian環境とターミナルが残り、グラフィカルアプリはランチャーに表示されます。セキュリティはChrome OSの多層アプローチに依存しています。Rustで書かれたクロスVMプログラムが小さなAPIのみを公開し、隔離された柱(乱数、ディスプレイ、USB)に分割された仮想化レイヤーがあり、CanonicalのLXDがDebianシステムコンテナを提供します。ファイル共有には、厳重に隔離された9Sという名前のRust製9Pサーバーを使用するため、コンテナ、VM、サーバーはそれぞれ共有ファイルのみを認識し、Linux FilesディレクトリがLinuxのホームディレクトリとして機能します。Linuxはユーザーが権限を付与するまでデバイスの他の部分にアクセスできず、右クリックの「Share with Linux」でフォルダを共有でき、Google Driveのフォルダも含まれ、共有は設定で解除できます。Webサーバーはハイパーバイザー下のVM内のコンテナで実行され、VSOCKベースのポートフォワーディングによりChromeが信頼されたドメインとしてlocalhost 8080に到達できます。USBデバイスは明示的に許可する必要があり、クロスVMジェイル、最小限の攻撃面、Rustのメモリ安全性、ファジングなどの保護があり、これはUSBデバイスリストがユーザーのフィンガープリントに使われる可能性があるためでもあります。Chrome OSシェル(Control-Alt-T)から高度なツールを利用でき、Termina VMとPenguinコンテナ用のVMCコマンド、LXD経由のLXCコマンド、btrfsコピーオンライトスナップショットなどがあります。LXC Restoreはコンテナを保存されたスナップショットに戻し、複数のコンテナで別々のセットアップが可能で、LXC Copyで作成します。Debianは最も簡単な選択肢として選ばれましたが、ユーザーはそれに縛られず、Canonicalのイメージサーバーから多くのディストリビューションが利用可能で、例えばPacManを使うArchコンテナなどがあります。最後に、多くのWebおよびAndroid開発者のフローはすでにサポートされており、今後は他の開発者、複数のコンテナ、バックアップと復元に取り組みながら、シンプルさとセキュリティを適用していくと述べています。
文字起こしから生成されました。リンクされた箇所は元の動画と照合してください。
タイムスタンプ付きの章の要約
I/OでのChromebook向けLinux(Crostini)
登壇者の紹介と講演の枠組み
- [0:04] Chromebook向けCrostiniのデザイナーであるSudha Broslawskyが、Chrome OS仮想化リードのDylan Reid、Chromebook上のLinuxのプロダクトマネージャーであるTom Buckleyとともにセッションを開きます。
- [0:31] 新しいフレームワークやプラットフォームを推し進めるのではなく、この講演は、シンプルさとセキュリティのバランスを取ることで実現される、Chromebook上のLinuxを使って開発者が安心を得る方法に焦点を当てています。
開発とセキュリティに関する観客アンケート
- [1:07] 観客アンケートによると、会場は開発者でいっぱいで、彼らは税金の申告やメールなど開発以外の作業にもコンピューターを使い、多くがセキュリティを心配しています。
- [1:34] ディラン・リードは、観客がセキュリティを心配すべきだと述べ、多くの手が挙がったことを喜んでいます。
ディランの問題:信頼できないコードと二台のノートパソコン
- [1:40] 新しいプロジェクトを始めるとき、ディランは行き詰まって Google に頼りますが、時に答えは信頼できないサイトのスクリプトで、締め切りがあるためそのまま実行してしまいます。
- [2:17] そのようなスクリプトを繰り返し実行すると、どのコードを実行したか分からなくなり、すべてのスクリプトを読む時間もないため、彼は自分のシステムを以前より信頼できなくなります。
- [2:29] 彼の解決策は二台のノートパソコンを持ち歩くことでした。一台は開発用、もう一台はそれ以外のすべてのための安全なノートパソコンです。しかし彼は最近一台のノートパソコンに切り替え、その理由をトムが説明します。
Linux のサポート状況と始め方
- [2:46] Chrome OS は当初からシンプルで安全な体験を目指していましたが、以前は開発者が必要とするすべてのツールを実行できませんでした。それは昨年の I/O で Chromebook 上の Linux が発表されて変わりました。
- [3:11] Chromebook 上の Linux はお気に入りのエディター、IDE、ツールを実行でき、現在では 50% 以上の Chromebook でサポートされています。これには Lenovo Yoga Book C630 や Acer Chromebook Spin 13 など第八世代 Intel CPU を搭載したデバイスも含まれます。
- [3:36] 始めるのはほんの数クリックです。バックグラウンドで仮想マシンがダウンロードされ、コンテナがセットアップされ、すべてが構成される一方、開発者はランチャーにターミナルが追加されるだけです。
Debian 環境、アプリ、セキュリティの保証
- [3:54] ターミナルは、Git や Vim など開発者が期待するツールがプリロードされた標準の Debian 環境を提供し、さらに APT パッケージマネージャーや .deb ファイルによるプログラムのインストールをサポートし、数千の開発者ツールにアクセスできます。
- [4:24] インストールされたグラフィカルアプリは、他の Chrome OS アプリと同様にランチャーとウィンドウマネージャーに表示され、シンプルな Chrome OS の体験が保たれます。
- [4:45] このセットアップは安全でもあります。ユーザーはマルウェアがファイルにアクセスしたり、通信を覗き見したり、周辺機器に感染したりする心配をする必要がありません。ディランとスダは信頼を求めるだけでなく、アーキテクチャと設計原則を説明します。
講演の構成の概要
予定された議題と引き継ぎ
Chrome OS Linux 開発環境のセキュリティ
レンダラーの分離とVMレイヤーの必要性
- [5:34] Chrome OSは常に階層化されたセキュリティアプローチを採用しており、ブラウザとレンダラーは信頼できないコードをすべて分離されたレンダラーで実行し、コアシステムの攻撃対象領域を最小限に抑えています。
- [5:51] レンダラーのコードは多くのシステムコールを発行できず、カーネルの任意の部分に触れることもできません。これはウェブページやウェブアプリにはうまく機能しました。
- [6:00] 開発者ツールは、任意のLinuxアプリと同等の権限を持つ多くのプログラムをインストールする必要があり、Chrome OSの中核では受け入れられなかったため、仮想化レイヤーが追加されました。
- [6:15] 仮想化レイヤーはChrome OSのメインレイヤーに存在し、はるかに制限されたインターフェースを持つVMを起動しますが、VM内のプログラムには完全なLinuxカーネルを提供します。
署名済み読み取り専用ゲストVMとその柔軟性の限界
- [6:30] VMは、クロスVMプログラムがゲストに公開する小さなAPIを通じてのみChrome OS本体と通信できるため、攻撃対象領域が大幅に削減されます。
- [6:52] ゲストVMはGoogleによって署名され、ある程度信頼されるようになったため、その一部の動作を信頼できるようになりました。また読み取り専用であるため、ユーザーが壊せる範囲は限られ、常にVMを起動できます。
- [7:10] このようにセキュリティは解決されましたが、柔軟性は不十分でした。アプリはほとんど何もできず、環境は読み取り専用で、何もインストールできませんでした。
開発者の柔軟性のためのLXDコンテナレイヤー
- [7:22] CanonicalのLXDを使用した別のレイヤーが追加されました。これはシステムコンテナ向けに構築された標準的なコンテナランタイムであり、そのチームが起動を支援しました。
- [7:39] Debianのシステムコンテナが起動され、ユーザーに公開されました。
最後の防衛線としてのRustクロスVMレイヤー
- [7:47] クロスVMレイヤーはセキュリティの話の中で最も重要な部分であり、何かがChrome OSに入り込む前の最後の防衛線であると説明されているため、長期間にわたって注力されました。
- [8:06] クロスVMレイヤーはメモリ安全な言語であるRustで書かれており、バッファオーバーフロー、整数オーバーフロー、および攻撃者が悪用する多くの一般的なメモリ安全性のバグを排除しています。
仮想化インターフェースの柱ごとの分離
- [8:23] 仮想化プログラムは柱に分割され、ゲストとインターフェースする各柱はホストのChrome OSシステムのごく一部にしかアクセスできないため、銀行のページやオンライン確定申告などの個人データを保護します。
- [8:50] 乱数、ディスプレイ、USBデバイスなどゲストが必要とするリソースはそれぞれ独自のジェイルを持ち、必要なものだけを見ることができます。
- [9:01] 乱数生成器は乱数を生成できますがファイルにはアクセスできず、空のファイルシステムを見ており、ネットワークアクセスもありません。
- [9:12] ディスプレイドライバはディスプレイにアクセスできますが、ネットワークに触れたり、ファイルを取得してアップロードしたりすることはできません。たとえ誰かが内部に侵入して意図しない動作をさせようとしてもです。
- [9:26] 開発者が本来の業務に集中できるよう、基盤となるセキュリティアーキテクチャを気にせずに済むようにシステム UI が追加されました。
Chromebook 上の Linux:三つの設計目標
開発者の習慣に合った直感的な体験
- [9:56] 最初の設計目標は、体験を直感的に保つことでした。
- [10:09] チームはユーザーが確立したワークフローや習慣に合わせ、彼らにとって自然な体験を提供したいと考えました。
- [10:19] 世界中の開発者が Chromebook を使い、まるで自宅にいるように感じられることを目指しました。
完全な Linux VM デスクトップではなくネイティブ統合
- [10:26] 二つ目の目標は、体験をネイティブにすることでした。
- [10:30] VM 内で完全な Linux デスクトップを提供するのは簡単な道でしたが、十分とは見なされませんでした。
- [10:39] 目標は、開発者が依存する Linux アプリをネイティブな Chrome OS の体験に取り込むことでした。
シンプルさと、セキュリティと設計パターンのバランス
Crostini のファイル共有とセキュリティ
制限されたファイルアクセスの動機となる脅威
- [11:53] 開発者のファイルシステムにはコードだけでなく、個人の写真や確定申告書などの機密ファイルも含まれているため、多くの問題が起こり得ます。
- [12:08] ランサムウェアがデータを人質に取ったり、マルウェアがファイルを無作為なサーバーにアップロードしたり、あるいは何かがすべてを削除してしまったりする可能性があります。
- [12:21] Crostini はこうした脅威を念頭に置いて構築され、問題が起きた際の影響を限定します。
階層化された 9P 共有アーキテクチャ
- [12:31] 目標は、VM 内で実行されるコードは最終的に信頼されないため、ファイルを信頼できないコードに公開することなく、必要な開発ファイルを必要な場所で利用できるようにすることでした。
- [12:48] ファイルはChrome OSの下部にあり、9Sという名前の9Pサーバーを通じてVMと共有されます。このサーバーはRustで書かれ、ファジングされ、共有ファイルにのみアクセスできるよう厳格なジェイルに配置されています。
- [13:20] VMは組み込みのLinux 9Pサポートをマウントし、LXDがそのマウントを開発ツールが動作するコンテナに公開します。
- [13:29] コンテナ、VM、およびChrome OS上の9Sサーバーはそれぞれ、ユーザーが共有を選択したファイルのみを参照できるため、スタック全体が完全に悪用されても共有されていないファイルには到達しません。
UIを通じた簡素化された共有
- [14:17] Linux FilesディレクトリがLinuxのホームディレクトリとして機能し、その中のものはすべて自動的にLinuxと共有されます。
- [14:29] デバイス上の他の場所では、ユーザーが権限を付与するまでLinuxはアクセスできません。
- [14:51] Illustrationsなどのフォルダは、右クリックメニューの「Share with Linux」オプションを通じて共有でき、Google Drive内のフォルダも含まれます。共有は後で設定から解除できます。
- [15:23] ダウンロード内のデータファイルをダブルクリックするとVS Codeで自動的に開かれ、再起動まで暗黙的に共有され、セキュリティと簡素さのバランスを取ります。
CrostiniでWebサーバーを安全に実行する
Chrome OSでWebサーバーが重要な理由
- [15:54] Chrome OSは優れたWebアプリを作る人々を重視し、Chromebook上でそれを作成できるようにしたいと考えています。
- [16:01] Webサーバーを実行できることは、あらゆるWebアプリを構築する上でかなり中心的な要素です。
低レベルのWebサーバーアクセスのセキュリティリスク
- [16:08] Webサーバーはかなり低いレベルのアクセスを必要とし、それが問題を引き起こす可能性があります。
- [16:16] Webサーバーを実行できるコードは、インターネットトラフィックを覗き見し、どのサイトがアクセスされているかを知り、場合によってはページの内容まで見ることができます。
- [16:26] 悪意のあるWebサーバーは、ユーザーが行っているすべてを追跡する可能性があります。
- [16:30] Crostiniはこれを念頭に置いて設計され、この種の攻撃を防ぐために作られました。
内部のネットワーク分離レイヤー
- [16:45] CrostiniからWebサーバーを起動するのは簡単です。任意のLinuxディストリビューションと同様にコマンドを入力して起動するだけです。
- [16:59] 内部的には、ユーザーはコンテナ内にいて、VM内のネットワーク名前空間でポートを開きます。
- [17:10] そのVMは特別なハイパーバイザーの下で動作し、そのネットワークスタックはトラフィックがChromeに送信される前にホスト上の別の名前空間に存在します。
- [17:20] Chromeは逆に侵入できず、これはセキュリティにとって非常に良く、素晴らしい分離を提供します。
ChromeとVM間の通信を可能にするデーモン
Chrome OS Linuxコンテナのポートフォワーディング
ポート検出とVSOCKフォワーディングのデーモン
- [17:43] VM内のデーモンが、実行中のコンテナがポートを開くのを検出し、どのコンテナが開いたかを特定するまで待機します。
- [17:57] VMのデーモンはその情報をまとめてChrome OSに送信し、コンテナ内のポートがリッスン中でユーザーが利用したい可能性があることを伝えます。
- [18:08] Chrome OS上の二つ目のデーモンが応答し、ローカルVMとの通信に使われるプロトコルであるVSOCK経由でトラフィックを転送するルートを設定します。
- [18:22] どちらの端もデーモンに対してHTTPで通信し、デーモン同士はVSOCKで通信するため、WebサーバーとChromeの両方が通常のHTTPを使用します。
信頼されたドメインとPWA機能
- [18:45] この設定は信頼済みとされ、ユーザーはすべてのPWA機能を利用でき、アプリをデスクトップにインストールできます。
- [18:53] 技術的には同じマシンではありませんが、システムがVMを設定したため同じであると認識し、信頼されたドメインを許可します。
- [19:02] 講演者はこれを、内部に隠された複雑さと実際の使用時のシンプルさの対比を示す最高のデモの一つだと述べています。
権限プロンプトなしでポート8080上のPWAをテストする
ChromebookでAndroidアプリをテストする
Chrome OSでのAndroid Studioサポート
- [20:39] Android StudioはChromebookで正式にサポートされるようになり、Chrome OS専用のインストーラーが作成されて簡単に始められるようになりました。
- [20:49] 優れたAndroidアプリを構築するには、テスト用のデバイス、通常はスマートフォンも必要です。
USBデバイスのテストとCrostiniのセキュリティ
Chrome OS Linux(Crostini)におけるUSBサポート
USBスタックをホストから分離する
- [21:55] USBの実装は楽しかったものの、チームにとって最も苦労したスタックだったかもしれませんが、同じ階層化の原則が適用されました。
- [22:06] ホストのUSBスタックは多くの人によって緩く実装された厳密な仕様であり、攻撃対象領域が大きいため、ホストは保護されています。
- [22:24] USBドライバーはクロスVMジェイル内に存在し、十分に分離されているため、ユーザーのファイル、ネットワーク、または任意のUSBデバイスに到達できません。
エミュレートされたバスによる明示的なデバイス共有
- [22:44] ユーザーはUSBデバイスを開発環境に明示的に許可する必要があり、チームはそれをできるだけ簡単にしようと努めました。
- [22:52] エミュレートされたUSBバスは常に動作しているため、ユーザーがデバイスをVMに渡すことを示すまでゲストには空のバスが見え、その後バスに追加されます。
- [23:09] コンテナがデバイスを認識するには、ゲストがさらにそのデバイスをコンテナに転送する必要があります。
セキュリティとプライバシーの目標
- [23:16] セキュリティはジェイル、最小限の攻撃対象領域、Rustのメモリ安全性、およびファジングによって対処されました。
- [23:29] 接続されたUSBデバイスのリストはユーザーのフィンガープリントや追跡に使われるため、プライバシーが懸念され、信頼できないコンテナコードがその新たな手段になってはなりませんでした。
- [23:46] このフローには、デバイスの作成、VMへのエクスポート、コンテナへのエクスポート、エクスポートするデバイスの決定など多くのステップがあり、デモではそれがいかに簡単かを示しています。
デモ:Chromebook上のLinuxにスマートフォンを接続する
- [24:06] Linux対応のChromebookでスマートフォンを接続すると、Linuxに接続するよう促す通知が表示されます。この時点ではChrome OSだけがスマートフォンを認識しています。
- [24:28] ユーザーが通知から接続するまでスマートフォンはUSBリストに表示されず、接続後は表示されてLinuxからアクセスできるようになります。
- [24:49] Android Studioでユーザーが実行を押してスマートフォンを選択すると、そのスマートフォン上でアプリをテストおよびデバッグできます。
- [25:12] 設定では、ユーザーがいつでもLinuxに何へのアクセスを許可するかを管理でき、ユーザーは完全な制御を保てます。
ユーザー制御のためのネイティブUXパターン
Chrome OSの高度なVMおよびコンテナツール
標準ワークフローを超えた、サポートされない高度な改造
- [26:19] 洗練された一般的なワークフローの背後にある技術的詳細は引き続き使用可能で、ユーザーが実験できるようにフックが残されています。
- [26:33] 標準フローは誰にとっても十分であることを意図しているため、これらの高度な機能はテストもサポートもされていません。
- [26:41] 時にはより高度なことを行う理由があるかもしれませんし、ユーザーが単に改造者として内部をいじりたいだけかもしれません。
Chrome OSシェルとVMCコマンドへのアクセス
- [26:58] すべての例はChrome OSシェルから実行されます。このシェルは、講演者が関わる前からChrome OSに存在していました。
- [27:04] Control-Alt-Tで、一連のデバッグコマンドを備えたシェルが開きます。
- [27:09] 焦点は、仮想マシンとコンテナを制御するために追加されたVMCコマンドです。
VMの一覧表示とTerminaおよびPenguinへの入り方
- [27:18] VMC listはシステムにインストールされたVMを表示し、デフォルトのVMはTerminaと呼ばれます。
- [27:34] Terminaは以前のスライドのデモすべてで使用されたVMで、稼働中です。
- [27:41] ショートカットでVM内のコンテナに入ります。デフォルトのコンテナはPenguinという名前で、デモが実行された場所です。
- [27:51] VMC containerコマンドはデフォルトのコンテナに入り、VMC Startはコンテナに入らずに仮想マシンを起動します。
VM内でのLXCコマンドとスナップショットの使用
- [28:21] Chrome OSはLXDを使用しているため、多くのLXCコマンドはデフォルトのUbuntuインストールとほぼ同様にChrome OS内で動作します。
- [28:37] LXC listは、IPアドレスを持つ単一のPenguinコンテナが実行中であることを示します。
- [28:53] LXC Snapshotコマンドはコンテナ名とスナップショット名を受け取り、問題が発生したときに戻るためのイメージを保存します。
- [29:20] スナップショットはVM内でbtrfsによるコピーオンライトを使用するため、大量のディスク容量を消費しません。
- [29:27] コンテナ情報では、作成されたばかりのスナップショットが下部に表示され、複数のスナップショットをそれぞれ日付付きで保持できます。
LXC Copyで複数のコンテナを作成する
- [29:49] LXC Restoreはコンテナを保存済みのスナップショットに戻します。
- [30:01] 複数のコンテナを使えば、例えば一方にPython 2.7、もう一方にPython 3を入れたり、GoとRustの環境を分けたりと、個別のセットアップが可能です。
- [30:23] コンテナはディスク容量を消費するため、その範囲内でユーザーは好きなだけコンテナを作成できます。
- [30:30] 新しいコンテナを始める基本の方法はLXC Copyで、例えばPenguinをKingfisherという新しいコンテナにコピーします。
- [30:44] 新しいコンテナはデフォルトで停止状態なので、実行中として一覧に表示し、内部でBashを実行するには先に起動する必要があります。
Chromebook上のLinux:コンテナとディストリビューション
新しいコンテナへのツールのインストール
- [30:58] 新しいコンテナ内のシェルを使えば、デフォルトのコンテナには入れたくないツールチェーンを自由にインストールできます。
Debianのデフォルトと代替ディストリビューション
- [31:07] Debianは最も簡単な選択肢だったため選ばれましたが、ユーザーはDebianに縛られません。
- [31:17] Debianのワークフローと、Debianにデフォルトでインストールされる一部のゲストパッケージがサポートされています。
- [31:29] Canonicalが運営するイメージサーバーから、多くのディストリビューションを利用できます。
ArchコンテナとPacMan
- [31:36] ArchTestというArchコンテナが、DebianコンテナのPenguinとKingfisherと並んでインストールされます。
- [31:53] ArchコンテナにはBashを実行するよう指示して入り、パッケージはActではなくPacManでインストールします。
さらなるドキュメントとGUI統合
- [32:11] オンラインのLXDドキュメントには、他のディストリビューションのインストールや、コマンドライン以上にGUIとより良く統合する方法など、さらに多くのアイデアが掲載されています。
Crostiniサブレディットの推薦
- [32:29] Tom BuckleyはCrostiniサブレディットを推薦しています。そこでは機能がリリースされるとすぐに、時にはそれより早く見つけられ、Chromebook上のLinuxを始めたばかりのユーザーも歓迎されます。
開発者サポートと将来の機能に関するまとめ
開発者向けフローの拡大と新機能
- [33:04] 登壇者は、多くのウェブおよびAndroid開発者向けフローがすでにサポートされており、今後さらに増える予定であると述べています。
- [33:07] 今後の取り組みには、他の開発者のサポートや、複数コンテナ、バックアップと復元などの機能の拡大が含まれます。
原則と参加への招待
冒頭 3 段落の二言語対訳プレビュー · 利用枠の消費なし
保存済みの日本語訳と英語原文の冒頭 3 段落を並べて確認できます(利用枠は消費しません):
[音楽再生] スダ・ブロスロースキー: 皆さん、こんにちは。I/Oを楽しんでいただけているとよいのですが。ここでは、Crostiniとしても知られるChromebook向けLinuxについてお話しします。まずは自己紹介から始めます。私はスダです。Chromebook向けCrostiniのデザイナーです。ディラン・リード: こんにちは、ディランです。Chrome OSの仮想化リードを務めています。トム・バックリー: そしてトムです。Chromebook向けLinuxのプロダクトマネージャーです。
[MUSIC PLAYING] SUDHA BROSLAWSKY: Good afternoon, everyone. I hope you are having a great time at the I/O. We are here to talk to you about Linux for Chromebooks, also known as Crostini. We'll start by introducing ourselves. My name is Sudha. I'm a designer on Crostini for Chromebooks. DYLAN REID: Hi, I'm Dylan. I'm the Chrome OS Virtualization Lead. TOM BUCKLEY: And I'm Tom, Product Manager for Linux on Chromebooks.
さて、I/Oの二日目も終わりに近づき、皆さんはすでに、使うべき新しいフレームワークや構築すべきプラットフォームについて語るさまざまなセッションに参加されたことでしょう。その通りで、ぜひそうすべきなのですが、ここでお話ししたいのはそういうことではありません。代わりにお話ししたいのは、開発者である皆さん自身と、Chromebook上のLinuxを使うことでいかに心の平穏を得られるかということです。私たちはシンプルさとセキュリティのバランスを取ることで、その心の平穏をお届けします。
Now it's the end of day two at I/O and you've probably already been to a bunch of different sessions that have talked about all the new frameworks that you need to be using or the platforms that you need to be building for, and everyone's right, you absolutely should be, but we're not really here to talk about that. Instead what we want to talk about is you as developers and how you can get more peace of mind by using Linux on Chromebooks. We give you that peace of mind by balancing simplicity and security.
スダ・ブロスロースキー: それでは、簡単なユーザー調査をしましょう。会場の皆さんのうち、開発者の方は何人いますか? わあ、予想通り満員ですね。手を挙げたままでいてください。開発以外に、確定申告やメールの確認などでコンピュータを使う方は? また100%ですね。では最後の質問です。セキュリティについて心配している方は? ディラン・リード: いいですね、かなり--いや、皆さん心配すべきですから、とにかく多くの手が挙がってよかったです。
SUDHA BROSLAWSKY: On that note, let's do a quick user study. How many of you are developers in the audience? Wow, that's a full room, as expected. Keep your hands raised. How many of you use your computers for anything else other than development, like doing your taxes, checking email-- again, 100% of you. OK, one last question. How many of you are worried about security? DYLAN REID: Good, that's pretty-- I mean, you all should be, so I'm glad to see many hands up anyway.
[0:00] [音楽再生] スダ・ブロスロースキー: 皆さん、こんにちは。I/Oを楽しんでいただけているとよいのですが。ここでは、Crostiniとしても知られるChromebook向けLinuxについてお話しします。まずは自己紹介から始めます。私はスダです。Chromebook向けCrostiniのデザイナーです。ディラン・リード: こんにちは、ディランです。Chrome OSの仮想化リードを務めています。トム・バックリー: そしてトムです。Chromebook向けLinuxのプロダクトマネージャーです。
[0:31] さて、I/Oの二日目も終わりに近づき、皆さんはすでに、使うべき新しいフレームワークや構築すべきプラットフォームについて語るさまざまなセッションに参加されたことでしょう。その通りで、ぜひそうすべきなのですが、ここでお話ししたいのはそういうことではありません。代わりにお話ししたいのは、開発者である皆さん自身と、Chromebook上のLinuxを使うことでいかに心の平穏を得られるかということです。私たちはシンプルさとセキュリティのバランスを取ることで、その心の平穏をお届けします。
[1:03] スダ・ブロスロースキー: それでは、簡単なユーザー調査をしましょう。会場の皆さんのうち、開発者の方は何人いますか? わあ、予想通り満員ですね。手を挙げたままでいてください。開発以外に、確定申告やメールの確認などでコンピュータを使う方は? また100%ですね。では最後の質問です。セキュリティについて心配している方は? ディラン・リード: いいですね、かなり--いや、皆さん心配すべきですから、とにかく多くの手が挙がってよかったです。
[1:40] 皆さんはどうかわかりませんが、新しいプロジェクトを始めると、私はよく行き詰まります。多くの壁や障壁にぶつかり、問題を探し、解決策を探して、Googleに頼ります。幸いなことに、Googleはほとんどいつも素晴らしい答えをくれます。残念ながら、時には答えがこんな風に見えることもあります。evilsite.comからこのスクリプトを実行してSudoにパイプすべきではないとわかっていても、締め切りが迫っています。そしてこのサイトはまあまあまともそうに見えるので、今回は例外としてこれを実行してしまいます。
[2:17] そしてそれが何度も何度も起こり、最終的には、本来あるべきほどには信頼できないシステムが出来上がってしまいます。なぜなら、もうその上でどんなコードを実行したのか、よく分からなくなっているからです。こうしたスクリプトを全部読む時間なんてありません。これに対する私の解決策は、ノートパソコンを二台持ち歩くことでした――一つは開発者としての世界用、もう一つは安全でありたいそれ以外すべての世界用です。でも最近は、一台のノートパソコンを使うように切り替えました。その方法についてはトムが話します。トム・バックリー: 私たちが Chrome OS で目指してきたのは、最初からシンプルで安全な体験を提供することです。ただ、以前に試したことがある方は、開発者にとってはまだ十分に準備が整っていなかったと感じたかもしれません。
[2:57] シンプルで安全であるために、開発者が仕事を成し遂げるのに必要なすべてのツールを実行することはできませんでした。しかし昨年の I/O で、Chromebook 上で Linux のサポートを開始すると発表したことで、状況は一変しました。Chromebook 上の Linux では、お気に入りのエディタ、IDE、ツールをすべて実行でき、現在では 50% 台以上の Chromebook でサポートされています。これには、Lenovo Yoga Book C630 や Acer Chromebook Spin 13 のような、第八世代 Intel CPU を搭載した優れたデバイスも含まれます。
[3:31] まだご覧になっていない方のために、いくつか例を紹介します。まず、どうやって入手するのか。とても簡単です。ほんの数回クリックするだけです。今、バックグラウンドでは仮想マシンをダウンロードし、コンテナをセットアップし、すべてを設定しています――この辺りの詳細はディランが数分後にもう少し詳しく話しますが、開発者であるあなたにとっては、始めるのにほんの数回クリックするだけです。これにより、ランチャーにターミナルが追加されます。そのターミナルを開くと、ごく標準的な Debian 環境が表示され、Git や Vim など、開発者が期待するツールがすでにいくつも読み込まれています。他に必要なものがあれば、APT パッケージマネージャーを使って、必要なパッケージを何でもインストールできます。
[4:11] また、代わりに .dev ファイル経由でプログラムをインストールしたい場合は、それも可能です。これにより、何千もの世界クラスの開発者ツールを利用できます。グラフィカルなアプリをインストールすると、それらはすべて Chrome OS の他のアプリと同じようにランチャーに表示され、開くとウィンドウマネージャーにも――これもまた Chrome OS の他のアプリと同じように――表示されます。これこそが、人々が Chrome OS に期待するようになったシンプルな体験であり、私たちは Linux によってそれを変えたくはありませんでした。
[4:45] しかし重要なのは、これが安全でもあるということです。マルウェアがあなたのファイルにアクセスしたり、通信を覗き見したり、周辺機器に感染したりする心配はありません。私たちを信頼してほしいところですが、これは信頼だけに任せるにはあまりにも重要なので、この講演の中で、DylanとSudhaがCrostiniのアーキテクチャと設計の背後にある原則を順を追って説明します。その後、いくつかの一般的な開発者のワークフローを分解して、これらの原則がどのように適用されるかを示します。
[5:16] そして最後に、上級ユーザーの方々に向けて、高度な使い方のヒントやコツをいくつか共有します。それでは、アーキテクチャについて話すためにDylanにバトンを渡します。[拍手] DYLAN REID: お見事。では。Chrome OSは常にセキュリティに対して階層的なアプローチを取ってきました。そして私たちの大きな層は常に、ブラウザとレンダラーであり、すべての信頼できないコードを、適切に分離されたレンダラーで実行することでした。そしてそれが、コアシステムの攻撃対象領域を最小限に抑えています。
[5:51] それらは多くのシステムコールを発行することが許されていません。カーネルのランダムな部分をつつくことはできません。そしてこれはウェブページやウェブアプリには非常によく機能しました。しかし、開発者ツールとなると、私は多くの異なるプログラムをインストールする必要があります。それらは多くの異なる権限を必要とします。Linux上のあらゆるアプリができることは何でもできます。そしてそれはChrome OSのコアにおいて私たちにとって受け入れられるものではなかったので、層を追加する必要がありました。そこで私たちは仮想化層を追加し、それがChrome OSのメイン層に存在し、VMを起動します。
[6:23] そして今、このVMははるかに制限されたインターフェースを持ちながら、VM内で実行されるプログラムには完全なLinuxカーネルを公開しています。VMがChrome OS本体と通信できる唯一の方法は、左上のクロスVMプログラムがゲストに公開する小さなAPIを通じてのみです。これはかなり良いです。これで攻撃対象領域を大幅に削減しました。私たちはこれにかなり満足していました。もう少し先に進みたかったのです。そこで私たちは、ゲストVMもGoogleによって署名されていることを確認し、ある程度信頼できるようにしました。
[6:58] これにより、ゲストVMが行う一部のアクションを信頼できるようになり、また読み取り専用であるため、ユーザーはある程度までしか壊せません。そして、何をしても、VMを起動できるようになります。しかし、セキュリティがすべて解決したところで、私たちは再び柔軟性が十分でない状況に戻ってしまいました。あなたのアプリは何もできません。読み取り専用です。何もインストールできません。そこで私たちは別の層を追加し、そのためにCanonicalからLXDを盗みました――使いました。
[7:32] そのチームは、これを私たちと一緒に立ち上げるのに非常に協力してくれました。これはかなり標準的なコンテナランタイムです。システムコンテナを実行するために作られています。そして私たちの場合、Debianのシステムコンテナを起動して、それをユーザーに公開しました。つまり、私が話していたあのVM間の層が、ここでのセキュリティの話の中で最も重要な部分なのです。それは、何かがChrome OSに入り込む前の最後の防衛線です。そこで私たちは長い間これに焦点を当て、できる限り安全にすることに努めました。
[8:06] 私たちはそれをメモリ安全なプログラミング言語で書きました。Rustを選びました。これにより、バッファオーバーフローや整数オーバーフロー、攻撃者に悪用されるメモリ安全性に関連する多くの一般的なバグが排除されます。私たちはそれにかなり満足していましたが、ここでさらに別のセキュリティ層を追加し、仮想化プログラムを柱に分割して、ゲストとインターフェースする各柱がホストのChrome OSシステムのごく一部にしかアクセスできないようにしました。
[8:38] ホストのChrome OSシステムでは、銀行のウェブページを開いていたり、オンラインの確定申告の画面を開いていたり、あらゆる種類の個人識別情報があちこちにあります。私たちはそれを本当に守りたかったのです。しかし、乱数やディスプレイ、USBデバイスなど、ゲストに何かを提供する必要がありました。そこで、それぞれに専用の監房を与え、必要なものだけを見られるようにしました。つまり、乱数生成器は乱数を生成できますが、ファイルにはアクセスできません。その視点から見ると、空のファイルシステムの中にあります。
[9:09] ネットワークアクセスもありません。ディスプレイドライバはディスプレイにアクセスできますが、同様にネットワークには触れられません。たとえ誰かがそこに侵入して、私たちが意図しなかったことをさせようとしても、あなたのファイルを取得してアップロードすることはできません。これはすべて少し複雑ですが、皆さんが簡単に使えるように大量のシステムUIを追加しました。ですから、開発者として仕事をしているときには、私が描いたこのきれいな図について心配する必要はありません。そしてSudhaが私たちが何をしたかを紹介します。
[9:40] SUDHA BROSLAWSKY: ありがとう、Dylan。セキュリティは私たちにとって最優先事項です。ChromebookでのLinux体験を作り上げるにあたり、私たちは三つの高レベルの設計目標を掲げました。最初の目標は、体験を直感的に保つことでした。この部屋にいる皆さんは長い間コンピュータを使ってきて、ワークフローや習慣を確立しています。ですから基本的に私たちがやりたかったのは、そうした期待に合わせることでした。
[10:14] 私たちは、皆さんにとって自然な体験を提供したいと考えました。世界中の開発者にChromebookを使ってもらい、まるで自宅にいるかのように感じてほしいのです。二つ目の目標は、体験をネイティブなものにすることでした。仮想マシン上で完全なLinuxデスクトップを提供するという簡単な道もありましたが、それでは十分ではありませんでした。私たちの目標は、開発に欠かせないLinuxアプリを、ネイティブなChrome OSの体験に取り込むことでした。
[10:47] 三つ目の目標は、体験をシンプルにすることでした。これは非常に重要だと思います。内部では多くの複雑さが動いていますが、それは内部に留めておきたいのです。私たちの指針は、複雑さがユーザー体験を妨げるべきではないというものです。ここでバランスを取ろうとしていることがいくつかあります。ChromebookにLinuxアプリをインストールすることに伴うセキュリティ上の懸念と、Chrome OSが確立したデザインパターンに従うことで得られるシンプルさです。
[11:26] そして私たちの使命は、その最適なバランス点を見つけることでした。TOM BUCKLEY: わかりました。では次に、開発者によくある三つのワークフローを取り上げ、Crostiniでどのように機能するかを見ていきましょう。まず一つ目はファイルへのアクセスです。開発者として、私たちは常にこれを行う必要があります。エディタはファイルにアクセスする必要があり、コンパイラやソース管理なども同様です。しかし問題は、私たちのファイルシステムにはコードだけではないものがたくさんあるということです。
[11:58] 個人の写真、確定申告の書類、あるいは書きかけの小説などもあります。多くのことがうまくいかなくなる可能性があります。ランサムウェアはそうしたデータすべてを人質に取ることができます。マルウェアはあなたのファイルをどこかのランダムなサーバーにアップロードすることができます。あるいは、面白半分にすべてを削除してしまうものもあるかもしれません。私たちはそうした脅威を念頭に置いてCrostiniを構築し、問題が起きる範囲を限定しました。その方法はDylanが説明します。DYLAN REID: 仮想マシンやコンテナとファイルを共有する際の私たちの目標は、開発作業に必要なファイルを必要な場所で簡単に取得できるようにしつつ、信頼できないコードにさらしたくないものは公開しないことでした。
[12:44] なぜなら最終的に、私たちはこの仮想マシン内で実行されるコードを信頼していないからです。これを実現するために、私たちは階層的なアプローチを取りました。あなたのファイルはすべてChrome OSの最下層に存在し、それを9Pサーバーで仮想マシンに共有します。私たちはそれを9Sと名付けました。繰り返しますが、メモリ安全になるようRustで書き、予期しない入力が予期しない動作を引き起こさないようファジングを行い、共有したファイルにしかアクセスできないよう厳重な監獄に閉じ込めました。
[13:16] そしてそのファイルを取得してVMにエクスポートします。VMはLinuxに組み込まれている9Pの機能をマウントし、LXDがそのマウントをコンテナ内に公開して、開発ツールが動作する環境で利用できるようにします。ここで重要なのは、コンテナは「開発環境と共有したい」と指定したファイルだけを見ることができるという点です。VMも同じファイルだけを見ることができます。さらに、Chrome OS上で動作する私たちが書いたサーバーでさえ、それらのファイルだけを見ることができます。すべてを見ることはできません。ですから、たとえ誰かがこのスタックを悪用してChrome OSまで遡ったとしても、共有していないファイルにはアクセスできません。
[13:49] コンテナと共有していないファイルには依然としてアクセスできません。設定する項目はたくさんあります。9Pのマウント設定、コンテナへのバインドマウントなどです。開発中はしばらくこれを手動で行っていました。大変でした。そこで、私たちがどれだけ簡単にしたかをSudhaに紹介してもらいましょう。SUDHA BROSLAWSKY: 多くのレイヤーが関わっていますが、UIではどれほど簡単か見てみましょう。最初から「Linux Files」というディレクトリがあり、これがLinux内のホームディレクトリになります。
[14:24] このディレクトリ内のものは自動的にLinuxと共有されます。このディレクトリの外、デバイス上の他の場所については、権限を付与するまでLinuxは何にもアクセスできません。ここでいくつか例を紹介します。あるプロジェクトに取り組んでいて、「Illustrations」というフォルダのファイルが必要になったとしましょう。これを共有するには、右クリックメニューを開いて「Share with Linux」をクリックするだけです。
[14:58] たった二つのステップで、このフォルダをLinuxと共有できました。お気づきかもしれませんが、これはGoogle Drive内にあり、それは素晴らしいことです。共有をやめたいときは、設定から共有を解除できます。もう一つの例として、簡単に素早く編集できるようにした機能を紹介します。ダウンロードフォルダにデータファイルがあり、ダブルクリックすると自動的にVS Codeで開きます。
[15:31] このとき、バックグラウンドで暗黙的に共有されています。共有は再起動するまで続きます。これが私たちが提供したかったセキュリティとシンプルさのバランスです。TOM BUCKLEY: ありがとう。では、次に話す二つ目の開発者向けフローでは、Webサーバーの実行について見ていきます。Chrome OSである以上、優れたWebアプリを作る人々を大切にしており、Chromebook上でそれらを作成できるようにしたいと考えています。そして、Webサーバーを実行できることは、あらゆるWebアプリを構築する上で非常に重要です。
[16:08] 残念ながら、ウェブサーバーはかなり低レベルなアクセスも必要とするため、問題が生じることがあります。ウェブサーバーを実行できるコードは、あなたのインターネットトラフィックを覗き見ることもできます。どのサイトにアクセスしているかを知ることができ、場合によってはページの内容まで見ることができます。つまり、悪意のあるウェブサーバーは、あなたの行動すべてを追跡する可能性があるのです。これもまた、Crostiniの設計時に考慮し、この種の攻撃を防ぐようにしました。
[16:39] その方法はDylanが説明します。DYLAN REID: Linuxと呼ばれても構いません。それが私の役目です。では、Crostiniからウェブサーバーを起動するのは簡単です。ウェブ開発サンドボックスに良いデモがすでにあります。コマンドを入力してください。他のLinuxディストリビューションと同じようにウェブサーバーを起動できます。しかし、内部で実際に起きているのは、コンテナ内でポートを開くことです。そのポートはVM内のネットワーク名前空間にあり、特別なハイパーバイザー上で動作し、そのネットワークスタックをホスト上の別の名前空間に置き、最終的にChromeへと出力されます。
[17:20] これによりChromeは戻ってこれなくなり、セキュリティ上非常に良いです。素晴らしい分離が実現します。しかし、VMで実行している新しいPWAやウェブページをテストしたい場合、Chromeと通信させるにはどうすればよいでしょうか?これは簡単ではありませんでした。そのため、途中でいくつかのデーモンを追加する必要がありました。実際、各レイヤーごとにデーモンが追加されます。最初のデーモンはVM内で動作し、実行中のコンテナがポートを開いたかどうかをチェックするために待機しています。
[17:53] そして、どのコンテナがそのポートを開いたかを特定します。その情報をまとめてChrome OSに送信します。このコンテナのこのポートがリッスンしている、ユーザーがそのポートを使いたいかもしれない、と伝えます。Chrome OS側では、了解と応答します。もう一つのデーモンが応答します。転送用のルートを設定します。すべてをVSOCK経由で転送します。VSOCKはマシン上のローカルVMと通信するためのプロトコルです。これは内部に隠されています。両端ではHTTPでデーモンと通信し、デーモン同士はVSOCKで通信します。
[18:28] ここでのポイントは、ウェブサーバーはHTTPで通信し、ChromeもHTTPで通信することです。すべてが正常で、通常通りに動作します。内部では追加のデーモンやVSOCK転送が動いていますが、それは隠されています。もう一つ重要なのは、信頼済みにしたことです。これによりすべてのPWA機能を利用できます。デスクトップにインストールすることもできます。技術的には同じマシンではありませんが、情報を持っているので同じであるとわかります。VMを設定しています。
[18:58] そこで、信頼できるドメインとして許可しています。そして、この複雑さすべてが、私たちが内部でどれほど複雑にしているか、そして実際の使用時にどれほどシンプルに見えるかを示す、今日の最高のデモの一つになっていると思います。SUDHA BROSLAWSKY: まったく同感です。内部では非常に複雑ですが、UIではまさに期待通りのものになっています。例えば、このクールなPWAを構築して実験しているとしましょう。ここターミナルで、あなたはフォルダの中、PWA Starter Kitにいます。
[19:31] Webサーバーを起動するコマンドを実行しています。画面の下部を見ると、ポート8080でリッスンしているのがわかります。この時点で、ブラウザを起動し、ローカルホスト8080にアクセスして、Webアプリをテストできます。ここ画面の左側にはChromeでWebアプリがあり、右側にもしお気づきなら、これもChromeです。そうです、Chromebook上のFirefoxでもWebアプリをテストできます。
[20:07] お気づきかもしれませんが、このフローの中では権限を求めるプロンプトは表示されませんでした。これは、ホストがVMにアクセスしているのであって、その逆ではないからです。繰り返しますが、これも私たちが話していたセキュリティとシンプルさのバランスを取るもう一つの方法です。TOM BUCKLEY: では。最後に、三つ目のデモとして、Androidアプリのテストについてお話しします。これは本当にわくわくします。つい昨日、Android StudioがChromebookで正式にサポートされることを発表し、Chrome OS専用のインストーラーまで作成して、始めやすくしました。
[20:49] もちろん、優れたAndroidアプリを構築するのに必要なのはAndroid Studioだけではありません。アプリをテストするもの、通常は電話も必要です。Wi-Fi経由でADBリモートなどを使うこともできますが、私たちはそれを簡単にしたかったのです。他のデバイスで期待されるのと同じ体験を。USBで電話を接続して、その方法でアプリをテストできます。さて、私がAndroid開発者なら、もちろんアプリをテストするために電話を接続しますが、一日のうちにUSBで他にも多くのデバイスを接続することになります。
[21:21] 家族の写真がたくさん入ったUSBドライブを接続することもあるでしょう。健康情報が入ったウェアラブルを接続することもあるでしょう。仕事用のセキュリティキーを接続して、すべてのアクセス権を得ることもあるでしょう。マルウェアはこれらのデバイスを利用して、マシン間を移動するあなたを一意に識別したり、自身を拡散したり、さらにはそれらに変更を加えたりすることができます。繰り返しますが、私たちはCrostiniを設計する際にこれらの脅威を考慮し、それらを防ぐようにしました。DYLAN REID: ええ、USBの実装は私たちにとってとても楽しかったです。
[21:57] 最も苦労したスタックだったかもしれません。同じ原則が当てはまります。レイヤーがあり、ホストを保護します。ホストのUSBスタックには多くの攻撃対象領域があります。非常に複雑で、緩く仕様が定められた種類のプロトコルです。正確な仕様ではありますが、多くの人によって緩く実装されています。そこで私たちはそれを隠しました。ホスト側に留めました。クロスVMジェイル内に常駐するデバイスを作成しました。
[22:27] 繰り返しますが、USBドライバーがあります。かなり複雑で、多くのコードが含まれており、バグが一つや二つあることは間違いありません。そこで、非常にしっかりと分離されていることを確認しました。あなたのファイルにアクセスできません。ネットワークにもアクセスできません。どのUSBデバイスにもアクセスできません。このUSBデバイスを開発環境に渡したいと明示的に指定する必要があります。そして、それをできるだけ簡単にしようと努めました。実際に内部で起きていることとして、常にエミュレートされたUSBバスが動作しているため、ゲストは常に「USBバスはあるが、何も接続されていない」と認識します。
[23:02] そして、これをVMに渡したいと示すと、「わかりました。このデバイスをこのバスに追加し、ゲストに見せます」と言います。そしてゲストはさらにそれをコンテナに転送し、コンテナがそれを認識できるようにする必要があります。ここで私たちが特に注力した点は二つあります。一つはセキュリティです。繰り返しますが、ジェイルでそれに対処し、攻撃対象領域を可能な限り最小限に抑えました。またRustで書かれており、メモリ安全で、ファジングも行われています。しかしもう一つの問題はプライバシーです。なぜなら、人々は何らかの形でマシンに接続されたUSBデバイスのリストをユーザーのフィンガープリントや追跡に利用しており、コンテナ内で実行される信頼できないコードがその別の手段にならないようにしたかったのです。
[23:46] 繰り返しますが、これは多くのステップです。デバイスを作成し、VMにエクスポートし、コンテナにエクスポートし、どのデバイスをエクスポートするかを決める必要があります。そして、それがいかに簡単かを示すデモも用意しています。SUDHA BROSLAWSKY: はい。これが最後のデモです。私がLinux対応のChromebookを使っていて、あなたが携帯電話を接続するとします。Linuxへの接続を促す通知が表示されます。
[24:17] この時点では、Chrome OSだけがあなたの携帯電話を認識しています。Linuxはあなたの携帯電話が存在することすら知らず、それは良いことです。ここを見ると、あなたの携帯電話はUSBリストに表示されていませんが、通知で接続した後にコマンドを再実行すると、携帯電話がリストに表示されます。この時点で、Linuxから携帯電話へのアクセスが確立されました。
[24:49] プロジェクトに取り組んでいるとしましょう。またAndroid Studioでクールなアプリを開発していて、テストの準備ができました。実行を押して端末を選ぶと、あっという間です。それだけで、端末上でアプリをテストできます。この時点で、アプリのデバッグとテストが可能です。最後に、設定に移動して、いつでもLinuxが何にアクセスできるかを管理できます。こうして、Chromebook上のLinux体験の中心にセキュリティがあることがお分かりいただけるでしょう。
[25:27] ユーザーであるあなたが、Linuxが何にアクセスできるかを常に完全に制御できます。私たちはさまざまなUXパターンを活用して、使いやすく、かつChrome OSにネイティブなものにしています。Chrome OSの原則とCrostiniの組み合わせが、この体験を非常にユニークなものにしています。DYLAN REID: ありがとう。次は私の番です。
[25:57] よし、いいですね。十分に時間があります。これまで多くの詳細について話してきましたし、私はレイヤーやジェイルについて多くを語ってきました。それは重要であり、通常のフローを信頼していただく良い理由でもあります。私がChromebookを使うときは、ほぼ常に、磨き上げて動作を保証してきたこれらの一般的なワークフローの中にとどまっています。しかし、私が話していた技術的な詳細の多くは依然として利用可能で、皆さんが試せるようにフックを残してあります。
[26:27] 時間が残っていて良かったです。いくつかの例を紹介して、他に何ができるかの興味を少し刺激できればと思います。私たちはこうしたものをテストしていませんし、サポートもしていません。標準のフローが皆さんにとって十分であることを本当に望んでいます。しかし時には、もう少し高度なことをしたい理由があったり、単に楽しみのために内部をいじりたいこともあるでしょう。私たちは工作好きですよね?そうあるべきです。では、いくつかがどのように動作するかを見ていきましょう。
[26:58] これはすべてChrome OSのシェルから行います。これはChrome OSに--そうですね、私よりも前から入っています。Control-Alt-Tでシェルが開きます。実行できるデバッグコマンドのセットがあります。ここでは一つのコマンド、仮想マシンとコンテナを制御するために追加したVMCコマンドに焦点を当てます。基本的なコマンドとして、VMC listを実行できます。システムにインストールされているVMが表示されます。デフォルトのVMはTerminaと呼ばれます。
[27:29] フォントが十分に大きく、サイズが分かることを願っています。Termina VMは、先ほどのスライドのすべてのデモが行われたもので、起動して実行中です。VM内のコンテナに入るためのショートカットを作りました。デフォルトのコンテナに入りたい場合は、コンテナの名前はPenguinです。繰り返しますが、ここがすべてのデモを行っていた場所です。VMC containerコマンドでそこに入れます。そこから抜けて、VMだけに戻りましょう。
[27:59] つまり、VMC Start はコンテナに入らずに仮想マシンに入ります。なので、私のレイヤーの話に戻ると、真ん中にあるもの、つまり LXD が動作する場所です。ここに入りたい理由は、コンテナを操作したり変更したりしたい場合です。先ほど LXD を使っていると述べました。LXC コマンドがたくさん出てきます。それが LXD の制御プログラムです。これはオンラインでよく文書化されており、そのほとんどが Chrome OS 内でも、通常の Ubuntu インストールと同じように動作します。
[28:37] 最初にできるのはリストです。Penguin が動作しているのがわかります。コンテナが一つあります。起動して動作しています。IP アドレスがあります。コンテナが一つあります。少し触ってみたいかもしれません。その前に、正常な状態に戻れることを確認したいかもしれません。以前に壊したことがあるので。心配せずに元の状態に戻って遊べるのはいいことです。標準的な LXE コマンドです。
[29:08] スナップショットと呼ばれます。コンテナ名とスナップショット名を指定すると、壊したときに戻れるイメージが保存されます。コピーオンライトもあります。VM で btrfs を使っているので、大量のディスク容量を消費しません。コンテナの情報を取得できます。これで多くの情報が得られます。繰り返しますが、Chromebook でこれをいじってみることもできます。ここで重要なのは、一番下に先ほど作成した IO1 スナップショットが一つあることです。
[29:41] 複数のスナップショットを持つことができます。あまり創造的な名前を使わなかった場合に備えて、日付が付いています。そして復元したいときは LXE Restore です。よく名前が付けられたコマンドです。私より上手にやっています。本当にいろいろ試したいなら、複数のコンテナが欲しくなることがあります。Penguin コンテナがあり、これに別のライブラリをインストールしようと思います。Python 2.7 のコンテナと、Python 3 の別のコンテナが欲しいかもしれません。
[30:15] あるいは、Rust を書くためのコンテナとは別に、Go を書くためのコンテナが欲しいかもしれません。それを可能にしています。ディスク容量の制限内で、好きなだけコンテナを作成できます。これらはディスク容量を消費します。新しいコンテナを始める最も基本的な方法は、既存のコンテナをコピーすることです。LXE Copy コマンドがあります。ここの例では、デフォルトの Penguin コンテナを Kingfisher という新しいコンテナにコピーします。コンテナを一覧表示できます。
[30:46] 二つあります。デフォルトではコンテナは停止しているので、起動する必要があります。これで一覧を表示できます——ほら、実行中です。そして中に入れます。KingfisherでBashを実行したいとします。すると新しいコンテナ内にシェルができ、デフォルトのコンテナに入れたくなかったランダムなツールチェーンをインストールできます。さらに一歩進めて、私たちはDebianを選びました。それが一番簡単だったからです。しかし、それに縛り付けるつもりはありません。
[31:17] 私たちはDebianのワークフローをサポートしています。Debianにデフォルトでインストールされる一部のゲストパッケージもサポートしています。しかし、お気に入りのディストロを使いたい人もいます。Canonicalが運営するイメージサーバーからは、膨大な数のディストロが利用可能です。ここではArchのものをインストールします。私はArch派ではなく、Archについてあまり詳しくありませんが、同僚に説得されてこれを試しています。これで三つのコンテナがあるのがわかります。
[31:48] そして二つのDebianコンテナ、PenguinとKingfisherがあり、さらにArchTestというものがあります。これもまた、Bashを実行するよう指示すれば入ることができます。このコンテナにパッケージをインストールしたい場合は、ActではなくPacManを使います。見てください、本当にArchです、約束します。これはここからできることのほんの一部です。オンラインでLXDとLXDのドキュメントを見れば、さらにアイデアが得られます。コマンドラインだけでなく、他のものをインストールしてGUIとよりよく統合する方法についてのヘルプもオンラインにあります。
[32:28] TOM BUCKLEY: はい。DylanがCrostiniの内部でできる本当にクールなトリックをたくさん見せてくれました。こういうことに興味があれば、Crostiniのsubredditをチェックすることを強くお勧めします。そこにいる人たちは、私たちが機能をリリースするとすぐに、時にはそれより早く見つけてくれますし、Chromebook上のLinuxの新規ユーザーにもとても親切です。質問があればぜひチェックしてみてください。そこの皆さんに大感謝です。
[33:00] これがChromebook上のLinuxです。ご覧のとおり、私たちはすでに多くのウェブおよびAndroid開発者のフローをサポートしています。そして、他の開発者のサポートと、複数コンテナやバックアップ・リストアといった新機能でできることの拡大の両方において、さらに多くのことが控えています。私たちはシンプルさとセキュリティというこれらの原則を適用し続け、最高の開発者体験を提供します。準備ができたら、ぜひご参加ください。ありがとうございました。
[33:31] [拍手] [音楽再生]
英語の原文字幕を見る
[0:00] [MUSIC PLAYING] SUDHA BROSLAWSKY: Good afternoon, everyone. I hope you are having a great time at the I/O. We are here to talk to you about Linux for Chromebooks, also known as Crostini. We'll start by introducing ourselves. My name is Sudha. I'm a designer on Crostini for Chromebooks. DYLAN REID: Hi, I'm Dylan. I'm the Chrome OS Virtualization Lead. TOM BUCKLEY: And I'm Tom, Product Manager for Linux on Chromebooks.
[0:31] Now it's the end of day two at I/O and you've probably already been to a bunch of different sessions that have talked about all the new frameworks that you need to be using or the platforms that you need to be building for, and everyone's right, you absolutely should be, but we're not really here to talk about that. Instead what we want to talk about is you as developers and how you can get more peace of mind by using Linux on Chromebooks. We give you that peace of mind by balancing simplicity and security.
[1:03] SUDHA BROSLAWSKY: On that note, let's do a quick user study. How many of you are developers in the audience? Wow, that's a full room, as expected. Keep your hands raised. How many of you use your computers for anything else other than development, like doing your taxes, checking email-- again, 100% of you. OK, one last question. How many of you are worried about security? DYLAN REID: Good, that's pretty-- I mean, you all should be, so I'm glad to see many hands up anyway.
[1:40] So I don't know about you, but when I start a new project, I get stuck a lot. I hit a lot of walls and I hit a lot of barriers and I go to look for a problem, go to look for a solution, and I turn to Google. And luckily, Google's almost always got a great answer for me. Unluckily, sometimes the answer looks like this. And I know I shouldn't run this script from evilsite.com and pipe it to Sudu, but that deadline's coming up and maybe this site looks kind of legit, so in this case, I'll make an exception and I'll do this.
[2:17] And then it happens again and again, and eventually, I end up with a system that I don't trust as much as I should, because I don't really know what code I've run on it anymore. I don't have time to read all these scripts. My solution to this has been to carry two laptops-- one for my developer world and one for my everything else world that I want to be secure in. But recently, I've switched to using one laptop, and Tom's going to talk about how I do that. TOM BUCKLEY: So our goal with Chrome OS has been to give you a simple and secure experience from the start, but if you tried it previously, you might have seen that it wasn't quite ready for developers.
[2:57] In order to be simple and secure, we couldn't run all of the tools that developers need to get their job done. But that all changed at I/O last year when we announced that we were going to start supporting Linux on Chromebooks. Linux on Chromebooks lets you run all of your favorite editors, IDEs, and tools, and it's now supported on over 50% of Chromebooks, including great devices with eighth generation Intel CPUs like the Lenovo Yoga Book C630 and the Acer Chromebook Spin 13.
[3:31] If you haven't seen it, we're going to run through a few examples. First off, how do you get it? It's really easy. It's just a couple clicks. Now in the background, this is downloading a virtual machine, setting up containers, configuring it all-- Dylan's going to go more into that in a few minutes, but for you as a developer, it's just a couple clicks to get started. And this adds a terminal to your launcher. Now if you open that terminal, you'll see that you have a pretty standard Debian environment and we've already loaded in a bunch of the tools that developers expect, like Git and Vim, and if you need anything else, you have the APT Package Manager and you can install whatever packages you need.
[4:11] And if you want to instead install programs via .dev files, you can do that, too. This gives you access to thousands of world-class developer tools. Now once you've installed any graphical apps, you'll find that they all show up in your launcher, just like the rest of your Chrome OS apps, and if you open them, they show up in your Window Manager-- again, just like the rest of your Chrome OS apps. This is the simple experience that people have come to expect from Chrome OS and we didn't want to change that with Linux.
[4:45] But importantly, this is also secure. You don't have to worry about malware accessing your files, snooping on your traffic, or infecting your peripherals. I'd ask you to trust us on that but this is way too important for you to take on trust alone, so over the course of this talk, Dylan and Sudha are going to walk you through the principles behind the architecture and design of Crostini. We're then going to dissect some common developer flows to show you how these principles apply.
[5:16] And finally, we're going to share some tips and tricks for advanced usage for the power users out there. So now I'm going to hand it over to Dylan to talk about the architecture. [APPLAUSE] DYLAN REID: Good job. OK. So Chrome OS has always had a layered approach to security and our big layer has always been the browser and the renderer and running all untrusted code in a nice isolated renderer, and that keeps the attack surface of your core system to an absolute minimum.
[5:51] They're not allowed to make a lot of system calls. They can't poke at random bits of your kernel. And that worked really well for web pages, web apps. However, for developer tools, I need to install a lot of different programs. They need a lot of different privileges. They can do anything any app on Linux can do. And that wasn't acceptable for us on the core of Chrome OS, so we needed to add a layer. So we added a virtualization layer, and that lives in the main Chrome OS layer, and that spins up a VM.
[6:23] And now this VM has a much more limited interface while still exposing a full Linux kernel to the programs that run inside the VM. The only way the VM can talk to Chrome OS proper is through a small API that that cross-VM program on the left up there exposes to the guest. This is pretty good. Now we've greatly reduced attack surface. We were pretty happy with this. We wanted to go a little further. So we made sure that the guest VM was also signed by Google and somewhat trusted.
[6:58] This lets us trust some of the actions the guest VM takes, and it's also read-only, so users can only break things so much. And that, no matter what you do, you're going to be able to boot a VM. However, with all that security solved, we're back in a situation where you don't have enough flexibility. Your apps can't do anything. It's a read-only thing. You can't install anything in it. So we added another layer, and for this, we stole-- used-- LXD from Canonical.
[7:32] That team's been very helpful in getting this spun up with us. It's a pretty standard container runtime. It's built for running system containers. And in our case, we started a system container of Debian and exposed that to the user. So that cross-VM layer I was talking about, that's kind of the most important part of the security story here. It's the last line of defense before something gets into Chrome OS. So we went and we focused on this for a long time and made sure we got that as secure as possible.
[8:06] We wrote it in a memory-safe programming language. We chose Rust. This eliminates buffer overflows and integer overflows and a lot of common bugs related to memory safety that are exploited by attackers. We were pretty happy with that, but we again added another layer of security here in that we broke up the virtualization program into pillars and made sure that each pillar that interfaces with the guest only has access to small parts of your host Chrome OS system.
[8:38] So your host Chrome OS system, you've got your bank's web page open, you've got your online tax filing thing open, you've got all kinds of personal identifiable information everywhere. We really wanted to protect that. But we needed to give the guest access to things, like a random number, a display, a USB device. So each of those got their own jail and they can only see the thing they need. So our random number generator can generate random numbers. It can't access any files. It's in an empty file system from its perspective.
[9:09] It doesn't have any network access. The display driver, it can access the display. Again, it can't touch the network. It can't go grab your files and upload them, even if somebody gets into it and tries to make it do things we didn't intend it to. This is all a little complicated, but we've added a great amount of system UI to make this easy for you to use, so when you're just doing your job as a developer, you don't have to worry about these pretty pictures I've drawn for you. And Sudha will show you what we did.
[9:40] SUDHA BROSLAWSKY: Thank you, Dylan. Security is absolutely top of mind for us. While crafting the Linux experience on Chromebooks, we came up with three high-level design goals. The first goal was to keep your experience intuitive. Everyone here in this room has been using computers for a long time and you have established your workflows and habits. So basically what we wanted to do is to match to those expectations.
[10:14] We wanted to provide an experience that's natural to you. We want developers everywhere to be using Chromebooks and feel right at home doing it. The second goal was to make your experience native. We could have taken the easy path by giving you a full Linux desktop in a VM but that wasn't good enough. Our goal was to bring the Linux apps you depend on for development into your native Chrome OS experience.
[10:47] The third goal was to make your experience simple, and I think this is very important. There's a lot of complexity that's going on under the hood and we want to leave it there. Our guiding principle is that complexity shouldn't interfere with the user experience. There's a couple of things we are trying to balance here. The security concerns that come with installing Linux apps on Chromebooks and the simplicity that comes with sticking to design patterns established by Chrome OS.
[11:26] And our mission was to find that sweet spot. TOM BUCKLEY: All right. So now we're going to talk about three common developer flows and see how they work with Crostini. And the first of these is accessing files. As developers, we have to do this all the time. Our editors need to access files, as do our compilers, our source control, and a whole lot more. But the problem is that our file systems have a lot more than just code.
[11:58] They have our personal photos, our tax returns, maybe that novel that you've been working on. A lot can go wrong. Ransomware can hold all of that data hostage. Malware can upload your files to some random server. Or maybe you just get something that goes and deletes everything for the fun of it. We built Crostini with those threats in mind to limit what can go wrong, and Dylan will tell you how. DYLAN REID: So our goal sharing files with your VM and with your container was to make it easy for you to get the files you needed for your development tasks where you need them but not expose things you don't want exposed to untrusted code.
[12:44] Because ultimately, we don't trust the code that's running inside this VM. To do this, we took a layered approach. Your files all live in Chrome OS at the very bottom, and we share them out to the VM with a 9P server. We named it 9S. Again, we wrote it in Rust so it's memory safe, we fuzzed it to make sure unexpected inputs don't cause unexpected behavior, and we put it in a tight jail so it can access only the files you share with it.
[13:16] And it takes those files and exports them to the VM. The VM mounts the 9P thing that's built into Linux, and then LXD takes that mount and exposes it into your container where your development tools are running. The important thing here is that your container can only see files that you say, I want to share with my development environment. Your VM can only see those same files. And even the server that we wrote, running on Chrome OS, can only see those files. It doesn't get to see everything. So somebody exploits this stack all the way back into Chrome OS.
[13:49] They still don't have access to the files you haven't shared with the container. That's a lot of stuff to set up. Setting up 9P amounts, bind-mounting things into containers. We had to do this manually for a while when we were developing it. It was painful. So I'll let Sudha show you how easy we made it for you. SUDHA BROSLAWSKY: There are a lot of layers going on, but let's see how simple this is in the UI. Right out of the box, you have a directory called Linux Files, which is your home directory within Linux.
[14:24] Anything in this directory is automatically shared with Linux. Outside of this directory, anywhere else on the device, Linux doesn't have access to anything until you grant permissions. I'll walk you through a couple of examples here. Let's say you're working on a project and you see yourself needing files from this one folder called Illustrations. To share this, all you have to do is access the right-click menu and click on Share with Linux.
[14:58] And as simple as two steps, you've now shared this folder with Linux. If you notice, this is in Google Drive, and that's a cool thing. When you don't want to share this anymore, you can do that by going to Settings and Unsharing. Here's another example where we made quick edits really simple for you. You have a data file in your Downloads folder, and when you double-click, it automatically opens in VS code.
[15:31] When this happens, in the background, it's implicitly shared. And the sharing lasts until you restart. This is the balance of security and simplicity we wanted to bring you. TOM BUCKLEY: Thank you. So, for our second developer flow that we're going to talk about, we're going to look at running a web server. Now being Chrome OS, we care a lot about people making great web apps, and we want to make sure that they can create those on a Chromebook. And being able to run a web server is pretty central to being able to build any web app.
[16:08] Unfortunately, web servers also need a pretty low level of access and that can cause some problems. The code that can run a web server is also capable of snooping on your internet traffic. It can know what sites you're accessing, and in some cases, even see the contents of those pages. This means that a malicious web server could potentially track everything that you're doing. Now again, we thought of this as we designed Crostini and we made sure that we prevented this kind of attack.
[16:39] Dylan will tell you how. DYLAN REID: I can be called Linux, that's OK. That's my job. All right, so starting a web server from Crostini, simple. We've got a good demo over in the web dev sandbox already. Type a command. You fire up your web server, just like you would on any Linux distribution out there. What's actually happening under the hood, though, is you're in a container and you open up a port. That port's in a network namespace inside a VM, running under our special hypervisor which puts its network stack in another namespace on the host, and then finally out to Chrome.
[17:20] So Chrome can't get back in, which is great for security. You've got wonderful isolation. But if I want to test this new PWA or web page I'm running in my VM, how do I get Chrome to talk to it? This was not simple. So for that, we had to add some daemons along the way-- actually, every layer gets a daemon for this. The first one's running in the VM and it's sitting there waiting to check if any container that's running happens to open a port.
[17:53] And then it's got to figure out which container opened that port. And bundles that information up, sends it to Chrome OS. Says, hey, this port in this container is listening. The user might want to use that port. And on the Chrome OS, we say, OK. The other daemon responds. Says, I will set up a route to do some forwarding. I'm going to forward all of this over VSOCK, which is a protocol used to talk to local VMs on machines. That's kept under the hood. So either end, it talks HTTP into the daemons, and the daemons talk VSOCK to each other.
[18:28] So the key here is that the web server gets to talk HTTP. Chrome gets to talk HTTP. Everything's normal. Everything works just like you would. Well, under the hood, we've got all these extra daemons and VSOCK forwarding going, but we've hidden that. One other important thing, we've made it trusted. So you can get all your PWA features. You can install it to your desktop. Even though it's not technically the same machine, we know it is because we've got the information. We set up the VM.
[18:58] So we allow it to be trusted domain. And all this complexity I think makes one of our best demos today of how complicated we made it under the hood and how simple you're going to see it as actual use. SUDHA BROSLAWSKY: I totally agree that this is very complicated under the hood, but in the UI, it's exactly like you would expect it to be. Let's say you're experimenting with building this cool PWA. Here in terminal, you're in your folder, PWA Starter Kit.
[19:31] You're running the commands to start your web server. And if you see at the bottom of the screen, it's listening at port 8080. At this point, you can launch your browser, go to local host 8080, and test your web app. On the screen here, on the left, you have your web app in Chrome, and on the right, if you're noticing it, it's in Chrome. Yes, you can test your web app on a Chromebook in Firefox, too.
[20:07] If you notice, we did not prompt you to give any permissions while we were in this flow. This is because the host is accessing the VM and not the other way around. Again, this is another way we kind of balanced the security and simplicity factor we were talking about. TOM BUCKLEY: All right. Finally, for our third demo, we're going to talk about testing an Android app. Now this is really exciting because just yesterday, we announced that Android Studio is officially supported on Chromebooks, and we even created an installer just for Chrome OS to make it really easy to get started with.
[20:49] Now of course, Android Studio isn't the only thing that you need in order to build a great Android app. You also need something to test that app on-- usually a phone-- and while you could do that over Wi-Fi with ADB remote and all this sort of stuff, we wanted to make it easy-- just the experience that you'd expect on any other device. I can plug my phone in over USB and test my app that way. Now, if I'm an Android developer, sure, I'll plug my phone in to test my app, but I'm also going to plug in a lot of other devices over USB over the course of my day.
[21:21] I may plug in a USB drive that has a lot of family photos on it. I may plug in a wearable that has some health information. I may even plug in my security key for work that gives me all of my access. Malware can take advantage of these devices to uniquely identify you as you move between machines, to spread itself, or even to make changes to them. Again, we thought of these threats when designing Crostini and made sure that we were preventing them. DYLAN REID: Yeah, implementing USB was a lot of fun for us.
[21:57] It might have been our most painful stack. Same principles apply. We've got our layers. We protect the host. There's a lot of attack surface in a host USB stack. It's a very complicated kind of loosely-specced protocol. Well it's an exact spec that's loosely implemented by a lot of people. So we've hidden that. Kept that on the host side. Wrote a device that we live in cross-VM jail.
[22:27] Again, we've got a USB driver. It's pretty complicated. It's got a lot of code in it and I'm sure there's a bug or two. So we made sure it was very well isolated. It can't get to your files. It can't get to the network. It also can't get to any USB device. You have to explicitly say, hey, I want to give this USB device to my development environment. And we've tried to make that as easy as possible. And what actually happens under the hood, we've always got an emulated USB bus running, so the guest always sees, hey, I've got a USB bus, there's just nothing plugged in.
[23:02] And once you indicate that I want to give this to my VM, it says, OK, I'm going to add this device to this bus and then we show it to the guest. And then the guest again in turn has to forward that into the container and the container can see it. There's two things we really focused on here. One was security. Again, we addressed that with the jail and we made sure that the attack surface was as minimal as possible. It's also written in Rust and it's nice and memory-safe and it's fuzzed. But the other issue here is privacy because people somehow use lists of USB devices attached to machines to fingerprint and track users, and we wanted to make sure the untrusted code running inside the container couldn't be another way to do that.
[23:46] Again, this is a lot of steps. We have to create a device. We have to export it to a VM. We have to export it to a container. We have to decide which device to export or not. And again, we'll have a demo that shows how easy it is. SUDHA BROSLAWSKY: OK. This is the last demo. Let's say I'm on my Linux-enabled Chromebook and you're plugging in your phone. You'll see a notification that prompts you to connect to Linux.
[24:17] At this point, only Chrome OS has knowledge of your phone. Linux doesn't even know that your phone exists and that's a good thing. If you see here, your phone is not listed in the USB list, but when you rerun the command, once you connect on the notification, your phone shows up in the list. At this point, you established access to Linux to your phone.
[24:49] Let's say you're working on a project. You're developing a cool app again in Android Studio, and you're ready to test it out. You hit Run and select the phone, and boom. Just like that, you're able to test your app on your phone. At this point, you can debug and test out your app. Finally, you can go to Settings and manage what Linux access to at any point of time. So you can see how security is at the core of your Linux experience on Chromebooks.
[25:27] You, the user, are in full control at all times of what Linux has access to. We take advantage of a variety of UX patterns to make it simple to use and also native to Chrome OS. The combination of principles of Chrome OS and Crostini make this experience pretty unique. DYLAN REID: Thanks. My turn.
[25:57] All right, good. We've got plenty of time. So we've been talking about a lot of details and I've been talking a lot about layers and jails, and all that's important and it's a good reason for you to trust our normal flows, and when I'm using my Chromebook, I almost always stay within these common workflows that we've polished and made sure work. However, a lot of that technical detail. I was talking about is still usable, and we've left hooks in for you to play with it.
[26:27] So I'm glad I've got time left so I can go through a few of these examples and kind of just whet your appetite for what else you can do. We don't test this stuff. We don't support this stuff. We really want the standard flow to be enough for everybody. But every once in a while, there might be a reason you want to do something a little more advanced, or you might just want to go have fun and play with things under the hood. We're tinkerers, right? We're supposed to be. So we'll go through and show how some of this stuff works.
[26:58] All this is going to be from the Chrome OS shell. This has been in Chrome OS since-- well, longer than I have. And so Control-Alt-T gets you a shell. There's a set of debug commands you can run. We're going to focus on one command, which is the VMC command that we added to control virtual machines and containers. The basic command, you can do a VMC list. It'll show you what VMs you have installed on your system. The default VM is called Termina.
[27:29] So hopefully the font's big enough and you can see what size it is. The Termina VM is the one that all the demos were done for the slides before, so it's up and running. We've made a shortcut to enter a container inside a VM. So if you want to go into the default container, the container's named Penguin. Again, that's where we were doing all these demos from. So there's a VMC container command that gets you into there. We'll pop out of there and then we'll pop back into just the VM.
[27:59] So VMC Start enters your virtual machine without entering your container. So if you go back to my layers, it's the one in the middle-- the thing that LXD runs in. And the reason you'd want to be in here is if you want to manipulate or change containers. So I mentioned we use LXD. There's going to be a lot of LXC commands. That's the LXD control program. This is well-documented online and most of it will work inside Chrome OS, just like it does on a default Ubuntu install.
[28:37] The first one you can do is a list. You can see we've got Penguin running. We have one container. It's up and running. It's got an IP address. So we've got our one container. We might want to play with it a little bit. And before we do, maybe I want to make sure I can get back to a state where I know it's good, right? Because I've broken them before. It's nice to be able to just go back to where I was and play around without worrying. So standard LXE command.
[29:08] It's called Snapshot. And you give it your container name and you can give it the name of your snapshot, and now you've got an image saved that you can go back to if you break things. There's a copy on write, too. We used btrfs in the VM so you're not eating up a ton of disk space. We can get info on our container. This gives a bunch of information. Again, you can go poke around with this on a Chromebook if you want to. The important bit here is that we've got one snapshot at the bottom, the IO1 snapshot we just created.
[29:41] You can have multiple snapshots. It's got a date on it to help you remember if you didn't use a very creative name. And then when you want to restore it back, LXE Restore. These are well-named commands. They did a better job with this than I did. If you really want to go and play with different things, sometimes you want more than one container. So I've got my Penguin container and I'm going to go, say, install some different libraries in this one. Maybe I want to have a container that's got Python 2.7 and a different one that's got Python 3.
[30:15] Or maybe I want a different container for writing Go than the container I have for writing Rust. So we let you do that. You can create as many containers as you want, disk space-limited. These do cost disk space. The most basic way to start off a new container is to copy an existing one. There's an LXE Copy command. The example up here copies the default Penguin container over to a new container named Kingfisher. You can list the containers.
[30:46] You've got two. By default, containers are stopped, so we have to start them. Now we can list-- there it's running. And you can jump in. You say, I want to run Bash in Kingfisher. And now I've got a shell in my new container and I can go off and install whatever random tool chain I didn't want in my default container. Taking that one step further, we chose Debian because it was kind of the easiest thing for us to do. We don't want to tie you down to that, though.
[31:17] We support the Debian workflow. We support some guest packages that are installed in Debian by default. But some people want to use their favorite distro. And there is a huge amount of distros available from the image server that Canonical runs. We'll install an Arch one here. I'm not an Arch guy, I don't really know much about Arch, but some of my coworkers talked me into doing this and playing with it. So now you can see we've got three containers.
[31:48] And I've got two Debian containers, my Penguin and my Kingfisher, and now I've got something called ArchTest. And again, I can enter it by telling it to run Bash. And if I want to install packages in this one, I'll use PacMan instead of Act. Look, it's actually Arch, I promise. That's just a taste of what you can do from here. If you go and look at the LXD and LXD documentation online, you can get some more ideas. There's even some help online about installing other ones and getting them to integrate better with the GUI if you want more than just a command line.
[32:28] TOM BUCKLEY: All right. So Dylan just showed you a bunch of the really cool tricks you can do with Crostini when you go under the hood, and if you're interested in this kind of thing, we really recommend checking out the Crostini subreddit. The folks there find features as soon as we release them, sometimes even sooner, and they're also really welcoming to new users of Linux on Chromebooks. So if you have any questions, please check it out, and a big thanks to the folks there.
[33:00] So that's Linux on Chromebooks. As you can see, we already support a lot of web and Android developer flows. And there's a lot more to come, both in supporting other developers and in expanding what we can do with new capabilities, like multiple containers and backup and restore. We're going to keep applying these principles of simplicity and security to give you the best developer experience possible. Whenever you're ready, we hope you'll join us. Thank you.
[33:31] [APPLAUSE] [MUSIC PLAYING]
Vidleaf リーダーで開く
文字起こしを検索し、行を選択し、タイムスタンプ付きで引用をコピーし、翻訳します。
出典表示
「Chromebook向けLinux:安全な開発(Google I/O ’19)」by Chrome for Developers(https://www.youtube.com/@chromedevs)、CC BY 4.0(https://creativecommons.org/licenses/by/4.0/)に基づくライセンス。ソース動画:https://www.youtube.com/watch?v=pRlh8LX4kQI。このページは動画のテキスト文字起こしに段落分けとタイムスタンプを加えたものです。制作者はVidleafと提携しておらず、Vidleafを推奨するものでもありません。VidleafはAIによる句読点の付加とAI生成の要約を追加しましたが、元の文言はこのページで引き続き確認できます。
あなたは制作者または権利者ですか? 訂正または削除を依頼する: copyright@vidleaf.app (これらのページについてをご覧ください)。
最終更新