Skip to content

Commit 599a160

Browse files
authored
Merge pull request #2237 from madeline-underwood/LXD-containers-on-ChromeOS
Lxd containers on ChromeOS_PV to review
2 parents 5cb308b + 8e87f16 commit 599a160

File tree

5 files changed

+122
-121
lines changed

5 files changed

+122
-121
lines changed

content/learning-paths/laptops-and-desktops/chrome-os-lxc/_index.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,42 @@
11
---
2-
title: Install Ubuntu on ChromeOS Crostini as an LXC Container
3-
4-
draft: true
5-
cascade:
6-
draft: true
2+
title: Install Ubuntu on ChromeOS Crostini as an LXC container
73

84
minutes_to_complete: 60
95

106
who_is_this_for: This Learning Path is for software developers who want to install Ubuntu and other Linux distributions on their Arm-based Chromebook with ChromeOS file sharing and GUI support.
117

128
learning_objectives:
13-
- Create an Ubuntu 24.04 container on ChromeOS Crostini using the Termina shell and LXC.
14-
- Set up ChromeOS integration for file sharing and GUI applications.
15-
- Manage LXC containers on ChromeOS.
9+
- Create and run an Ubuntu 24.04 container on ChromeOS Crostini using LXC and Termina shell
10+
- Set up ChromeOS integration for file sharing and GUI applications
11+
- Manage LXC containers on ChromeOS
12+
- Enable file sharing between ChromeOS and Ubuntu containers
13+
- Run Linux GUI applications on your Chromebook with Sommelier integration
1614

1715
prerequisites:
1816
- A ChromeOS device with the Linux development environment enabled. The Lenovo Chromebook Plus 14 is recommended.
19-
- Basic knowledge of the Linux command line.
17+
- Basic knowledge of the Linux command line
2018

2119
author: Jason Andrews
2220

2321
### Tags
2422
skilllevels: Introductory
2523
subjects: Containers and Virtualization
2624
armips:
27-
- Cortex-A
25+
- Cortex-A
2826
operatingsystems:
29-
- ChromeOS
27+
- ChromeOS
3028
tools_software_languages:
31-
- Ubuntu
29+
- Ubuntu
3230

3331
further_reading:
34-
- resource:
35-
title: Official ChromeOS Linux Support
36-
link: https://chromeos.dev/en/linux
37-
type: documentation
38-
- resource:
39-
title: Linux Containers
40-
link: https://linuxcontainers.org/
41-
type: website
32+
- resource:
33+
title: Official ChromeOS Linux Support
34+
link: https://chromeos.dev/en/linux
35+
type: documentation
36+
- resource:
37+
title: Linux Containers
38+
link: https://linuxcontainers.org/
39+
type: website
4240

4341
### FIXED, DO NOT MODIFY
4442
# ================================================================================
Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
---
2-
title: "Create an Ubuntu container"
2+
title: "Create an Ubuntu 24.04 container on ChromeOS"
33
weight: 2
44
layout: "learningpathall"
55
---
66

