50

Is there any way I can launch a new instance of Google Chrome from the command line? I'm not referring to opening a new window - I want a new instance. Here's why:

Suppose I open Chrome and navigate to a page somewhere. Then I SSH into the same account from somewhere else. When I run:

google-chrome

...all I get is a new tab in the existing window. This is absolutely useless when I'm connected via SSH.

How can I launch a separate instance of Chrome that runs in the same account, but is usable with SSH?

2
  • 1
    Incognito mode? google-chrome --incognito ? Apr 16, 2011 at 5:08
  • @Kaustubh doesnt help
    – trampster
    Apr 16, 2011 at 6:03

3 Answers 3

56

This is a known bug. A workaround is to pass the argument --user-data-dir=$(mktemp -d) (or you can use any temporary or empty directory) to start a new session.

6
  • 3
    Thanks! I was looking for details on how to do that. I also posted it back at superuser.com/a/457045/132608, which was the first StackExchange variant of this question I found.
    – justis
    Aug 3, 2012 at 2:01
  • 7
    This no longer works with recent versions of Chrome, but you can effectively start with a "blank slate" new account by specifying a temporary or empty directory, e.g. chromium-browser --user-data-dir=/tmp
    – Dan
    Dec 3, 2015 at 22:16
  • 1
    And still a bug, 9 years later :)
    – Vix
    Jan 9, 2020 at 20:01
  • And still 11 years later.... Jul 4 at 9:58
  • 1
    @MahmoudMousaHamad, I don't think Chrome can concurrently support two entirely independent instances which are manipulating the same user's session data. In my opinion, that would be a lot of work to implement, and the use case seems pretty unclear… there's little point in keeping separate instances if they're going to access all the same data. As I take it, this question is about starting another wholly separate/isolated instance of Chrome.
    – Dan
    Sep 2 at 19:31
13

I do this

cd ~/.config/google-chrome
mkdir /tmp/chrome2
find . -print | cpio -mpdv /tmp/chrome2 # there was no cp -R in my day!
rm -fr /tmp/chrome2/Singleton*
rm -fr /tmp/chrome2/Session* 
google-chrome --user-data-dir=/tmp/chrome2/

Instead of the cpio/rm lines I'm using this now

rsync -av --delete --exclude=/Singleton* --exclude=/Session* ~/.config/google-chrome/ /tmp/chrome2/
1
  • 1
    This still works as of 2019. There is no Session* files and I just made a copy of the directory to ~/.config/google-chrome-2 manually and deleted the Singleton files.. Then an executable bash file in your path named google-chrome-2 containing google-chrome --user-data-dir=/home/<username>/.config/google-chrome-2 and now you have a way to set up a launcher to alt instance. I needed this to be able to cast to two different devices at the same time.
    – DKebler
    Sep 1, 2019 at 16:54
-1

Use --new-window parameter.

Like: 

google-chrome --new-window www.google.com
4
  • google.chrome ... not chrome ... Mar 18, 2016 at 10:24
  • @MostafaAhangarha thanks, I changed it to google-chrome
    – Kim
    Mar 21, 2016 at 8:02
  • 17
    Read the question: I'm not referring to opening a new window - I want a new instance. Mar 21, 2016 at 8:29
  • 1
    this does not work
    – Tropilio
    Mar 8, 2019 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.