IdeaPad Duet Chromebookをデベロッパーモードに変更したのでcroutonをインストールしてみました。
ChromebookにLinuxをインストールするにはいくつかあるようですが、取り合えず比較的簡単そうなcroutonをインストールしてLinux環境を構築してみました。
参考サイト
Complete Guide to Installing Linux on Chromebook
https://itsfoss.com/install-linux-chromebook/
Installing Linux on a Chromebook
There are several ways you can do it.1.Dual-boot Linux with Chrome OS
2.Remove Chrome OS and install Linux (possibly)
3.Install Linux inside Chrome OS and switch between Chrome OS and Linux using keyboard shortcuts, thanks to crouton.
ChromeOSとLinuxのデュアルブート、可能ならChromeOSを消してLinuxをインストール、それとChromeOSにcrouton+Linuxをインストールしてショートカットで切替。
これ以外にもChromeOSの機能としてLXD環境でのLinuxがありますね。
dnschneid/crouton: Chromium OS Universal Chroot … – GitHub
https://github.com/dnschneid/crouton
crouton – ChRomium Os Universal chrooT envirONment
ChromeOSにchroot環境を構築してそこでLinuxを動作させることでしょうか。
- croutonダウンロード
- croshの起動
- shellの起動
- croutonのインストール
- crouton help
- 利用できるLinuxディストリビューションの確認
- 利用できる環境の確認
- その他コマンド
下記からcroutonをダウンロードします。
https://goo.gl/fd3zc
chromeから[Ctrl]+[Alt]+[T]でcroshを起動します。
shellを起動します。
1 2 |
crosh> shell chronos@localhost / $ |
ダウンロートしたcroutonは~/Downloads/にあるのでインストールします。と言っても/usr/local/binを作成してそこにコピー、パーミッションを755にするだけですが。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
chronos@localhost / $ ls -l ~/Downloads/crouton -rw-r--r--. 1 chronos chronos 4040 Mar 13 09:52 /home/chronos/user/Downloads/crouton chronos@localhost / $ sudo ls -l /usr/local/bin We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. ls: cannot access '/usr/local/bin': No such file or directory chronos@localhost / $ sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton chronos@localhost / $ ls -l /usr/local/bin total 4 -rwxr-xr-x. 1 root root 4040 Mar 13 10:01 crouton |
install help
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
chronos@localhost / $ install --help Usage: install [OPTION]... [-T] SOURCE DEST or: install [OPTION]... SOURCE... DIRECTORY or: install [OPTION]... -t DIRECTORY SOURCE... or: install [OPTION]... -d DIRECTORY... This install program copies files (often just compiled) into destination locations you choose. If you want to download and install a ready-to-use package on a GNU/Linux system, you should instead be using a package manager like yum(1) or apt-get(1). In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to the existing DIRECTORY, while setting permission modes and owner/group. In the 4th form, create all components of the given DIRECTORY(ies). Mandatory arguments to long options are mandatory for short options too. --backup[=CONTROL] make a backup of each existing destination file -b like --backup but does not accept an argument -c (ignored) -C, --compare compare each pair of source and destination files, and in some cases, do not modify the destination at all -d, --directory treat all arguments as directory names; create all components of the specified directories -D create all leading components of DEST except the last, or all components of --target-directory, then copy SOURCE to DEST -g, --group=GROUP set group ownership, instead of process' current group -m, --mode=MODE set permission mode (as in chmod), instead of rwxr-xr-x -o, --owner=OWNER set ownership (super-user only) -p, --preserve-timestamps apply access/modification times of SOURCE files to corresponding destination files -s, --strip strip symbol tables --strip-program=PROGRAM program used to strip binaries -S, --suffix=SUFFIX override the usual backup suffix -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY -T, --no-target-directory treat DEST as a normal file -v, --verbose print the name of each directory as it is created --preserve-context preserve SELinux security context -Z set SELinux security context of destination file to default type --context[=CTX] like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX --help display this help and exit --version output version information and exit The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values: none, off never make backups (even if --backup is given) numbered, t make numbered backups existing, nil numbered if numbered backups exist, simple otherwise simple, never always make simple backups GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report install translation bugs to <http://translationproject.org/team/> Full documentation at: <http://www.gnu.org/software/coreutils/install> or available locally via: info '(coreutils) install invocation' |
初めてなのでhelpの確認を。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
chronos@localhost / $ sudo crouton Downloading latest crouton installer... ############################################################################################################## 100.0%############################################################################################################## 100.0% crouton [options] -t targets crouton [options] -f backup_tarball crouton [options] -d -f bootstrap_tarball Constructs a chroot for running a more standard userspace alongside Chromium OS. If run with -f, where the tarball is a backup previously made using edit-chroot, the chroot is restored and relevant scripts installed. If run with -d, a bootstrap tarball is created to speed up chroot creation in the future. You can use bootstrap tarballs generated this way by passing them to -f the next time you create a chroot with the same architecture and release. crouton must be run as root unless -d is specified AND fakeroot is installed AND /tmp is mounted exec and dev. It is highly recommended to run this from a crosh shell (Ctrl+Alt+T), not VT2. Options: -a ARCH The architecture to prepare a new chroot or bootstrap for. Default: autodetected for the current chroot or system. -b Restore crouton scripts in PREFIX/bin, as required by the chroots currently installed in PREFIX/chroots. -d Downloads the bootstrap tarball but does not prepare the chroot. -e Encrypt the chroot with ecryptfs using a passphrase. If specified twice, prompt to change the encryption passphrase. -f TARBALL The bootstrap or backup tarball to use, or to download to (-d). When using an existing tarball, -a and -r are ignored. -k KEYFILE File or directory to store the (encrypted) encryption keys in. If unspecified, the keys will be stored in the chroot if doing a first encryption, or auto-detected on existing chroots. -m MIRROR Mirror to use for bootstrapping and package installation. Default depends on the release chosen. Can only be specified during chroot creation and forced updates (-u -u). After installation, the mirror can be modified using the distribution's recommended way. -M MIRROR2 A secondary mirror, often used for security updates. Can only be specified alongside -m. -n NAME Name of the chroot. Default is the release name. Cannot contain any slash (/). -p PREFIX The root directory in which to install the bin and chroot subdirectories and data. Default: /usr/local, with /usr/local/chroots linked to /mnt/stateful_partition/crouton/chroots. -P PROXY Set an HTTP proxy for the chroot; effectively sets http_proxy. Specify an empty string to remove a proxy when updating. -r RELEASE Name of the distribution release. Default: xenial, or auto-detected if upgrading a chroot and -n is specified. Specify 'help' or 'list' to print out recognized releases. -t TARGETS Comma-separated list of environment targets to install. Specify 'help' or 'list' to print out potential targets. -T TARGETFILE Path to a custom target definition file that gets applied to the chroot as if it were a target in the crouton bundle. -u If the chroot exists, runs the preparation step again. You can use this to install new targets or update old ones. Passing this parameter twice will force an update even if the specified release does not match the one already installed. -V Prints the version of the installer to stdout. Be aware that dev mode is inherently insecure, even if you have a strong password in your chroot! Anyone can simply switch VTs and gain root access unless you've permanently assigned a Chromium OS root password. Encrypted chroots require you to set a Chromium OS root password, but are still only as secure as the passphrases you assign to them. chronos@localhost / $ sudo crouton -V crouton: version 1-20200724165050~master:08dac970 |
chroot環境は標準では下記の場所になっていますね。
Default: /usr/local, with /usr/local/chroots linked to /mnt/stateful_partition/crouton/chroots.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
chronos@localhost / $ crouton -r list Recognized debian releases: potato! woody! sarge! etch! lenny! squeeze! wheezy! jessie stretch buster bullseye sid Recognized kali releases: moto! kali! sana! kali-rolling Recognized ubuntu releases: warty! hoary! breezy! dapper! edgy! feisty! gutsy! hardy! intrepid! jaunty! karmic! lucid! maverick! natty! oneiric! precise! quantal! raring! saucy! trusty! utopic! vivid! wily! xenial yakkety! zesty! artful! bionic* cosmic! disco! eoan* focal* Releases marked with ! are upstream end-of-life, and should be avoided. Releases marked with * are unsupported, but may work with some effort. |
!マークのリリースはサポートが終了しているので利用しない方がいいよ。
*マークはサポート外だけど、頑張れば動作するかも。
デフォルトがxenialってUbuntu 16.04 LTSなんですね。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
chronos@localhost / $ sudo crouton -t list Available targets: audio Support audio playback via Chromium OS's audio system. Requires: core chrome Google Chrome browser, stable channel. Requires: x11 chrome-beta Google Chrome browser, beta channel. Requires: x11 chrome-dev Google Chrome browser, dev channel. Requires: x11 chromium Chromium browser. Uses the distro's version, which may be old. Requires: x11 cli-extra Basic CLI tools such as ssh. Requires: core core Performs core system configuration. Most users would want this. e17 Installs the enlightenment desktop environment. (Approx. 50MB) Requires: gtk-extra extension Clipboard synchronization and URL handling with Chromium OS. Requires: x11 gnome Installs the GNOME desktop environment. (Approx. 400MB) Requires: gtk-extra gnome-desktop Installs GNOME along with common applications. (Approx. 1100MB) Requires: gnome gtk-extra GTK-based tools including gdebi and a simple browser. Requires: x11 kde Installs a minimal KDE desktop environment. (Approx. 600MB) Requires: x11 kde-desktop Installs KDE along with common applications. (Approx. 1000MB) Requires: kde keyboard Adds support for Chromebook keyboard special keys. Requires: x11 kodi Installs the KODI media player. (Approx. 200MB) Requires: x11 lxde Installs the LXDE desktop environment. (Approx. 200MB) Requires: gtk-extra lxde-desktop Installs LXDE along with common applications. (Approx. 800MB) Requires: lxde touch Touchscreen and limited generic gesture support. Requires: x11 unity Installs the Unity desktop environment. (Approx. 700MB) Requires: gtk-extra unity-desktop Installs Unity along with common applications. (Approx. 1100MB) Requires: unity x11 X11 via autodetected backend. Does not install any desktop environment. xfce Installs the Xfce desktop environment. (Approx. 250MB) Requires: gtk-extra xfce-desktop Installs Xfce along with common applications. (Approx. 1200MB) Requires: xfce xiwi X.org X11 backend running unaccelerated in a Chromium OS window. Requires: audio extension xorg X.Org X11 backend. Enables GPU acceleration on supported platforms. |
1 2 3 4 5 6 7 8 9 10 |
chronos@localhost / $ ls -l /usr/local/bin/ total 128 -rwxr-xr-x. 1 root root 7310 Mar 13 12:12 crash_reporter_wrapper -rwxr-xr-x. 1 root root 4040 Mar 13 10:01 crouton lrwxrwxrwx. 1 root root 11 Mar 13 12:12 delete-chroot -> edit-chroot -rwxr-xr-x. 1 root root 32105 Mar 13 12:12 edit-chroot -rwxr-xr-x. 1 root root 34899 Mar 13 12:12 enter-chroot -rwxr-xr-x. 1 root root 21225 Mar 13 12:12 mount-chroot -rwxr-xr-x. 1 root root 539 Mar 13 12:12 startxfce4 -rwxr-xr-x. 1 root root 18675 Mar 13 12:12 unmount-chroot |
edit-chroot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
chronos@localhost / $ edit-chroot edit-chroot [options] name [...] Edits a chroot. Options: -a Operates on all chroots in /mnt/stateful_partition/crouton/chroots. If no other operation is specified, prints out the names of the chroots. -c CHROOTS Directory the chroots are in. Default: /mnt/stateful_partition/crouton/chroots -b Backs up the chroot to a tarball. Compression format is chosen based on the tarball extension. Backups always take place before other actions on a given chroot. -d Deletes the chroot. Assumed if run as delete-chroot. -e If the chroot is not encrypted, encrypt it. If it is encrypted, change the encryption passphrase. -f TARBALL When used with -b, overrides the default tarball to back up to. If unspecified, assumes NAME-yyyymmdd-hhmm.tar[.gz], where .gz is included for unencrypted chroots, and not for encrypted ones. When used with -r, specifies the tarball to restore from. If TARBALL is a directory, automatic naming is still used. If multiple chroots are specified, TARBALL must be a directory. -k KEYFILE File or directory to store the (encrypted) encryption keys in. If unspecified, the keys will be stored in the chroot if doing a first encryption, or left in place on existing chroots. If specified, keyfile will be moved. Specify a dash - as the KEYFILE to move the key back into the chroot. If multiple chroots are specified, KEYFILE must either be - or a directory. -l Prints out croutonversion details on the chroot, if available. Specify twice to prompt and unlock encrypted chroots as necessary. -m DEST Moves a chroot. Specify a new name to keep it in the same directory, or an absolute path to move it entirely. DEST can be a directory, in which case it must end in a slash. If multiple chroots are specified, DEST must be a directory. If you are moving a chroot to a SD card/USB drive, make sure the storage is formatted to ext2/3/4. -C DEST Like -m, but copies instead of moves. -r Restores a chroot from a tarball. The tarball path can be specified with -f or detected from name. If both are specified, restores to that name instead of the one in the tarball. Will not overwrite a chroot when restoring unless -r is specified twice. -s SPLIT Force a backup archive to be split into SPLIT-sized chunks. SPLIT is specified in megabytes (1048576 bytes), and cannot be smaller than 10. FAT32 filesystems are split by default to fit within 4GB. -y Do all actions without confirmation. |
enter-chroot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
chronos@localhost / $ enter-chroot enter-chroot [options] [command [args...]] Enters an installed Debian-based chroot for running alongside Chromium OS. By default, it will log into the primary user on the first chroot found. You can specify a command and parameters to run instead of an interactive shell. Options: -b Fork and run the specified command silently in the background. -c CHROOTS Directory the chroots are in. Default: /mnt/stateful_partition/crouton/chroots -l Make the command part of a login. Parameters are passed directly to the chroot command, and a call to su is appended. -k KEYFILE Override the auto-detected encryption key location. -n NAME Name of the chroot to enter. Default: first one found in CHROOTS -t TARGET Only enter the chroot if it contains the specified TARGET. -u USERNAME Username (or UID) to log into. Default: 1000 (the primary user) -X XMETHOD Override the auto-detected XMETHOD for this session. -x Does not log in, but directly executes the command instead. Note that the environment will be empty (sans TERM). Specify -x a second time to run the /prepare.sh script. |
mount-chroot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
chronos@localhost / $ mount-chroot mount-chroot [options] name [...] Mounts one or more chroots into a root-only subdirectory of /var/run/crouton Options: -c CHROOTS Directory the chroots are in. Default: /mnt/stateful_partition/crouton/chroots -e If the chroot is not encrypted, encrypt it. If specified twice, prompt to change the encryption passphrase. -k KEYFILE File or directory to store the (encrypted) encryption keys in. If unspecified, the keys will be stored in the chroot if doing a first encryption, or auto-detected on existing chroots. -n Create the chroot if it doesn't exist. -p Prints out the path to the mounted directory on stdout. |
unmount-chroot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
chronos@localhost / $ unmount-chroot unmount-chroot [options] name [...] Unmounts one or more chroots, optionally killing any processes still running inside them. By default, it will run in interactive mode where it will ask to kill any remaining processes if unable to unmount the chroot within 5 seconds. Options: -a Unmount all chroots in the CHROOTS directory. -c CHROOTS Directory the chroots are in. Default: /mnt/stateful_partition/crouton/chroots -f Forces a chroot to unmount, potentially breaking or killing other instances of the same chroot. -k KILL Send the processes SIGKILL instead of SIGTERM. -p Print to STDOUT the processes stopping a chroot from unmounting. -t TRIES Number of seconds to try before signalling the processes. Use -t inf to be exceedingly patient. Default: 5 -x Keep the root directory of the chroot mounted. -y Signal any remaining processes without confirmation. Automatically escalates from SIGTERM to SIGKILL. |
確認しながらヘルプ書いてたら長くなってしまったのでLinuxのインストールは次回にします:-)