7-
The [Lenovo Chromebook Plus 14](https://www.bestbuy.com/site/lenovo-chromebook-plus-14-oled-2k-touchscreen-laptop-mediatek-kompanio-ultra-16gb-memory-256gb-ufs-seashell/6630493.p?skuId=6630493&intl=nosplash) is is powered by the MediaTek Kompanio Ultra processor, featuring an Arm-based MediaTek Kompanio Ultra processor, offers software developers a powerful and energy-efficient platform for Linux development. Its compatibility with containerized environments and support for ChromeOS Linux (Crostini) make it an excellent choice for coding, testing, and running modern development workflows on the go.
7+
## Overview
88

9-
This Learning Path will walk you through setting up an Ubuntu 24.04 container on your Arm-based Chromebook using ChromeOS's built-in Linux development environment. You'll learn how to create and manage containers, install essential development tools, and integrate your Ubuntu environment with ChromeOS features like file sharing and GUI application support. By the end, you'll have a flexible and powerful Arm Linux development environment.
9+
The [Lenovo Chromebook Plus 14](https://www.bestbuy.com/site/lenovo-chromebook-plus-14-oled-2k-touchscreen-laptop-mediatek-kompanio-ultra-16gb-memory-256gb-ufs-seashell/6630493.p?skuId=6630493&intl=nosplash) is powered by the Arm-based MediaTek Kompanio Ultra processor. It provides a powerful and energy-efficient platform for Linux development, with strong compatibility for containerized environments and ChromeOS Linux (Crostini). This makes it an excellent choice for coding, testing, and running modern development workflows on the go.
10+
11+
This Learning Path walks you through setting up an Ubuntu 24.04 container on your Arm-based Chromebook using ChromeOS's built-in Linux development environment. You'll learn how to create and manage containers, install essential development tools, and integrate your Ubuntu environment with ChromeOS features like file sharing and GUI application support. By the end, you'll have a flexible and powerful Arm Linux development environment.
1012

1113
## Access the ChromeOS terminal
1214

1315
The first step to creating an Ubuntu container on ChromeOS is to open the ChromeOS shell.
1416

15-
Open the Chrome browser and press **Ctrl + Alt + T** to open crosh, the ChromeOS shell, crosh.
17+
Open the Chrome browser and press **Ctrl + Alt + T** to open crosh, the ChromeOS shell.
1618

17-
![ChromeOS shell #center](_images/chromeos-shell.png)
19+
![ChromeOS shell #center](_images/chromeos-shell.png "ChromeOS shell")
1820

19-
Run the command below to start the Termina shell.
21+
Run the command below to start the Termina shell:
2022

2123
```console
2224
vsh termina
@@ -26,13 +28,13 @@ You are now in the Termina environment where you can manage containers.
2628

2729
The `lxc` command is used to manage containers on ChromeOS.
2830

29-
You can list the running containers.
31+
List the running containers:
3032

3133
```console
3234
lxc list
3335
```
3436

35-
If you have the default Debian container running you see output similar to:
37+
If you have the default Debian container running, the output looks like:
3638

3739
```output
3840
+---------+---------+-----------------------+------+-----------+-----------+
@@ -42,30 +44,30 @@ If you have the default Debian container running you see output similar to:
4244
+---------+---------+-----------------------+------+-----------+-----------+
4345
```
4446

45-
The name of the Debian container is penguin. When you enable the Linux subsystem on ChromeOS the Debian container named penguin is created, but you can create additional containers with different Linux distributions and different names.
47+
The name of the Debian container is `penguin`. When you enable the Linux subsystem on ChromeOS, the Debian container is created automatically, but you can create additional containers with different Linux distributions and different names.
4648

47-
## Create a Ubuntu 24.04 container
49+
## Create an Ubuntu 24.04 container
4850

49-
This command creates and starts a new Ubuntu 24.04 container named `u1`.
51+
This command creates and starts a new Ubuntu 24.04 container named `u1`:
5052

5153
```bash
5254
lxc launch ubuntu:24.04 u1
5355
```
5456

55-
The output is:
57+
Expected output:
5658

5759
```output
5860
Creating u1
5961
Starting u1
6062
```
6163

62-
Check the status of the new container and confirm the status is RUNNING.
64+
Check the status of the new container and confirm the status is `RUNNING`:
6365

6466
```bash
6567
lxc list
6668
```
6769

68-
Now there are 2 containers running.
70+
Now there are two containers running:
6971

7072
```output
7173
+---------+---------+-----------------------+------+-----------+-----------+
@@ -77,35 +79,40 @@ Now there are 2 containers running.
7779
+---------+---------+-----------------------+------+-----------+-----------+
7880
```
7981

80-
Create a new shell in the Ubuntu container.
82+
Open a shell in the Ubuntu container:
8183

8284
```bash
8385
lxc exec u1 -- bash
8486
```
8587

86-
## Complete the Ubuntu setup
88+
## Set up Ubuntu for development
8789

88-
Once inside the Ubuntu container, you need to perform some initial setup tasks.
90+
Once inside the Ubuntu container, perform initial setup tasks.
8991

90-
Update the package lists and upgrade installed packages to the latest versions.
92+
Update package lists and upgrade installed packages:
9193

9294
```bash
9395
apt update && apt upgrade -y
9496
```
9597

96-
Install essential packages for development and system management. You can select your favorite software packages, these are examples.
98+
Install essential packages for development and system management.
99+
100+
{{% notice Note %}}
101+
You can select your favorite software packages, these are examples.
102+
{{% /notice %}}
103+
97104

98105
```bash
99106
apt install -y net-tools gcc
100107
```
101108

102-
Creating a non-root user is a crucial security best practice and ensures that applications don't have unnecessary administrative privileges. The username `ubuntu` is already available in the container. You are free to use `ubuntu` as your non-root user or create a new user.
109+
Creating a non-root user is a crucial security best practice and ensures that applications don't have unnecessary administrative privileges. The username `ubuntu` is already available, but you can create another user.
103110

104111
{{% notice Note %}}
105-
The following commands use `user1` as a new username. You can replace it with your actual desired username in all subsequent steps.
112+
The following commands use `user1` as the username. Replace it with your own choice in subsequent steps.
106113
{{% /notice %}}
107114

108-
Create a new user account. Skip if you want to use the `ubuntu` user.
115+
Create a new user account (skip if you want to use the `ubuntu` user):
109116

110117
```bash
111118
adduser user1
@@ -123,10 +130,12 @@ Switch to your new user account to continue the setup.
123130
su - user1
124131
```
125132

126-
If you didn't creat a new user switch to `ubuntu` as the non-root user.
133+
If you didn’t create a new user, switch to the default `ubuntu` user:
127134

128135
```bash
129136
su - ubuntu
130137
```
131138

139+
## Next steps
140+
132141
Continue to learn how to integrate the new Ubuntu container with ChromeOS features like file sharing.
Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,93 @@
11
---
2-
title: ChromeOS integration
2+
title: Integrate ChromeOS with Linux containers
33
weight: 3
44
layout: "learningpathall"
55
---
66

7-
## File sharing between ChromeOS and Linux
7+
## File sharing between ChromeOS and Linux containers
88

99
Chromebooks with Linux offer convenient file sharing capabilities between the main ChromeOS environment and the Linux subsystem.
1010

11-
Key Features:
11+
Key features:
1212

13-
- Selective Folder Sharing: ChromeOS allows you to share specific folders (not individual files) from the native files app with the Linux container. This is done by right-clicking a folder and selecting "Share with Linux." Once shared, these directories become accessible to Linux apps and the command line within the Linux environment.
14-
15-
- Two-Way Access: Files and folders created within the Linux container appear in the "Linux files" section of the ChromeOS Files app, enabling seamless movement of data between environments.
16-
17-
- Sandboxed Security: The Linux environment is sandboxed for security, meaning it doesn't have access to the full ChromeOS file system by default. Only the folders explicitly shared by the you are visible in Linux, ensuring protected data separation.
18-
19-
- Easy Integration: Shared folders can be navigated from Linux at paths such as /mnt/chromeos/MyFiles/. Applications and command-line tools within Linux can read and write to these shared folders.
20-
21-
- Management Tools: You can manage and revoke shared folder access through the ChromeOS Files app, allowing for flexible control over what is accessible to Linux.
13+
- **Selective folder sharing**: ChromeOS allows you to share specific folders (not individual files) from the native Files app with the Linux container. This is done by right-clicking a folder and selecting **Share with Linux**. Once shared, these directories become accessible to Linux apps and the command line within the Linux environment.
14+
- **Two-way access**: Files and folders created within the Linux container appear in the **Linux files** section of the ChromeOS Files app, enabling seamless movement of data between environments.
15+
- **Sandboxed security**: The Linux environment is sandboxed for security, meaning it doesn't have access to the full ChromeOS file system by default. Only the folders explicitly shared by you are visible in Linux, ensuring protected data separation.
16+
- **Easy integration**: Shared folders can be navigated from Linux at paths such as `/mnt/chromeos/MyFiles/`. Applications and command-line tools within Linux can read and write to these shared folders.
17+
- **Management tools**: You can manage and revoke shared folder access through the ChromeOS Files app, allowing for flexible control over what is accessible to Linux.
2218

2319
These features make it simple to move files between ChromeOS and Linux applications while maintaining security and user control.
2420

25-
## Configure File System Integration
21+
## Configure ChromeOS file system integration
2622

2723
### Share ChromeOS directories
2824

29-
To access your ChromeOS files from within the Ubuntu container, you need to configure shared directories.
25+
To access your ChromeOS files from within the Ubuntu container, you need to configure shared directories.
3026

31-
You can share directories using the ChromeOS File application. Right click on any directory and select **Share with Linux**.
27+
You can share directories using the ChromeOS Files application. Right-click on any directory and select **Share with Linux**.
3228

33-
If you share a ChromeOS directory it appears in `/mnt/chromeos/MyFiles/` in your Ubuntu container. For example, share your Downloads directory in ChromeOS and it is visible in Ubuntu.
29+
If you share a ChromeOS directory, it appears in `/mnt/chromeos/MyFiles/` in your Ubuntu container. For example, share your Downloads directory in ChromeOS and it is visible in Ubuntu:
3430

3531
```bash
3632
ls /mnt/chromeos/MyFiles/Downloads/
3733
```
3834

3935
### Share Google Drive directories
4036

41-
You can also share Google Drive directories using the ChromeOS Files application. Use the same right click and select **Share with Linux**.
37+
You can also share Google Drive directories using the ChromeOS Files application. Use the same right-click and select **Share with Linux**.
4238

43-
If you share a Google Drive folder it appears in `/mnt/chromeos/GoogleDrive/MyDrive/` in your Ubuntu container. For example, share your `AndroidAssets` directory in Google Drive it is visible in Ubuntu.
39+
If you share a Google Drive folder, it appears in `/mnt/chromeos/GoogleDrive/MyDrive/` in your Ubuntu container. For example, share your `AndroidAssets` directory in Google Drive and it is visible in Ubuntu:
4440

4541
```bash
4642
ls /mnt/chromeos/GoogleDrive/MyDrive/AndroidAssets
4743
```
4844

49-
Your shared folders appear in the **Linux Settings** under **Manage shared folders** as shown below:
45+
Your shared folders appear in the **Linux settings** under **Manage shared folders** as shown below:
5046

51-
![Shared folders #center](_images/shared-folders.png)
47+
![Shared folders #center](_images/shared-folders.png "Shared folders")
5248

53-
### Share a folder using the command line
49+
### Share folders using the command line
5450

55-
You can use the commands below from the Termina shell.
51+
You can also share folders using the Termina shell.
5652

57-
Mount the entire ChromeOS file system to /mnt/chromeos in the container.
53+
Mount the entire ChromeOS file system to `/mnt/chromeos` in the container:
5854

5955
```bash
6056
lxc config device add ubuntu-main shared-chromeos disk source=/mnt/chromeos path=/mnt/chromeos
6157
```
6258

63-
Share your ChromeOS Downloads folder with the container
59+
Share your ChromeOS Downloads folder with the container:
6460

6561
```bash
6662
lxc config device add ubuntu-main downloads disk source=/mnt/chromeos/MyFiles/Downloads path=/home/username/Downloads
6763
```
6864

69-
Share your ChromeOS Documents folder with the container.
65+
Share your ChromeOS Documents folder with the container:
7066

7167
```bash
7268
lxc config device add ubuntu-main documents disk source=/mnt/chromeos/MyFiles/Documents path=/home/username/Documents
7369
```
7470

75-
## File Operations
71+
## Copy files with LXC commands
7672

7773
You can use the `lxc file` command to copy files to and from a container from the Termina shell.
7874

79-
As an example create a file named file1
75+
As an example, create a file named `file1`:
8076

8177
```bash
8278
echo "test file 1" >> /mnt/shared/MyFiles/Downloads/file1
8379
```
8480

85-
Copy the file from your ChromeOS Downloads folder to the tmp directory in the container.
81+
Copy the file from your ChromeOS Downloads folder to the `/tmp` directory in the container:
8682

8783
```bash
8884
lxc file push file1 u1/tmp/file1
8985
```
9086

91-
Copy the same file back to the Downloads directory with a new name.
87+
Copy the same file back to the Downloads directory with a new name:
9288

9389
```bash
9490
lxc file pull u1/tmp/file1 file2
9591
```
9692

97-
You now have the file in your Downloads directory with a new name.
93+
You now have the file in your Downloads directory with a new name.

0 commit comments

Comments
 (0)