26

On Windows, Google Chrome has the option to create a shortcut on the desktop for each Chrome user. For example, I have my personal Google Account and I also have my company Google Account. So, I setup Google Chrome with two users and I created two shortcuts on desktop for each user.

On Ubuntu, I also created two users and I setup my accounts. But I can't create two "shortcuts" on launcher for each user. Is that possible? Today, on Ubuntu, I have to change between the users directly on chrome. I am not complaining about this, but I am used to have more chrome shortcuts.

I can also get used in Ubuntu is this is not possible.

My versions:

  • Ubuntu 14.04 LTS
  • Chrome 35.0.1916.153
3
  • 1
    This page may have to command you need. If so, you you can then edit the .desktop files. peter.sh/experiments/chromium-command-line-switches
    – Tim
    Jul 8, 2014 at 12:44
  • IMHO, you should complain, and that loudly, at the Chrome support forums. Programs can and do create desktop shortcuts, so it is odd that Chrome doesn't ask.
    – muru
    Jul 8, 2014 at 21:36
  • Another easy option is installing chrome beta channel for personal account (sudo apt install google-chrome-beta). Should be relatively safe to use.
    – Madis
    Apr 5, 2020 at 16:54

7 Answers 7

26

It is quite simple to do this in Windows but not the same in Ubuntu.

For Ubuntu, I found two ways. Personally I recommend method 2 because you don't need to install anything. It also allows you to access the second profile from "Activities" (Ubuntu) without using any commands.

Please note that either way you choose, you have to know YOUR_PROFILE_NAME.

YOUR_PROFILE_NAME is normally Default for the first profile you created. The second profile is named Profile\ 1. The third is Profile\ 2, and so on (You can also give custom names for profiles). You can identify which profile is currently loaded by opening chrome://version inside Chrome and looking at Profile Path.

  1. Follow Filippo's answer but change the Command to:

    google-chrome --profile-directory=YOUR_PROFILE_NAME  
    
  2. Put this code in any text editor and name it anything .desktop.

    #!/usr/bin/env xdg-open
    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Icon[en_US]=google-chrome
    Exec=google-chrome --profile-directory=YOUR_PROFILE_NAME
    Name[en_US]=Chrome-YOUR_PROFILE_NAME
    Name=Chrome-YOUR_PROFILE_NAME
    Icon=google-chrome
    

    Right-click the file. Open "Properties". Go to "Permissions" tab. Click Allow executing file as program.

    You can keep the .desktop file in ~/.local/share/applications/ so that your Application Launcher can locate it easily. Now simply press super and search for Chrome-YOUR_PROFILE_NAME (value given for Name), you will find the second profile appearing in the search results!

2
  • 2
    Thanks for the good answer, I suppose this still work year and a half later. How could one figure out what the profiles are named, exactly? Are there any available commands or paths to check? And if so, please add this to the answer as it would be super handy to know this. Thank you
    – denNorske
    Nov 21, 2018 at 9:48
  • @Denny cat ~/.config/google-chrome/Local\ State | jq .profile should list all the profiles. If you have more than one, it should be "Default", "Profile 1", "Profile 2" . . . and so on and so forth.
    – mchid
    Feb 23, 2021 at 18:43
7

This is what I did to achieve the same thing:

sudo apt-get install gnome-panel
gnome-desktop-item-edit ~/Desktop/ --create-new

to create the first "Application Launcher" with the Command:

google-chrome --user-data-dir=/home/XXXXX/.config/google-chrome/Profile\ 1

Then drag the icon created from the desktop to the launcher. Repeat for the Profile 2.

2
  • 1
    I did exactly what you said. The shortcut is created, but when I open Google Chrome is look like a new installation asking if I want to set Chrome as default browser. My command: google-chrome --user-data-dir=/home/rgiaviti/.config/google-chrome/Profile\ 1. I double checked the path and it's OK.
    – humungs
    Jul 14, 2014 at 1:31
  • 2
    @RicardoGiaviti don't use --user-data-dir=... instead use --profile-directory=Profile\ 1 or --profile-directory=Default
    – Marecky
    May 9, 2017 at 20:27
