Score:-1

How to open a video file in Windows using the Ubuntu terminal?

tn flag

So I am learning the Linux/Ubuntu command line. One of the things I want to be able to do is to use the Ubuntu terminal (Windows Subsystem for Linux) to open video files (mp4) on my computer (Windows 10).

I have tried VLC and MPlayer, but when I run vlc filename or mplayer filename, it gives me a very long error. It seems like it is running, but only shows text and then gives a long error.

NotTheDr01ds avatar
vn flag
So when you say that `vlc filename` "seems like it runs", does the VLC window itself open before it gives you the error? If you type just `vlc`, does it open (without a video, of course)? When you specify a filename, are you specifying a path, or have you already `cd`'d to the directory with the video from within Ubuntu?
Nmath avatar
ng flag
"*it gives me a very long error*" - this is essential information when asking how to get past an error. Edit your question and include the complete error. Also can you add some additional clarity: are you trying to open a *Windows* application from Ubuntu? Not possible. If VLC is installed in Ubuntu, do you have a functioning window manager or desktop environment? Desktops and GUI apps are not yet officially supported on WSL and won't work without a lot of wrangling. Also, are you aware that VLC is available on Windows?
NotTheDr01ds avatar
vn flag
@Nmath *"are you trying to open a Windows application from Ubuntu? Not possible.*" Not sure what you mean here - That's completely doable under WSL. I'm pretty certain that the OP is trying to open a file with the Windows version of VLC, but I agree that the question needs a *lot* of clarification.
BeastOfCaerbannog avatar
ca flag
Navigate to the directory where you keep your video files and try running `vlc.exe filename` instead of `vlc filename`.
Score:-1

You can do that out-of-the-box (official docs):

WSL can run Windows tools directly from the WSL command line using [tool-name].exe. For example, notepad.exe.

Applications run this way have the following properties:

  • Retain the working directory as the WSL command prompt (for the most part -- exceptions are explained below).
  • Have the same permission rights as the WSL process.
  • Run as the active Windows user.
  • Appear in the Windows Task Manager as if directly executed from the CMD prompt.

Windows executables run in WSL are handled similarly to native Linux executables -- piping, redirects, and even backgrounding work as expected.

If something fails, you could post a pastebin of the error/s, plus the output of

$ which vlc
$ which mplayer
$ pwd

Also, try other Win commands, as e.g. in the link above, to see if they work.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.