Ubuntu does not open MS Windows internet shortcuts with 'url' extension

Bug #185165 reported by DavidGN on 2008-01-22
This bug affects 19 people
Affects Status Importance Assigned to Milestone
Ayatana Design
John Lea
Gnome Mime-Data
Fix Released
One Hundred Papercuts
gnome-mime-data (Ubuntu)
mime-support (Ubuntu)
shared-mime-info (Ubuntu)

Bug Description

Ubuntu will not open standard internet shortcuts created in Microsoft Windows. This makes interoperability very poor, and will prevent many people from migrating to Ubuntu.

Copy any 'filename.url' from a Microsoft Windows machine, or create a file with the following contents:


and name it 'ubuntu.url'.

Double click in Nautilus to launch. Nothing happens. It should launch in the same manner as a 'desktop' internet shortcut.

Note: a workaround has been developed - http://ubuntuforums.org/showthread.php?p=3281092. This should be provided by default Ubuntu installation.

Martin Owens (doctormo) on 2008-05-26
Changed in shared-mime-info:
status: New → Confirmed
Changed in gnome-mime-data:
status: New → Confirmed
vj (veejunk1) wrote :

I can confirm this bug - it is a long standing issue over several Ubuntu releases. It is (in my opinion, as one migrating from windoze) a major impediment to useability of ubuntu for those people switching operating systems. It seems really daft that something as simple as clicking on existing internet shortcuts is not supported.

This should be given fairly high importance given that most migrators from windoze will inevitably have al least some, perhaps many, shortcuts they wish to use.

Endolith (endolith) wrote :

This is a very simple thing to fix. Why hasn't it been fixed yet? It just needs:

1. A launcher script for parsing .URL files
2. A MIME type for .URL files
3. A binding between the MIME type and the launcher script

All of these have already been done, they just need to be included in Ubuntu.

DavidGN (davidgn) wrote :