4

All the other answers have a caveat: the shortcut will open tabs or new windows and group them with the official Google Chrome shortcut.

I wanted to make the new shortcut to open windows in its own icon, so I can place both icons in my dock and easily switch between the different Chromes.

I discovered that you basically need to use the flags --class and --user-data-dir to Chrome's executable.

So I wrote a script to make this automatically and if you want to try (don't worry, it won't perform any action before you confirm -- unless you use --force), just run:

bash -c "$(curl -fsSL "https://raw.githubusercontent.com/felipecassiors/dotfiles/master/scripts/create_alternative_chrome_shortcut.sh")"

If you want to know more about it, take a look here.

The only caveat is that since it uses --user-data-dir instead of --profile-directory, the new Chrome instance will act like a fresh new. This is needed because of this bug.

In the end, you'll end up with something like this:

[Check GIF here.

4
  • Hi, it doesn't appear to work. Nov 26, 2020 at 9:18
  • @AnshumanKumar I just tested here and it's working, Pop!_OS 20.04.
    – felipecrs
    Nov 26, 2020 at 20:25
  • Exactly what I was looking for, thank you! Although you shouldn't ask people to just run a bash script from the internet. Yours is harmless, but others might be malicious. Apr 6, 2021 at 9:31
  • Solution is almost perfect but I have one issue. Right now all commands that would open a browser (i.e. gcloud auth login) open tab in the default Chrome without user-data-dir... is there a way to somehow adjust it? Jun 7, 2022 at 6:24
2

Edit the main shortcut file:

/usr/share/applications/google-chrome.desktop

The section [Desktop Entry] find the option Actions= and add your new action (use semi-colon to separate and at the end):

Actions=new-window;new-private-window;new-window-myprofile;

Create a new section with the same name given on the action above. The Name is the submenu item that will be shown.

The "Profile 1" must be the same as you get on the chrome://version/ (use it on the URL using the desired profile to configure) in the line Profile Path.

[Desktop Action new-window-myprofile]
Name=New Window as MyProfile
Exec=/usr/bin/google-chrome-stable %U --profile-directory="Profile 1"

enter image description here

On my example "as Zoop" is the Profile 1 and "as Renan" is the Profile 2

4
  • 2
    This works, but the changes will be gone when the package updates.
    – Seff
    Feb 13, 2021 at 12:21
  • @Seff Add a copy of this .desktop to ~/.local/share/applications/ and edit this copy.
    – Jander
    Feb 15, 2022 at 17:06
  • @Jander: If I do that, then windows will open under the "standard" google .desktop file (under /usr) and not under my new .desktop file in ~/.local. Feb 17, 2023 at 14:11
  • I couldn't test, but try change the Name= attribute...
    – Jander
    Feb 20, 2023 at 20:47
0

Here's how I did it in Linux Mint, which is based on Ubuntu:

Install Chrome by whatever guide you'd like to follow. If it's already installed, that's fine.

Once Chrome is installed, copy the Chrome launcher icon to the desktop by right-clicking the Chrome icon in the 'start' menu and then selecting 'Add to Desktop"

Since you want at least two Chrome profiles that can run at the same time, duplicate the new desktop launcher icon again to create two launchers. Do this by simply right clicking the new Chrome launcher/icon on the desktop. Right click and click copy. Then moving your mouse over to a blank area of the desktop and click paste. You now have at least two Crhome icons on your desktop.

Create two folders/directories in mint. I created. /home/mint/Sync/1/ /home/mint/Sync/2/

Right click on the first icon and click Properties Edit the launcher tab to say:

/usr/bin/google-chrome-stable --user-data-dir=/home/mint/Sync/.config/google-chrome/Profile\ 1

Repeat the process and edit the second icon's launcher tab to say:

/usr/bin/google-chrome-stable --user-data-dir=/home/mint/Sync/.config/google-chrome/Profile\ 2

You'll want to rename each launcher/icon so you know which profile you're going to open up when you double click on it. Since one is for work and one is for home, I named them, very creatively, Chrome Work and Chrome Home. I renamed them by right clicking on each launcher icon and then clicking 'Rename'. You can also do this in the General tab on Mint when you are in there creating your profile on the Launcher tab.

One person replied that it looked like a whole new fresh install of Chrome, because he was missing his customizations (American spelling), I imagine. It seemed to confuse him, but that is because the original profile was stored in the default location and now the new profile folder/directory is blank. Since I already had Chrome installed, and a profile was saved to the default location (/home/mint/.config/google-chrome/Default), I deleted everything out of the default location. I then created my separate profile folder location and created the corresponding profiles as laid out above. Then I signed into each with different accounts.

This is my preferred method of using multiple profiles on Chrome, because I have to do no account switching, not adding of accounts. Each operate as if they were separately installed instances of Chrome - like you had Chrome on your system twice. You can also do this with portable versions of Chrome on Windows, Linux and I bet on on Mac. Problem is, you can't easily update a portable version of Chrome, at least not the ones I've used.

There is a very similar method to create multiple profiles on Windows. I found it only once years ago and I thank goodness I saved my notes. It also involves setting up multiple launcher icons on the desktop, or wherever you'd like, going into the properties on those icons and directing Chrome to put the profile information in locations you specify. The '--user-data-dir=' in the run command is the same in both Windows and Linux. I can't speak to Mac, but since BSD (Mac) and Linux are far more similar than not, in my uneducated opinion, I wager it works the same.

I really hope that helps, because I hate combing through forums and not finding what I want. I hope I've been thorough enough, because I hate even worse finding what I need, and the person who posted gives maybe three words, and the first always starts with 'just'.

0

Create your chrome profile folder. (You may also place them elsewhere, and ln -s them to here)

cd ~/.config/google-chrome
mkdir chrome-foo

create a start file in /usr/bin:

sudo touch  /usr/bin/chrome-foo
sudo pluma  /usr/bin/chrome-foo

in pluma (or geany or nano or vi...)

    #!/usr/bin/env bash
    google-chrome --profile-directory=chrome-foo  &  disown
    

(personally, I'd chuck in a --disable-session-crashed-bubble, too) and enable it for execution by regular users:

sudo chmod +x /usr/bin/chrome-foo

Now you can create a link to the start file:

enter image description here

You can click on the icon to change that.

... or also conveniently call the different flavors from command line:

$> chrome-foo

I personally have chrome-priv, chrome-work, chrome-dev and chrome-family to have the proper bookmarks and logins seperate, etc.

0
  1. Create a data directory for profile.

Example: Create a directory called in-softs in the home directory. Create a directory called uv in the that in-softs directory.

  1. Create a new file named MyChrome.desktop on the desktop and copy following content into that file.
[Desktop Entry]
Version=1.0
Name=google-chrome
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Web Browser
# Gnome and KDE 3 uses Comment.
Comment=Access the Internet
Exec=/usr/bin/google-chrome-stable %U --user-data-dir=/home/yuvraj/in-softs/chrome-uv
StartupNotify=true
Terminal=false
Icon=help-about
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/ftp;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=New Window
Exec=/usr/bin/google-chrome-stable --user-data-dir=/home/yuvraj/in-softs/chrome-uv

[Desktop Action new-private-window]
Name=New Incognito Window
Exec=/usr/bin/google-chrome-stable --incognito --user-data-dir=/home/yuvraj/in-softs/chrome-uv

  1. Save the file and right click on it’s icon and make it executable. It would create a desktop shortcut with name uv

We can create multiple user data profiles using this approach.

Note: : This approach is tested on Ubuntu 20.04 LTS

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .