7

I recently updated my IDE to Monodevelop 6 using Flatpak, on Ubuntu 16.04 LTS, from an older version 5.

I have an application that interacts with serial ports which is basically a USB/RS232 adapter connecting a device to my computer.

I have no issue accessing USB port (/dev/ttyUSB0) when I debug the application in Monodevelop5. However, the device directory (/dev/) that I have access to, using Monodevelop6 is completely different than the one I have access to in Linux, and there is no ttyUSB0 in that folder.

I believe this is because Flatpak runs the application in sandbox. So, if that is the reason, how can I access to a serial port then?

Thanks.

Afshin
  • 487
  • 6
  • 22

1 Answers1

6

Most likely that's because Flatpak is blocking access to the serial device.

Unfortunately at the moment I don't think there is a way to give access specifically to the serial devices, so you'd need to give access to all:

$ flatpak run --device=all com.xamarin.MonoDevelop

What this does is essentially mount the host's /dev inside the sandbox, so the app has full access to it.

It's a pretty big hole in the sandbox, but sometimes it's needed until all the permission handling stuff gets implemented.

Mathieu Bridon
  • 640
  • 7
  • 11
  • Note that the developer of that flatpak build could alternatively use the `device=all` finish arg in the JSON manifest, which would give that access by default. But that's probably too big a hole in the sandbox to do it by default, though. – Mathieu Bridon Dec 24 '16 at 17:26
  • If you still having the issue with the folder as I've had, you can check out the permission at that folder eg: (in my case using arduino by Flatpak) $ ls -l /dev/ttyACM0 crw-rw----. 1 root dialout 166, 0 Aug 24 20:54 ttyACM0 I granted the permission to "everyone" so *you must be aware about the security's implication doing this*: # chmod 666 ttyACM1 $ ls -l ttyACM0 crw-rw-rw-. 1 root dialout 166, 0 Aug 24 20:54 ttyACM0 In my case it's a folder(/dev/ttyACM1) created by arduino IDE any time I plugin my device to the system. hope it can be useful. – J.Rojas Aug 24 '20 at 22:05