分类 crouton 下的文章

crouton的代码库及官方详细说明github-crouton,有能力的朋友请直接参考这里。

crouton的下载及使用:

  1. 下载crouton并存放于 Downloads 文件夹中
  2. 参照基本的 Linux 命令工具打开 shell (注意crouton无法通过 在系统之外打开 的方式使用,推荐通过在浏览器窗口中打开的方式)
  3. 输入 cd /home/chronos/user/Downloads 进入 Downloads 文件夹中
  4. 输入 sudo sh -e ./crouton 可以查看 crouton 的帮助信息

当前版本的帮助信息如下所示:

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.

在相关方面有基础知识或者英语还不错的朋友可以直接参照帮助信息完成 Linux 系统的安装。

对于这方面不太了解的小白,在完成上述步骤后直接执行如下命令:

sudo sh -e ./crouton -r xenial -t core

完成 Ubuntu 16.04 (xenial)基本内核的安装,安装完成后会提示输入用户名和密码,按照提示输入即可(注意,输入密码时密码是隐藏的,需要盲打)

完成上述步骤后可以通过

sudo enter-chroot

命令进入 Ubuntu 16.04 (xenial)的终端。

在进入 Ubuntu 16.04 (xenial)之后可以通过输入

logout

来退出 Ubuntu 16.04 (xenial)终端环境。

如果想要使用完整的桌面环境,接下来可以输入

sudo sh -e ./crouton -r xenial -t core,audio,cli-extra,core,touch,,x11,xorg,gtk-extra,keyboard,unity,unity-desktop -u

下载安装完整的 Ubuntu 16.04 (xenial) 桌面环境,其中unity,unity-desktop可以根据需要换成gnome,gnome-desktopkde,kde-desktoplxde,lxde-desktopxfce,xfce-desktop,分别表示不同的桌面环境(推荐使用gnome)

桌面环境安装完成后,根据所安装的桌面环境使用如下命令之一进入桌面环境:

sudo startunity
sudo startgnome
sudo startkde
sudo startlxde
sudo startxfce4

进入以后可以使用Ctrl+Alt+Shift+刷新键随时在 Ubuntu 系统中与 Chrome OS 系统间切换。