This issue stopped me from migrating to Ubuntu for ~18 months (and I still haven't for other reasons). I have hundreds, maybe thousands of URLs scattered in project folders. There's no way I could migrate from Windows without this functionality. I'm sure there are many others the same.

It seems such a simple, trivial enhancement which will benefit anyone hoping to migrate from Windows. It should have received attention long ago.

Then again, Ubuntu / Nautilus can't even open its own URL shortcuts reliably - https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/252902 , http://bugzilla.gnome.org/show_bug.cgi?id=518481

Martin Owens (doctormo) wrote :

Endolith, do you have a package in mind that fixes the issue? or is it something that would go upstream into nautilus?

If you've got a package, we could get it through REVU and a MOTU to get it into main. Once there getting it installed by default is easier.

Endolith (endolith) wrote :

I don't know of any package, but as I understand it this is very simple to fix for someone familiar with the MIME stuff; just a matter of creating or modifying 2 or 3 text files in the system.

Endolith (endolith) wrote :

There is already a MIME type for these files "Internet shortcut (application/x-mswinurl)" registered in /usr/share/mime/application/x-mswinurl.xml and /usr/share/packages/freedesktop.org.xml

The latter contains the magic word search:

    <magic priority="50">
      <match value="InternetShortcut" type="string" offset="1"/>
      <match value="DEFAULT" type="string" offset="1">
        <match value="BASEURL=" type="string" offset="10"/>

The files are actually recognized as "resource location (text/x-uri)" when I view the Properties in Nautilus, though. This seems to be based on the .url glob:

    /u/s/mime> grep -ir "\.url" *
    packages/freedesktop.org.xml: <glob pattern="*.url"/>

Not sure about the details of this. Do these definitions need to be cleaned up to be consistent?

Endolith (endolith) wrote :

Then we need a script in /usr/bin (?) to parse the files and launch the browser. A Perl script has already been provided on Ubuntu Forums (attached), and a dash script could probably be written if Perl is not included by default. This script should be changed to launch the default browser instead of hardcoded to Firefox, though.

Then a file association should be added so that this script is called whenever a file with the application/x-mswinurl.xml MIME type is double-clicked. I think this is just adding one line to /usr/share/applications/defaults.list:


Endolith (endolith) wrote :

Oh, and the something.desktop needs to be created in /usr/share/applications to launch the script

Endolith (endolith) wrote :

I modified the script to use xdg-open to open the default browser instead of always using firefox. Confirmed that it works in Gnome with a .url file.

Martin Owens (doctormo) wrote :

I've been working on this too. It looks like a bit of a mess. We need to fix two issues. One is the lack of x-mswinurl support, including loading the url in a default browser (see script above)

And then we have the problem that the magic glob doesn't choose the right mime type for mswinurl files.

What is the real text/x-url format? do we know?

Endolith (endolith) wrote :

Here's a more robust script in Python. It handles multiple files, prefers the [InternetShortcut] section over [DEFAULT] no matter where they appear, and uses xdg-open to get the user's default browser.

Endolith (endolith) wrote :

As for the MIME type, I think there are actually two types of files here:

Files starting with [InternetShortcut] are type application/x-mswinurl , since they're used in an application (launcher) and non-standard MS type.

Files that end in .url can be either the above or type text/x-uri. An example of the latter is /usr/share/gettext/projects/GNOME/teams.url, which is just a plain text file containing a url and nothing else. This is matched from /usr/share/globs2:


So what we really have to do is make the [InternetShortcut] magic word override the .url glob when it exists. Currently it assumes text/x-uri whenever the glob is .url. If you change an MS URL file to a random extension, you'll see that it changes from "resource location" to "Internet shortcut".

I'm not sure how to make it override. "If the glob matching fails or results in multiple conflicting mimetypes, read the contents of the file and do magic sniffing on it."

Changed in shared-mime-info:
importance: Undecided → Wishlist
Bastien Nocera (hadess) wrote :

Endolith (whoever you are), don't CC: me on launchpad bugs. I'm grown up enough to subscribe to the bugs I'm actually interested in.

Endolith (endolith) wrote :

I'm not sure why that note is directed at me. I am using the launchpad.net web interface, and I am not "CC:"ing anyone.

You can easily unsubscribe from bugs you aren't interested in: https://bugs.launchpad.net/ubuntu/+source/gnome-mime-data/+bug/185165/+subscribe

rCX (rcx) wrote :

I can also confirm this in Ubuntu 9.04. Here is yet another workaround. After compiling the attached code using " gcc OpenUrlFile.c -o OpenUrlFile.out ", I associate it with these files by right clicking on a *.url file with Properties->Open With->Add->Use a custom command. I then browse to OpenUrlFile.out before selecting it in the Open With tab.

Forgive me if this is the wrong place or the wrong information, but in Ubuntu, files with .URL extension and [InternetShortcut] magic word (used to store Favorites in IE, for instance) are being recognized as "resource location (text/x-uri)", and we're trying to figure out how to get it recognized correctly (application/x-mswinurl) and then associate that type with a launcher script.

The [InternetShortcut] magic word and .url glob are defined in /usr/share/packages/freedesktop.org.xml, so I thought I'd bring it up here.

  <mime-type type="application/x-mswinurl">
    <_comment>Internet shortcut</_comment>
    <magic priority="50">
      <match type="string" value="InternetShortcut" offset="1"/>
      <match type="string" value="DEFAULT" offset="1">
        <match type="string" value="BASEURL=" offset="10"/>


  <mime-type type="text/x-uri">
    <_comment>resource location</_comment>
    <sub-class-of type="text/plain"/>
    <!-- Note: text/uri-list is reserved by the XDND protocol! -->
    <glob pattern="*.uri"/>
    <glob pattern="*.url"/>

So it seems the glob definition is overriding the magic word definition? If I change the file extension it is recognized correctly. Does the priority need to be changed, then?

Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/gnome-mime-data/+bug/185165


Endolith (endolith) wrote :

The association with "Open With" only configures it for your own user profile, though, right?

How do we change the global MIME data to make this association for all users? I've tried to read through the documentation and can't find this.

Changed in gnome-mime-data:
status: Unknown → Confirmed
rCX (rcx) wrote :

@Endolith: Yeah I think so.

This bug was also reported to Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=442930

Vish (vish) wrote :

Thank you for bringing this bug to our attention. Unfortunately a paper cut should be a small usability issue that affects many people and is quick and easy to fix. I'm afraid this bug can't be addressed as part of this project.

A paper cut is a minor usability annoyance that an average user would encounter on his/her first day of using a new installation of Ubuntu 9.10.

For further info about papercuts criteria , pls read > https://wiki.ubuntu.com/PaperCut

Don't worry though, This bug has been marked as "invalid" ONLY in the papercuts project.

Changed in hundredpapercuts:
status: New → Invalid
Vish (vish) wrote :

Endolith wrote:
> I added Bug #185165 to 100 paper cuts because it's an issue that affects
> many people (anyone who has saved Favorites in Internet Explorer, for
> instance), and because it should be easy to fix (just changing some MIME
> files). Why do you think it's not appropriate for the papercuts
> project?

This isnt a papercut because there doesnt seem to exist an easy / quick fix.
Papercuts is now trying to fix *minor* usability problems.
For further info about papercuts criteria , pls read > https://wiki.ubuntu.com/PaperCut

If you have an easy/quick solution to fix this , Kindly attach this here. For further review.

PS: Kindly keep the discussions in the bug report, rather than contacting me personally.

Endolith (endolith) wrote :

There are several solutions already attached.

scottuss (scottuss) wrote :

This has never affected me personally, but I have to say that as a promoter of Ubuntu to Windows users, this could certainly cause issues!

Let's get this committed!

Changed in gnome-mime-data (Ubuntu):
importance: Undecided → Wishlist
aviramof (aviramof) wrote :

this is a two years old bug why no one has fixed it already???

Martin Owens (doctormo) wrote :

Because it has been fixed, just no one can be bothered to release the fix.

Tony Godshall (togo) wrote :

Endolith wrote...
> How do we change the global MIME data to make this association for all users? I've tried to read through the documentation and can't find this.

I got it to work like so:

[start snippet from /etc/mailcap]
# ----- User Section Begins ----- #

application/x-mswinurl; /usr/local/bin/mswinurl_launcher.py '%s'; test=test -n ""; description="MS Windows .url file"; nametemplate=%s.url

# ----- User Section Ends ----- #
[end snippet from /etc/mailcap]

[start snippet from /etc/mime.types]
application/x-mswinurl url
[end snippet from /etc/mime.types]

# ls -l /usr/local/bin/mswinurl_launcher.py
-rwxr-xr-x 1 root root 2117 2010-03-02 11:54 /usr/local/bin/mswinurl_launcher.py

That's it.

Martin Owens wrote on 2010-02-21:
> Because it has been fixed, just no one can be bothered to release the fix.

OK, so who do we poke? Do we need to give it to upstream?


Martin Owens (doctormo) wrote :

Maybe a MOTU.

aviramof (aviramof) wrote :

is there any news on the matter is it possible that lucid 10.04 would have this option avilable?

caixamagica (caixa-magica) wrote :

I know this is not a online petition but I would like to have this option available too and be able to open .url extensions on Ubuntu.

scottuss (scottuss) on 2010-06-29
Changed in gnome-mime-data (Ubuntu):
status: Confirmed → Fix Committed
Endolith (endolith) wrote :

Can you explain how this was fixed?

aviramof (aviramof) wrote :

Use save link 2.1 firefox addon and forget about this problem.

Changed in gnome-mime-data:
importance: Unknown → Medium
S.Rey (s.rey) wrote :

I had not noticed this before, but after promoting and installing ubuntu in a friend's computer, this has raised as a major issue.
This is one of those little annoyances that, while for most of us seems very low priority, it stops people from switching to ubuntu.

By the way, the issue is still the same on 10.04 and 10.10

@aviramof: How that extension could posibly help? The problem is not to create .url files, the point is how to use the existing ones.

Changed in gnome-mime-data:
importance: Medium → Unknown
Changed in gnome-mime-data:
importance: Unknown → Medium
Polemos (temp2417) wrote :

This is not only a bug (since the <mime-type type="application/x-mswinurl"> does exist but doesn't work) but also a usability problem.

-Being able to handle the MS-url extension in ubuntu is the same as being able to handle MS-doc extension.-

Finding a workplace enviroment so much better than windoze and getting stuck for 3 days just to be able to work in it for such an unexpected annoyance is really a shame.

Tony Godshall (togo) wrote :

Polemos: Status says "fix committed"- why hype it further? Test the fix.

Polemos (temp2417) wrote :

Tony Godshall:

I have fixed it before posting my previous message. Thank you for pointing the obvious.

I haven't asked for a fix, I posted a message because I care for other people and (believe or not) for the project. The people need a patch. An unasked patch. A "click to download me update" type of patch. Not a "search all day long" fix.

I hope it will be obvious some day to be included by default in ubuntu or making a patch in ubuntu so people will not need to hype the subject further.

DavidGN (davidgn) wrote :

This bug is one of those baffling things: easy to fix, benefits the project and encourages migration from Windows - but nothing is done about it for years, while massive changes are implemented elsewhere in the project.

No 'average' user is going to find this thread and apply the fix themselves. They'll just think Ubuntu is broken because they cannot open their files. It perpetuates the belief that Ubuntu / Linux is only for geeks.

You've got to question how the project is prioritised.

Paul Sladen (sladen) wrote :

Needs a high-level decision. Is support .url shortcuts (from the MS Windows world) something we want to do; and if so, are there any security concerns.

On Wed, May 11, 2011 at 8:36 AM, Paul Sladen <email address hidden> wrote:
> Needs a high-level decision. Is support .url shortcuts (from the MS
> Windows world) something we want to do; and if so, are there any
> security concerns.

What I do for my users is have it run a little script that
extracts the http and gives it to firefox. What security
concerns? Firefox already has to deal with arbitrary
URLs- I don't think there's anything new here.


If there's been discussion about it somewhere, could you point us to it?

Best Regards

Changed in gnome-mime-data:
status: Confirmed → Fix Released
John Lea (johnlea) on 2011-06-14
Changed in ayatana-design:
assignee: nobody → John Lea (johnlea)
status: New → Fix Committed
importance: Undecided → Low
status: Fix Committed → Fix Released
tags: added: udo
John Lea (johnlea) on 2011-10-18
tags: added: udp
Changed in ayatana-design:
status: Fix Released → Fix Committed
John Lea (johnlea) on 2011-10-20
Changed in ayatana-design:
status: Fix Committed → Triaged
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mime-support (Ubuntu):
status: New → Confirmed
Changed in gnome-mime-data (Ubuntu):
status: Fix Committed → Fix Released
Tim Penhey (thumper) on 2012-04-28
Changed in ayatana-design:
status: Triaged → Fix Committed
Grzegorz G. (grzesiek1e5) wrote :

Works for me in Precise, but trough rundll32 (wine). Ayatana, mime-support and shared-mime-info: is this fixed or not?

jhansonxi (jhansonxi) wrote :

Ubuntu 12.04 (Precise Pangolin)/Linux Mint 13 (maya)
CInnamon desktop
Except for the conflicting entry in gnome-mime-data (*.url glob in /usr/share/mime/packages/freedesktop.org.xml) It doesn't appear to have been fixed.

tags: added: precise
John Lea (johnlea) on 2012-10-15
Changed in mime-support (Ubuntu):
status: Confirmed → Triaged
Changed in shared-mime-info (Ubuntu):
status: Confirmed → Triaged
makda (ebrahim-makda) wrote :

When is this likely to become available as an update?

Joachim (joachimrs) wrote :

Am having this problem still in Linux Mint 15 with Cinnamon. Most of the above links from 2009ff do not work anymore. Someone still has the perl or python script to attach to this bug report, so user can fix this issue themselves?

Endolith (endolith) wrote :

Mine still exists: https://gist.github.com/endolith/77635

I no longer use Ubuntu, though, so I don't know if it still works.

tags: added: trusty
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.