title: Chrome closes while/before completely downloading file using Selenium
body: <p>I have confirmed that my code works on Windows and was working on Arch a few months back (deleted my Arch VM, so can't test right now).  My original code selects data and downloads a file from a site that requires login credentials, so cant paste code referencing those links.  Code worked fine on other OSes, but I cant get it to work in my Ubuntu VM that I just created. I tested on the python.org website to download the latest python .tgz file and having the same results, works on Windows, but not on the VM.  Once the link is clicked, it begins to download the file.  After the download begins, Chrome closes within a second or so and kills the download leaving it partially downloaded and unusable.  Very small files seem to complete downloading before Chrome exits, but not larger ones.  No errors are shown and the code completes successfully in VS Code.</p>
  <p>I also tested having the Chrome Driver open the website and I would manually click the link.  Chrome would shutdown and partially download the file the same as having my code perform the actions.</p>
  <p>Has anyone else experienced this before?  Is it an issue with Ubuntu?</p>
  <p>Here is my current software/packages installed -
  selenium 4.1.0,
  webdriver_manager 3.5.2,
  VS Code 1.64.2,
  Python 3.10.2,
  Ubuntu 20.04.3 LTS on VMWare</p>
  <p>Here is the code</p>
  <pre><code>from selenium import webdriver
  from webdriver_manager.chrome import ChromeDriverManager
  from selenium.webdriver.chrome.service import Service
  
  py_website = 'https://www.python.org/downloads/release/python-3102/'
  options = webdriver.ChromeOptions()
  options.add_experimental_option(&quot;detach&quot;, True)
  driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), chrome_options=options)
  driver.get(py_website)
  
  driver.find_element_by_xpath(&quot;//a[@href='https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz']&quot;).click()
  </code></pre>
  <p><em><strong>Edit 2/16/2022 12:50pm CST</strong></em></p>
  <p>Tested on a new Mint VM and had to add the following code for Chrome to launch.    Seems to be working on Mint, but Ubuntu still having the same issue with the added arguments.</p>
  <pre><code>options.add_argument('--no-sandbox')
  options.add_argument('--disable-dev-shm-usage')
  </code></pre>
  <p>With out this code, I received the following error on Mint.</p>
  <pre><code>WebDriverException: Message: unknown error: Chrome failed to start: crashed.
    (unknown error: DevToolsActivePort file doesn't exist)
    (The process started from chrome location /opt/google/chrome/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  </code></pre>
  <p><em><strong>Edit 2/16/2022 21:30pm CST</strong></em>
  Tried using PyCharm and it is working flawlessly.  Must be something with my settings in VS Code.</p>