Mounting Project Crostini Filesystems on ChromeOS

Mounting Project Crostini Filesystems on ChromeOS

I have been on a roll with posting several guides over the past 24 hours with how to make use of Project Crostini. One problem I have noticed with Project Crostini filesystems is that there is that they are not shared with ChromeOS, to make matters worse, your ChromeOS Filesystem is also not shared with the Project Crostini VM. Fortunately there is a simple workaround.

By now, you should know how to create and start a virtual machine, if not – please take a few moments to read the previous two blog posts:

  • https://kmyers.me/blog/chromeos/getting-started-with-chromeos-containers-via-project-crostini/
  • https://kmyers.me/blog/chromeos/getting-android-studio-running-on-chromeos-containers-via-project-crostini/

Setting up a SSH Server in your VM

You will need to be in your virtual machine and at the <username>@stretch shell prompt before you proceed with the steps below.

Set A Password

When you create a virtual machine, your account is created without a password. As we will be accessing our virtual machine over a SSH server, we will need to setup a password. This is done by simply running “sudo passwd <username>” – replacing <username> with your Virtual Machine Username. You will then be prompted to enter a password twice to complete this step.

sudo passwd kmyers

Installing OpenSSH Server

The next step will involve setting up a SSH Server on your VM. You can do this by running the following command

sudo apt-get install openssh-server

Getting your Virtual Machine’s IP Address

We now need to find the IP Address of our Virtual Machine. This can be ran with the command “ip addr”.

kmyers@stretch:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
valid_lft forever preferred_lft forever
4: eth0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:24:5b:1c brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 100.115.92.206/28 brd 100.115.92.207 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::216:3eff:fe24:5b1c/64 scope link 
valid_lft forever preferred_lft forever

The IP Address in my case is 100.115.92.206. It is possible this may change in the future so be prepared to repeat this step as needed.

Setting up the SFTP Filesystem

In order to mount the filesystem over ssh, we will need to install the free ChromeOS SSH Client from the Chrome Web Store. Once this is installed, launch the extension from your application launcher and follow the steps below

  • Select [New Connection]
  • enter “<username>@<ipaddress> in the “username@hostname or freeform text” box. Replace <username> with your Virtual Machine Username and replace <ipaddress> with the IP address you gathered earlier in this guide. In my case, I would enter “kmyers@100.115.92.206” in that box.
  • Press tab and a few of the other fields will autopopulate
  • Click on “SFTP Mount”
  • You will then be prompted to enter the password that was created earlier in this guide

If everything was successful, you will see a new drive listed in your ChromeOS File Manager. This mountpoint is /home/username/ within your Virtual Machine (/home/kmyers/ in my case or ~/). You can now copy files in and out of your virtual machine via the ChromeOS File Manager

Closing Notes

  • Your virtual machine and container needs to be running and started in order to access the filesystem
  • You can only mount the virtual machine on the Chromebook it is running as the SSH server us listening on a private IP address.
  • You will have full read-write access to the home directory from within ChromeOS, this includes the ability to delete or edit content.
Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Comment