timower/rM-docker

Help on using this

Closed this issue · 7 comments

Hi! I'd like to use the X11 forwarding feature but I'm getting this:

# docker buildx build -t rm-docker:plain https://github.com/timower/rM-docker.git
# docker run --rm -it \
  --volume /tmp/.X11-unix:/tmp/.X11-unix \
  --volume $HOME/.Xauthority:/root/.Xauthority \
  --env DISPLAY \
  --hostname "$(hostnamectl hostname)" \
  --publish 2222:22 \
  -it rm-docker:plain
+ run_vm.sh -serial null -daemonize
Staring QEMU...
qemu-system-arm: warning: nic imx.enet.1 has no peer
+ ssh -o StrictHostKeyChecking=no root@localhost true
+ sleep 5
+ ssh -o StrictHostKeyChecking=no root@localhost ./rm2fb-forward
Socket unlink: No such file or directory
+ ssh -o StrictHostKeyChecking=no root@localhost LD_PRELOAD=/home/root/librm2fb_client.so /usr/bin/xochitl
+ rm2fb-emu 127.0.0.1 8888
Authorization required, but no authorization protocol specified

error: XDG_RUNTIME_DIR is invalid or not set in the environment.
uintput: No such file or directory
Error making uinput device
GC16Fast Update: { { 0, 0 }, { 1403, 1871 } }
Hooking 368872 - 373952 with 3063564044
Hooking 344056 with 3063560928
Hooking 732936 with 3063564060
debug: "2023-07-18T12:39:14Z tags/releases/3.5.2.1807-device+3.5.2.753-clients 17579f6"
debug: we're running on an epaper device
12:52:37.064 default                  QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
12:52:37.094 qt.qpa.input             evdevtouch: Using device discovery
Registering exit handlers
REPLACING THE IMAGE with shared memory
HOOK: create threads called
12:52:37.798 rm.battery               Unable to find battery information in /sys/class/power_supply/max77818_battery
12:52:37.807 rm.filesystem            open( QFlags(0x1) )  "/sys/devices/soc0/usbphynop2/uevent"  failed:  "No such file or directory"
12:52:37.813 rm.filesystem            file '/sys/devices/soc0/usbphynop2/uevent' could not be opened (readFile /__w/xochitl/xochitl/src/filesystem/src/filesystem.cpp:36)
12:52:37.815 rm.filesystem            open( QFlags(0x1) )  "/sys/class/power_supply/max77818_battery/voltage_now"  failed:  "No such file or directory"
12:52:37.816 rm.filesystem            file '/sys/class/power_supply/max77818_battery/voltage_now' could not be opened (readFile /__w/xochitl/xochitl/src/filesystem/src/filesystem.cpp:36)
12:52:37.818 rm.filesystem            open( QFlags(0x1) )  "/sys/class/power_supply/max77818_battery/current_now"  failed:  "No such file or directory"
12:52:37.818 rm.filesystem            file '/sys/class/power_supply/max77818_battery/current_now' could not be opened (readFile /__w/xochitl/xochitl/src/filesystem/src/filesystem.cpp:36)
12:52:37.819 rm.filesystem            open( QFlags(0x1) )  "/sys/class/power_supply/max77818_battery/charge_now"  failed:  "No such file or directory"
12:52:37.820 rm.filesystem            file '/sys/class/power_supply/max77818_battery/charge_now' could not be opened (readFile /__w/xochitl/xochitl/src/filesystem/src/filesystem.cpp:36)
12:52:37.821 rm.filesystem            open( QFlags(0x1) )  "/sys/class/power_supply/max77818_battery/capacity"  failed:  "No such file or directory"
12:52:37.822 rm.filesystem            file '/sys/class/power_supply/max77818_battery/capacity' could not be opened (readFile /__w/xochitl/xochitl/src/filesystem/src/filesystem.cpp:36)
12:52:37.823 rm.battery               Unable to parse battery level from battery file
12:52:37.850 rm.filesystem            open( QFlags(0x1) )  "/home/root/.config/remarkable/xochitl.conf"  failed:  "No such file or directory"
12:52:37.851 rm.filesystem            open( QFlags(0x1) )  "/home/root/.config/remarkable/xochitl.conf"  failed:  "No such file or directory"
12:52:37.855 rm.filesystem            open( QFlags(0x1) )  "/dev/mmcblk2boot1"  failed:  "No such file or directory"
12:52:37.856 default                  Failed to read serial number
12:52:37.857 rm.filesystem            open( QFlags(0x1) )  "/sys/fsl_otp/HW_OCOTP_TESTER0"  failed:  "No such file or directory"
12:52:37.857 default                  Failed to open file "/sys/fsl_otp/HW_OCOTP_TESTER0"
12:52:37.859 rm.filesystem            open( QFlags(0x1) )  "/sys/fsl_otp/HW_OCOTP_TESTER1"  failed:  "No such file or directory"
12:52:37.859 default                  Failed to open file "/sys/fsl_otp/HW_OCOTP_TESTER1"
12:52:37.864 rm.deviceinfo            Unable to get a real device id. Using a generated one: "4032c561-f8c6-48e3-a9a6-749ec911ae46"
12:52:37.878 rm.filesystem            open( QFlags(0x1) )  "/dev/mmcblk2boot1"  failed:  "No such file or directory"
12:52:37.878 rm.deviceinfo            Failed to open serial number partition file
12:52:37.882 rm.deviceinfo            Zero or more than one phy dir in /sys/class/ieee80211/: 
12:52:38.111 default                  Lock in temp location
12:52:38.187 rm.filesystem            open( QFlags(0x1) )  "/home/root/.config/remarkable/xochitl.conf"  failed:  "No such file or directory"
12:52:38.188 rm.filesystem            open( QFlags(0x1) )  "/home/root/.config/remarkable/xochitl.conf"  failed:  "No such file or directory"
12:52:38.192 rm.filesystem            open( QFlags(0x1) )  "/dev/mmcblk2boot1"  failed:  "No such file or directory"
12:52:38.193 rm.deviceinfo            Failed to open serial number partition file
12:52:38.194 rm.deviceinfo            Zero or more than one phy dir in /sys/class/ieee80211/: 
12:52:38.212 rm.network.settings      Forcefully setting LibraryExplorer to true on boot, happy bug testing and please don't turn me off, we are going to try to ship this next release! xoxo
12:52:38.884 rm.wifi                  Failed to get interface flags: No such device
12:52:38.984 rm.digitizer             Unable to discover correct device
12:52:39.082 rm.network.usertoken     Invalid UserToken : "" (userToken2Json /__w/xochitl/xochitl/src/network/src/usertoken.cpp:33)
12:52:39.084 rm.network.usertoken     Could not parse UserToken as Json object (parseTimeinfo /__w/xochitl/xochitl/src/network/src/usertoken.cpp:94)
12:52:39.245 rm.batterymanager        set sleep delay timer to 12000 (setSyncBeforeSleep /__w/xochitl/xochitl/src/deviceinfo/src/batterymanager.cpp:109)
Got msg: { { 0, 0; 1403, 1871 }, wave: 2 flags: 1 }
Read: 5256576 / 5256576
GC16Fast Update: { { 0, 0 }, { 1403, 1871 } }
Mem: 0xb65fe000
Waiting for connection on port 8888
SWTCON :p!
Goal: 5256576 written: 5256576
UPDATE { { 0, 0; 1403, 1871 }, wave: 2 flags: 1 }: 1
Got msg: { { 576, 1063; 825, 1072 }, wave: 0 flags: 4 }
Read: 5000 / 5000
DU Update: { { 576, 1063 }, { 825, 1072 } }
Got msg: { { 576, 999; 825, 1062 }, wave: 2 flags: 4 }
Read: 32000 / 32000
GC16Fast Update: { { 576, 999 }, { 825, 1062 } }
Got msg: { { 576, 1063; 825, 1072 }, wave: 0 flags: 4 }
Read: 5000 / 5000
DU Update: { { 576, 1063 }, { 825, 1072 } }
Got msg: { { 576, 1063; 825, 1072 }, wave: 0 flags: 4 }
... snip ...
Goal: 5000 written: 5000
Goal: 32000 written: 32000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
Goal: 5000 written: 5000
... snip ...
UPDATE { { 0, 0; 1403, 1871 }, wave: 2 flags: 0 }: 1
Read: 5256576 / 5256576
GC16Fast Update: { { 0, 0 }, { 1403, 1871 } }
12:52:55.653 rm.wifi                  No interface to scan
12:52:55.654 rm.filesystem            open( QFlags(0x1) )  "/sys/class/power_supply/max77818_battery/voltage_now"  failed:  "No such file or directory"
12:52:55.655 rm.filesystem            file '/sys/class/power_supply/max77818_battery/voltage_now' could not be opened (readFile /__w/xochitl/xochitl/src/filesystem/src/filesystem.cpp:36)
12:52:55.657 rm.filesystem            open( QFlags(0x1) )  "/sys/class/power_supply/max77818_battery/current_now"  failed:  "No such file or directory"
12:52:55.657 rm.filesystem            file '/sys/class/power_supply/max77818_battery/current_now' could not be opened (readFile /__w/xochitl/xochitl/src/filesystem/src/filesystem.cpp:36)
12:52:55.658 rm.filesystem            open( QFlags(0x1) )  "/sys/class/power_supply/max77818_battery/charge_now"  failed:  "No such file or directory"
12:52:55.658 rm.filesystem            file '/sys/class/power_supply/max77818_battery/charge_now' could not be opened (readFile /__w/xochitl/xochitl/src/filesystem/src/filesystem.cpp:36)
12:52:55.659 rm.filesystem            open( QFlags(0x1) )  "/sys/class/power_supply/max77818_battery/capacity"  failed:  "No such file or directory"
12:52:55.660 rm.filesystem            file '/sys/class/power_supply/max77818_battery/capacity' could not be opened (readFile /__w/xochitl/xochitl/src/filesystem/src/filesystem.cpp:36)
12:52:55.660 rm.battery               Unable to parse battery level from battery file
12:52:55.671 rm.stp.network           Error on requesting integrations with "" (operator() /__w/xochitl/xochitl/src/syncthirdparty/src/network.cpp:163)
12:52:55.672 rm.stp.network              with error OperationCanceledError (operator() /__w/xochitl/xochitl/src/syncthirdparty/src/network.cpp:164)
12:52:55.672 rm.stp.network              with body "" (operator() /__w/xochitl/xochitl/src/syncthirdparty/src/network.cpp:169)
12:52:55.674 rm.updates               Request finished. Was dispatched at: 2023-10-04T12:52:39.179
12:52:55.676 rm.updates               Network error: QNetworkReply::OperationCanceledError Payload: ""
12:52:56.811 default                  Model size of -1 is less than 0
... ^C ...

