0

In Windows, there is the Run prompt, which you can access with Win+R key.

run

What is the equivalency to this in Linux? Is there even such a thing or is the Terminal the main prompt you would use in Linux for the type of tasks you normally use the Run prompt for in Windows?

Here is a use case. I want to access \\192.168.0.103\ on my home network. On Windows, I can use the Run prompt for this. Like so:

run2

Where do you type in UNC paths and how do you access them on Linux? What do I have to consider if the remote is a Windows based computer? Do I have to spend a day or two configuring things or will it just work out of the box? You know... SMB, Samba and all that.

5

This depends on which desktop environment you are using.

In GNOME, KDE, Unity and Xfce the default keyboard shortcut for the run prompt is Alt + F2.

As jofel pointed out, xdg-open is a desktop-independent tool for opening a file or URL in a preferred application. Inside a desktop environment, xdg-open simply passes the arguments to a desktop environment specific equivalent (gvfs-open in GNOME and Unity, kde-open in KDE or exo-open in Xfce).

While the desktop environments might not support UNC paths, they generally do understand URIs. Since in this case you want to access a Windows SMB share, the corresponding URI scheme is smb, yielding an URI like smb://192.168.0.103.

Generally you should be able to pass an URI like this to xdg-open, either in the run prompt or in a shell running in a terminal emulator, and have xdg-open open the specified URI in the preferred application associated with the particular URI scheme:

xdg-open smb://192.168.0.103

In the case of GNOME, which is the default desktop environment in Debian, this would, by default, be the Nautilus file manager. Unfortunately it seems that there is a possible bug with xdg-open, which prevents the opening of SMB shares, unless they have been mounted beforehand. This should be handled by the Gnome Virtual File System (GVFS) automatically, but for some reason it might not work with xdg-open.

As a workaround, you could pass the URI directly to nautilus in the Run prompt (or shell). Alternatively you could open the SMB share via the Connect to server dialog in Nautilus (File > Connect to Server) or type the smb URI in the Location bar (Go > Location or triggered via the keyboard shortcut Ctrl+L).

11
  • I think it's Gnome. It's Debian 7.1.0 Wheezy, the default environment I think. – Samir Sep 30 '13 at 9:31
  • It works! I see a "Run Application" dialog box. But unfortunately accessing UNC paths is not as simple as typing in \\192.168.0.103 and hitting Enter, like on Windows. If I do that, it says "could not open location". Should I post this as a separate question? – Samir Sep 30 '13 at 9:36
  • If you're using gnome, UNC paths probably won't work, but you can try running xdg-open giving the destination URI as argument. – Thomas Nyman Sep 30 '13 at 9:41
  • Yeah, smb://192.168.0.102 didn't work. Is says "could not open location" and "file doesn't exist". It's the same with cifs:\\192.168.0.103 as suggested by @jofel except it now says "the specified location is not supported". – Samir Sep 30 '13 at 9:46
  • So you mean like xdg-open smb:\\192.168.0.103 and I type that in the Run Application prompt? Or the Terminal?... – Samir Sep 30 '13 at 9:47
1

Under most window managers you get a similar prompt by pressing Alt + F2.

It depends on your environment, if you can enter UNC/URLs/paths or only real commands which start a program (in this case you can use xdg-open as the program and give it the URL/path as a parameter).

Instead of SMB UNC you probably need to use URLs like cifs://SERVER/PATH or smb://SERVER/PATH.

1
  • If you are interested in earning some more points, you can head over to the new question here. – Samir Sep 30 '13 at 10:15

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.