本篇暂时作为个人的笔记使用,可读性可能较差

在前几个月的某次更新后,设置里出现了悄悄的出现了一个Linux(Beta)的选项,这允许你使用官方的Linux支持,并且使用一个完全与Chrome OS共生的系统,而不再是像crouton那样为了使用一个图形应用程序而安装一套完整的桌面环境。

  • 在设置中启用Linux,注意需要翻墙并且有可能无法通过使用本机的翻墙方式需要使用路由器做到完全翻墙(待考证,个人认为原因是Chrome OS的翻墙无法影响到共生的Linux),如果出现错误尝试直接点击重试而不是取消后删除进度重来。
  • 安装好之后的系统是Debian 9,支持图形应用,在应用中找到Terminals直接运行即可。
  • 在ctrl+alt+t中输入vmc list可以看到当前的vmc容器(个人理解,不清楚具体叫法),使用vmc start termina可以进入一个不同于shell的命令行。

使用lxc查看与子系统相关的命令,参照网络上的解释,似乎是Chrome OS嵌套VM嵌套子Liunx系统三重嵌套。

使用类似lxc launch images:ubuntu/xenial xenial的命令可以建立新的子系统,参照网络上的资料似乎以此方式新建的不支持图形化的程序,仅以默认方式建立的才支持(从Terminals中直接运行即可),不过影响并不大,即使是ubuntu也是基于debian的(大概)。支持的系统列表参照这里 https://us.images.linuxcontainers.org/

子系统除了提示给出的操作外可以通过如下方式运行

run_container.sh --container_name xenial --shell --user root

lxc exec xenial -- /bin/bash

参考资料:
https://www.reddit.com/r/Crostini/comments/8ayrnl/creating_other_lxc_containers/
http://linuxiumcomau.blogspot.com/2018/08/introduction-to-crostini-part-3-using.html
https://www.reddit.com/r/Crostini/comments/94oja4/making_ubuntu_the_default_container_in_crostini/
https://www.reddit.com/r/Crostini/comments/8ju1lx/terminal_suddenly_failing_to_start/
https://blog.google/products/chromebooks/linux-on-chromebooks/
https://www.reddit.com/r/Crostini/comments/9hhk0o/error_installimg_linux_on_pixelbook/

鉴于Crostini稳定性太差(我是崩过好几次),如果要稳定的开发环境建议使用crouton,或者随时备份同步自己的代码到云端。

(这个问题似乎可以改善,参照下一篇文章)

19-6-29更新

鉴于现在的稳定性已经有很大的改善(也可能是因为笔者使用的是Beta channel),已经很长时间没有将crouton作为生产环境了。

来自crouton官方的对比推荐:

Crostini is an official project within Chromium OS to bring the Linux shell and apps to the platform in verified mode with clean integration, multi-layered security, and all the polish you expect from Chromium OS proper.

That means compared to crouton, Crostini has official support, competent engineers, and code that looks a little less like ramen. crouton, in its defense, has wider device compatibility, enables direct hardware access, and is named after an objectively tastier bread-based food item.

There's a solid community on Reddit if you'd like to try Crostini out. If it works for you -- great! No hard feelings. If in the end you decide that crouton suits you better, read on!

Note: you can't get the best of both worlds by installing crouton inside of Crostini. The technology (and life itself) just doesn't work that way. Not to mention a crouton Crostini would look ridiculous and be impossible to eat without getting bits everywhere.

标签: none

已有 8 条评论

  1. ABC ABC

    求助下博主,pixelbook chrome79正式版,安装crostini,总是卡在99%完成不了,查看linux文件占用1.4G,此时用lxc list查看container里显示penguin处于运行状态,已经确认过不是网络问题,下载容器的地址https://storage.googleapis.com/cros-containers是能打开的,请问有没有什么解决办法吗?

    1. 既然已经处于运行状态,可以考虑终止安装后(如注销、关机或其他非正常的终止方法),参照ChromeOS(chromebook)中termina无法打开问题的解决方案中的方案尝试解决,或尝试进行备份后再重新恢复来解决。

    2. 我认为出现这种原因应该是虽然正常安装,但是在配置的某些地方卡住了,通过以上的方法尝试重新配置也许会有作用

      1. ABC ABC

        靠自带的备份不起作用,不过我摸索出了曲线救国的方式
        vmc start termina
        lxc exec penguin -- bash
        passwd root #设置root密码

        lxc console penguin
        root用户名密码登录
        passwd 你的gmail用户名

        su 你的gmail用户名
        基本可以正常使用了,就是每次开机需要手动登录一次

  2. seekfreedom seekfreedom

    请教一下博主,有没有办法是linux容器与本机同网段

    1. 在本机的命令行(ctrl+alt+t后输入shell进入)中输入ifonfig可以看到网卡配置与ip。
      可以查询到arcbr0的ip为100.115.92.1,arc_wlan0的ip为100.115.92.9
      在crostini中可以在sudo su root后输入ifconfig得知其ip为100.115.92.197
      由此linux容器与本机原本就是同网段的。

  3. mesa mesa

    请教一下博主Linux设置时磁盘大小
    怎么设置容器为动态存储

    1. 在我的设备上默认就是动态存储的,在当前版本(85.0)的设置->存储管理->Linux(Beta)->磁盘容量中可以修改设置

添加新评论