nerves.system.shell fails when Docker VirtioFS is enabled
Environment
- Elixir version (
elixir -v):
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.13.3 (compiled with Erlang/OTP 24)
- Nerves environment: (
mix nerves.env --info)
|nerves_bootstrap| Environment Package List
Pkg: nerves_system_br
Vsn: 1.18.6
Type: system_platform
BuildRunner: {nil, []}
Pkg: nerves_system_rpi4
Vsn: 1.18.4
Type: system
BuildRunner: {Nerves.Artifact.BuildRunners.Docker, [make_args: ["source", "all", "legal-info"]]}
Pkg: nerves_toolchain_aarch64_nerves_linux_gnu
Vsn: 1.5.0
Type: toolchain
BuildRunner: {Nerves.Artifact.BuildRunners.Local, []}
Pkg: nerves_toolchain_ctng
Vsn: 1.8.5
Type: toolchain_platform
BuildRunner: {nil, []}
|nerves_bootstrap| Loadpaths Start
Nerves environment
MIX_TARGET: target
MIX_ENV: dev
|nerves_bootstrap| Environment Variable List
target: target
toolchain: /Users/bernhardhackl/.nerves/artifacts/nerves_toolchain_aarch64_nerves_linux_gnu-darwin_x86_64-1.5.0
system: /Users/bernhardhackl/.nerves/artifacts/nerves_system_rpi4-portable-1.18.4
app: .
|nerves_bootstrap| Loadpaths End
- Additional information about your host, target hardware or environment that may help
Docker Desktop 4.7.0 (77141) with VirtioFS enabled
macOS Monterey 12.3 (Intel chipset)
Current behavior
When running mix nerves.system.shell I get the following error.
➜ nerves_system_custom_rpi4 git:(434cae6) ✗ mix nerves.system.shell
==> nerves
stty sane rows 30 cols 187; stty -echo
export PS1=""; export PS2=""
start() {
echo -e "\e[25F\e[0J\e[1;7m
Preparing Nerves Shell \e[0m"
echo -e "\e]0;Nerves Shell\a"
export PS1="\e[1;7m Nerves \e[0;1m \W > \e[0m"
export PS2="\e[1;7m Nerves \e[0;1m \W ..\e[0m"
echo Updating build directory.
echo This will take a while if it is the first time...
/nerves/env/platform/create-build.sh /nerves/env/nerves_system_rpi4/nerves_defconfig /nerves/build >/dev/null
stty echo
}; start
docker: Error response from daemon: error while creating mount source path '/private/tmp/com.apple.launchd.roIUXGKQgd/Listeners': mkdir /private/tmp/com.apple.launchd.roIUXGKQgd/Listeners: operation not supported.
I found this issue that suggests to set SSH_AUTH_SOCK to /run/host-services/ssh-auth.sock.
If I run export SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock before mix nerves.system.shell docker at least seems to start properly.
Now I get the following errors when trying to untar the buildroot. That error should already be fixed in the upcoming Docker release though.
tar: board/olimex/a10_olinuxino/boot.cmd: Cannot open: Permission denied
tar: board/olimex/a10_olinuxino/genimage.cfg: Cannot open: Permission denied
tar: board/olimex/a10_olinuxino/post-build.sh: Cannot open: Permission denied
tar: board/solidrun/clearfog_gt_8k/genimage.cfg: Cannot open: Permission denied
tar: board/solidrun/clearfog_gt_8k/post-build-mainline.sh: Cannot open: Permission denied
tar: board/solidrun/clearfog_gt_8k/uboot-fragment.config: Cannot open: Permission denied
tar: boot/barebox/barebox-aux/barebox-aux.hash: Cannot open: Permission denied
tar: boot/barebox/barebox/barebox.hash: Cannot open: Permission denied
tar: package/bluez5_utils-headers/bluez5_utils-headers.hash: Cannot open: Permission denied
tar: package/busybox/S02sysctl: Cannot open: Permission denied
tar: package/fftw/fftw-double/fftw-double.hash: Cannot open: Permission denied
tar: package/fftw/fftw-long-double/fftw-long-double.hash: Cannot open: Permission denied
tar: package/fftw/fftw-quad/fftw-quad.hash: Cannot open: Permission denied
[...]
If I disable VirtioFS everything works as expected though :)
Expected behavior
To support Docker VirtioFS out of the box :)
Thanks for the really descriptive report! This is really outside my expertise, so I'm hoping for some help. If no one posts that they can help in the next couple weeks, I'll see what I can figure out.