I'm on ubuntu jammy (hmm might be on Wayland then)

# docker version
Client: Docker Engine - Community
 Version:           24.0.6
 API version:       1.43
 Go version:        go1.20.7
 Git commit:        ed223bc
 Built:             Mon Sep  4 12:31:44 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.6
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       1a79695
  Built:            Mon Sep  4 12:31:44 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.24
  GitCommit:        61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
 runc:
  Version:          1.1.9
  GitCommit:        v1.1.9-0-gccaecfc
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
Eeems commented

I'm trying this under wayland, and I got a little further. I had to do the following to get it to get past Authorization required, but no authorization protocol specified : xhost + local:, but now it's stopping immediately with the following error:

Staring QEMU...
qemu-system-arm: warning: nic imx.enet.1 has no peer
+ ssh -o StrictHostKeyChecking=no root@localhost true
+ sleep 5
+ ssh -o StrictHostKeyChecking=no root@localhost ./rm2fb-forward
Socket unlink: No such file or directory
+ ssh -o StrictHostKeyChecking=no root@localhost LD_PRELOAD=/home/root/librm2fb_client.so /usr/bin/xochitl
+ rm2fb-emu 127.0.0.1 8888
uintput: No such file or directory
Error making uinput device
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
action: null
terminate called after throwing an instance of 'std::out_of_range'
  what():  unordered_map::at
