How to get Google Music Manager Beta to remember your password in Ubuntu

November 6th 2011

Over the past few weeks, I've been becoming increasingly annoyed how the Google Music Manager Beta for Ubuntu fails to remember my password.

Like many of you out there I utilise the Google 2 Step Authentication for my account. Every time I launched the Google Music Beta application on Ubuntu I had to then log into my Google Account and recreate an application specific password for Google Music Manager Beta.

So, today I decided enough was enough and started playing around with various flags to start the application.

You guessed it, I found a way!

Follow these simple steps:

Launch a terminal window

Text Snippet:
cd /usr/share/applications

In here there is a small file called 'google-musicmanager.desktop' That's exactly what we need!

We need to edit that file like so:

Text Snippet:
sudo nano google-musicmanager.desktop

Once the nano screen opens, you'll see this:

Text Snippet:
[Desktop Entry]
Version=1.0
Name=Google Music Manager
# Only KDE 4 seems to use GenericName.
GenericName=Google Music Manager
# Gnome and KDE 3 uses Comment.
Comment=Upload to Google Music
Exec=/opt/google/musicmanager/google-musicmanager
Terminal=false
Icon=google-musicmanager
Type=Application
Categories=AudioVideo;Audio;Network;

Does it seem complicated? Well, it's not. We need to add a flag onto the line starting with Exec=

Text Snippet:
Exec=/opt/google/musicmanager/google-musicmanager -p XXXXXXXXXXXXXXX

Replace the XXXXXXXXXXXXXXX with your Google Account password or Google Application Specific Password for the Google Music Manager Beta application

Your final file should look like this:

Text Snippet:
[Desktop Entry]
Version=1.0
Name=Google Music Manager
# Only KDE 4 seems to use GenericName.
GenericName=Google Music Manager
# Gnome and KDE 3 uses Comment.
Comment=Upload to Google Music
Exec=/opt/google/musicmanager/google-musicmanager -p MyPasswordIsNotThis
Terminal=false
Icon=google-musicmanager
Type=Application
Categories=AudioVideo;Audio;Network;

Now that's complete, just click Ctrl+X, then click Y and then Enter.

You've just saved the shortcut. Now, if Google Music Manager Beta is running, exit the application. Try to relaunch it by selecting it from your application menu.

Voila! There you have it. Automatically logging you in just as we wanted it!

Did this help you? Is so, let me know in the comments...

Tags: Ubuntu 11.04 Google Music Manager Beta, Remember Password Google Music Manager Beta, Google Music Linux remember password

phunehehe commented on Nov 19th 2011

Woa you just made my day. This "bug" definitely needs to be fix!

Roger commented on Nov 19th 2011

I agree entirely. It's something so trivial, why didn't Google fix it prior to release I'll never know!

Nuno commented on Dec 3rd 2011

thanks a bunch for your workaround.
however, i do have some issues with keeping the pwd in plain text form in a file somewhere in desktop. sure hope google gets a fix for this one.
do you have any thoughts on that? is there a way to change the exec line to run a process before that prompts user for a decryption code that gets the password from some other, non-descriptive file?

Roger commented on Dec 3rd 2011

Nuno,
Unfortunately I really dont know a way around it. However, you potentially could isolate the file in a truecrypt container and create a symlink to it.
The down side is that youd have to mount the truecrypt container every time you logged on.
I personally use the application specific passwords and I never (ever) let anyone on my laptop. You could also write a.script to read the password from a file that only your user has any permissions on.
If you do go down this route please can you let me know how you get on?

Nuno commented on Dec 4th 2011

I created a file with my application-specific password (file ), encrypted it using openssl.
I then created a simple bash script that
1) prompts user for password to decrypt (can be a short or long one)
2) decrypts password and places it in another file
3) reads password from into script variable $pass
4) kills google-musicmanager in case it is already running
5) launches the /opt/google/musicmanager/google-musicmanager -p $pass command
6) deletes the file

Just so you know, if we list the pid's running, the password is shown in clear text, which again is sub-optimal. Anyone with access to running the pid on desktop (or remotely) would be able to see it.

Below is the script. Hope it can be of some help. I will create a launcher somehow on desktop for it.
***********************************
#!/bin/bash

# Prompt user for password to decrypt application-specific password
pass=`zenity --entry --hide-text --text="Enter password to decrypt password" --title="Access to Google Music"`
if [[ "$pass" = "" ]]
then
zenity --warning --text="Sorry, password required. Script will now exit."
exit 0
fi

# this decripts the application-specific password located in file newfilee.des3 (in Music folder)
openssl des3 -d -salt -pass pass:$pass -in ~/Music/newfilee.des3 -out ~/Music/newfilee

# this kills the google-musicmanager if it is already running
pidmm=`pidof google-musicmanager`
if [[ "$pidmm" != "" ]]
then
kill $pidmm
fi

cat newfilee |
while read a; do
# this will launch the google Music software in desktop
/opt/google/musicmanager/google-musicmanager -p $a
done
# this removes the newfilee containing the visible password
rm ~/Music/newfilee
exit 0
*************************************************

Tim commented on Dec 11th 2011

Thanks for posting this fix. This problem sucks.

Jani commented on Jan 9th 2012

@Roger: Thanks for the solution. On Ubuntu Precise, GMM 1.0.23.1334-r0 seems to use /usr/local/share/applications instead of /usr/share/applications for the desktop file (there's also a copy in /opt/google/musicmanager/, but it's apparently just used for installing the effective file into /usr/local/).

@Nuno: I'm not sure I see the point of encrypting the application-specific password, and then be prompted to enter the key for decrypting the password. Isn't it more straightforward to just specify the application-specific password when GMM prompts you to? Actually, with the caveat that specifying the password on the commandline means exposing it to trusted users, isn't having GMM prompt for it a *better* solution securitywise? I guess you do get the benefit of getting to specify your own password which can be as easily memorizable as you dare use though (the application-specific passwords are difficult). Instead of OpenSSL I'd probably use GNOME Keyring, as it gets unlocked during login without an extra prompt for another password. Then pick the key for GMM using gkeyring.

electromikey commented on Mar 25th 2012

Thanks, works like a charm. Now, if only I could get the program to run automatically on startup... :D

pete commented on May 4th 2012

thx...this will save me a lot of password creating :)

Chris commented on May 14th 2012

not working anymore as of most recent update, looking for a new solution...

Romy commented on Jun 17th 2012

confirm not working anymore.