Run exe file on linux

How to run an .exe from linux command prompt

but if it’s really a Windows program, you will need to install «wine», then do:

but only some Windows programs will work under wine.

This anwswer is combining other answers in to this question into one.

The info.exe file will either execute under Linux or Windows, but not both.

Executes Under Windows

If the file is a windows file, it will not run under Linux on it’s own. So if that’s the case, you could try running it under a windows emulator (WINE). If it’s not compatible with wine, then you won’t be able to execute it under Linux.

Before you can start, you will need to install wine. The steps you need to install wine will vary on the linux platform you are on. You can probably google «Ubuntu install wine», if for example, you’re installing ubuntu.

Once you have wine installed, then you’d be able to execute these commands.

Execute Under Linux

if you know this file to run under linux, then you’ll want to execute these commands:

Change to your abc directory

Then you’ll want to change permissions to allow all users to execute this file (a+x).
you could also allow just the user to execute (u+x)

Launch the program, the ./ tells the command line to look in the current path for the file to execute (if the ‘current’ directory isn’t in the $PATH environment variable.

«you could try running it under a windows emulator (WINE).» WINE does stand for «Wine Is Not an Emulator».

My comment was meant to be both a joke a a proposition for an edit. AFAIK Wine basically replaces windows calls for POSIX equivalents, so whoever named it was not ironic, that is WINE is indeed not an emulator.

you can’t 🙂 exe is Microsoft only. now if you had a linux executable you could do:

cd folder chmod +x file ./file 

This is false in general. Many Windows and DOS EXEs can be run on Linux using emulators such as wine or dosbox .

@Royi probably «yes», but that depends on how simple we’re talking. But wine should also do your trick.

On Linux you give the file executable permissions. It isn’t the extension that determines whether or not it can be executed (as on windows.)

Читайте также:  Astra linux hex редактор

Assuming you have a valid file that can be executed in Linux, (not a windows/dos file) do this:

cd abc chmod a+x info.exe ./info.exe 

Note that you need the leading ./ for the shell to find the file in the current directory!

This really belongs on superuser though.

The first line changes the directory, the second line tells linux it is executable, the third runs the program.

I recently wanted to run some old MSDOS .exe files and I could just use dosbox. On Ubuntu it was just

.exes are generally Windows executables, not linux ones. To run those, use something like WINE.

Otherwise, to run a Linux executable, there are many ways, e.g.:

  1. cd abc; ./info.exe
  2. ./abc/info.exe
  3. /full/path/to/abc/info.exe
  4. Add «abc» to your PATH, then just run it as a normal command.

I struggled so much until I found this website and used the ‘terminal’ tips section at the bottom of the page: winehq.org/download/ubuntu

Wine is a program that you can install, which allows you to run .exe files on linux.

(go to the directory of your file: /cd (ex: Desktop/) And to open your .exe file:

If you have any problems with wine, you can do wine —help .

Here is how to run an executable file in Linux:

  1. open terminal with ctrl + alt + T : sudo apt-get update
  2. install Wine: sudo apt-get install wine
  3. go to the directory in which your .exe file is placed by changing directory: cd /Desktop
  4. wine filename.exe

Hit enter and your .exe file will be executed.

Executing a Linux executable on Linux

If the executable is a Linux executable, you need to make sure that your shell can find it. Here are some ways how to do that.

But first, make sure it’s executable. You can check whether the x (executable) flag is set using ls -l abc/info.exe and you can set it with chmod +x abc/info.exe .

  • Run it with relative path, in your example: abc/info.exe .
  • Run it with absolute path, for example: /home/username/abc/info.exe (depends on where it actually is)
  • Place the binary in a directory that is part of the PATH that is searched by the shell to find binaries. For example, cp abc/info.exe ~/bin/ . If ~/bin is part of PATH , you can now run info.exe without qualifying it.
  • Make the directory that contains the binary part of the PATH , for example, export PATH=~/abc:$PATH . Note that this is for the current shell only, unless you add this line to your .bashrc or .profile

Executing a Windows executable on Linux

If the executable is a Windows executable, you need to install wine . Then you can run it using wine abc/info.exe . If you want to run it like a Linux program, you need to install wine-binfmt . Then you can run it the same way as described above for Linux executables.

If you use Ubuntu, install wine like this:

sudo apt-get install wine wine-binfmt 

Источник

Читайте также:  Кэширующий прокси сервер linux

How to run exe file in Ubuntu [duplicate]

If the .exe file is a windows executeable, you can’t run it directly in Ubuntu (or other Linux’s). Either you should install Wine and run it through that, or find a utility in Ubuntu that does the same as the windows one.

Could be a slight case of the XY-problem (meta.stackexchange.com/questions/66377/what-is-the-xy-problem). If you want to convert a wav-file to raw PCM data for processing in Matlab, you could use a linux-tool like sox instead: stackoverflow.com/questions/9383576/…

Is WAV2RAW.exe the only EXE program you want to run, or do you have several other DOS / Windows / .NET programs?

I’m relatively sure that Matlab (and its open-source clone Octave) have native functions to parse WAVE headers and data as well as to write raw PCM data since I used them in the past. Those would obviate the need for an external conversion application unless the PCM data doesn’t fit into main memory.

2 Answers 2

I think you should use Wine.

sudo apt-get install wine wine dir/WAV2RAW.exe 

Or Mono if you know that exe is .NET application:

sudo apt install mono-runtime mono dir/WAV2RAW.exe 

You don’t need to chmod . Besides that, it’s worth noting that not all software runs under wine. YMMV.

You seem to have added the chmod line according to my comment. However, I think it is only necessary if you want to run the .exe file directly, i.e. without prepending wine to the command line – like OP wants to. I haven’t tested it with Wine but it behaves this way with .NET exe files ( mono my.exe or chmod +x my.exe && ./my.exe ) or even shell scripts ( sh script.sh or chmod +x script.sh && ./script.sh ).

@Melebius that works because Wine registers itself in binfmts when installed from the official Ubuntu package.

Источник

Can Linux Run .exe Files? How to Run Windows Software on Linux

This article was co-authored by Garnik Ovsepyan and by wikiHow staff writer, Kira Jan. Garnik Ovsepyan is a Computer Specialist and the Owner of HeliX PC based in Burbank, California. With over 25 years of experience, Garnik specializes in custom computer builds, computer repairs, virus removal, computer tune-ups, hardware and software troubleshooting and installations, diagnostics, and data backup and recovery.

There are 7 references cited in this article, which can be found at the bottom of the page.

This article has been viewed 260,754 times.

You don’t have to sacrifice the appeal of Windows software for the stability, security, customizability, and old-school cool of Linux. This wikiHow guide will walk you through running Windows executable (EXE) applications and games on any Linux distribution, including Ubuntu, Kali Linux, and CentOS.

Will .exe files run on Linux?

Image titled Can Linux Run Exe Step 1

Yes, you can run .exe files on Linux through Wine (a free software). Wine is a compatibility layer that acts between the operating system (Linux) and the file (written for Windows). [1] X Research source It is the only way to run .exe files without a copy of Windows. [2] X Research source Since .exe files are native to Windows operating systems, to run them, you must have a compatibility layer (like Wine) or copy of Windows via a Windows emulator (which means you’ll no longer solely be using Linux).

Читайте также:  Get disk usage linux

How do I download Wine?

Image titled Can Linux Run Exe Step 2

  • sudo apt-get install wine and press ↵ Enter
  • sudo apt-get install wine32 and press ↵ Enter
  • sudo apt-get install libwine and press ↵ Enter
  • Even though the terminal might look intimidating, don’t worry! You’re unlikely to mess anything up, and all you have to do is copy these commands.

How do I run .exe files on Linux?

Image titled Can Linux Run Exe Step 3

How can I run Windows software on Linux?

Image titled Can Linux Run Exe Step 4

Use Wine for single applications. This is the only option for running software designed for Windows without a true version of Windows. Wine is open-source, free software that recreates just enough of Windows to run Windows programs. As a result, you might encounter more bugs and lower performance running software through Wine. [6] X Research source

Image titled Can Linux Run Exe Step 5

  • Popular virtual machines include: VirtualBox, VMware, and Linux’s built-in KVM (Kernel-based Virtual Machine). [8] X Research source
  • Because of the computing power required to run both Linux and Windows, this approach works great for productivity apps like Microsoft Office, but not great for graphics/computing-intensive programs like video games.

Image titled Can Linux Run Exe Step 6

Use dual-booting to run Windows games and complex applications. Dual-booting means you’ll reboot your computer into Windows so the application can run in its native environment. This method is best for games or applications that need high performance. Unfortunately, it does mean you’ll have to reboot your machine every time you want to run Windows software. [9] X Research source

Consider using WSL to get the best out of both Windows and Linux. WSL is an environment that supports running of Linux tools and apps with a native Linux kernel through a hypervisor layer. WSL requires less set up to get started as well.

What is the .exe equivalent in Linux?

Image titled Can Linux Run Exe Step 7

  • Type chmod +x file-name.run in the command line to change the file permission to “executable.”
  • Type ./file-name.run to execute the file.
  • If an error pops up, type sudo ./file-name.run . Typing sudo allows you to run the file as an admin. Just be careful, since sudo allows you to make changes to your system.
  • Software installation will often require you to type sudo .

Expert Q&A

You Might Also Like

Install Google Chrome Using Terminal on Linux

Add or Change the Default Gateway in Linux

Open Ports in Linux Server Firewall

How to Open Linux Firewall Ports: Ubuntu, Debian, & More

Take a Screenshot in Linux

Become Root in Linux

Execute INSTALL.sh Files in Linux Using Terminal

How to Run an INSTALL.sh Script on Linux in 4 Easy Steps

Ping in Linux

Use Ping in Linux: Tutorial, Examples, & Interpreting Results

Boot Linux from a USB on Windows 10

Delete Read Only Files in Linux

How to Delete Read-Only Files in Linux

Use Wine on Linux

Run Files in Linux

Install Linux

How to Install Linux on Your Computer

Install Software on Linux

How to Install Software on Linux: Packages, Compiling, & More

Install Puppy Linux

How to Install Puppy Linux

Источник

Оцените статью
Adblock
detector