Reading input: Invalid argument
Mem: 0xb663a000
Added uintput device
Waiting for connection on port 8888
SWTCON :p!
Connect: Connection refused
Eeems commented

Upon poking at things by trying to run the steps in run_xochitl.sh manually, the std::out_of_range error seems to be from rm2fb-emu. The final Connect: Connection refused is from LD_PRELOAD=/home/root/librm2fb_client.so /usr/bin/xochitl failing to connect to rm2fb-emu.

Yeah, rm2fb-emu is probably not up to date yet for use in docker.
Currently it tries to use uinput for forwarding inputs (incorrectly). Should be an easy fix.

@fenollp I don't immediately see an error in your log. Some of the things xochitl complains about are expected, but it should still just boot up.

Eeems commented

@fenollp I don't immediately see an error in your log. Some of the things xochitl complains about are expected, but it should still just boot up.

It's probably just that x11 forwarding isn't setup properly, thus the Authorization required, but no authorization protocol specified error. xhost + local: should fix it.

af65f0b should help with the uinput issue. hopefully also resolving the out_of_range issue.

Eeems commented

That fixed it for me! @fenollp how about you?

docker buildx build -t rm-docker:plain https://github.com/timower/rM-docker.git
xhost + local:
docker run --rm -it   --volume /tmp/.X11-unix:/tmp/.X11-unix   --volume $HOME/.Xauthority:/root/.Xauthority   --env DISPLAY   --hostname "$(hostnamectl hostname)"   --publish 2222:22   -it rm-docker:plain

works beautifully! Thanks guys this is amazing!