Comment 3 for bug 1849371

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote : Re: [snap] Cannot run headless chromium as user www-data

Thanks for the suggestion, and you're right, your summary is better.

I tried the following (with various permutations).

sudo su -l -s /bin/bash www-data
mkdir /tmp/chromium-home

HOME=/tmp/chromium-home /usr/bin/timeout 60 chromium-browser --no-sandbox --headless --disable-gpu --window-size=2048,1448 --screenshot='/tmp/dummy.pdf' --user-data-dir=/tmp/chromium-home 'http://localhost/...'

and this complains in a different way:
  Sorry, home directories outside of /home are not currently supported.
  See https://forum.snapcraft.io/t/11209 for details.

Before the snap change was made, chromium would run headless without (I think) actually needing any writeable directory at all.