title: Unable to use --screenshot or --print-to-pdf using headless mode of Chromium on Ubuntu desktop
body: <p>I am using the headless version of Chrome and Chromium to take screenshots of given pages.
  It works fine on Windows and Ubuntu server, but not on an Ubuntu Desktop VM.</p>
  <p>I get the error &quot;<strong>Open multiple tabs is only supported when remote debugging is enabled</strong>&quot; on Ubuntu Desktop when I try to take a screenshot (<code>--screenshot</code> flag) or to generate a PDF file (<code>--print-to-pdf</code> flag).</p>
  <p>I could enable remote debugging with the <code>--remote-debugging-port</code> flag, but when it is enabled, you can not use the <code>--screenshot</code> flag or the <code>--print-to-pdf</code> flag.</p>
  <p>Any ideas on how I could use these flags on Ubuntu desktop ?</p>
  <h1>Details</h1>
  <h2>On windows</h2>
  <p><strong>Version</strong> :<br />
  Google Chrome Version 84.0.4147.125</p>
  <p><strong>Command used</strong> :<br />
  <code>&gt; start chrome --headless --screenshot=%CD%\example_sh.png https://example.com/</code></p>
  <p><em>Note: you have to give a path to the screenshot on windows or else it will not create the file, this is why I added <code>%CD%\</code> on Windows only. But this is not the issue here.</em></p>
  <p><strong>Command output</strong> :<br />
  None</p>
  <p><strong>File generated :</strong><br />
  <code>Yes</code></p>
  <h2>On Ubuntu Server</h2>
  <p><strong>Version</strong> :</p>
  <pre><code>$ chromium-browser --version
  Chromium 84.0.4147.105 Built on Ubuntu , running on Ubuntu 18.04
  </code></pre>
  <p><strong>Command used</strong> :<br />
  <code>$ chromium-browser --headless --screenshot=example_sh.png https://example.com/</code></p>
  <p><strong>Command output</strong> :<br />
  <code>[0812/102830.971006:INFO:headless_shell.cc(615)] Written to file example_sh.png.</code></p>
  <p><strong>File generated :</strong><br />
  <code>Yes</code></p>
  <h2>On Ubuntu Desktop</h2>
  <p><strong>Version</strong> :</p>
  <pre><code>$ chromium-browser --version
  Chromium 84.0.4147.105 snap
  </code></pre>
  <p><strong>Command used</strong> :<br />
  <code>$ chromium-browser --headless --screenshot=example_sh.png https://example.com/</code></p>
  <p><strong>Command output</strong> :<br />
  <code>[0812/123941.367535:ERROR:headless_shell.cc(174)] Open multiple tabs is only supported when remote debugging is enabled.</code></p>
  <p><strong>File generated :</strong><br />
  <em><code>No</code></em></p>
  <hr />
  <p>Note that a solution consisting of replacing .deb packages is not what I want.  This could be a good workaround if I were the only one using these flags, but this won't do as a solution, as I'm calling a command using them inside some code that is part of a library that is shared with other people.</p>