Unable to run compiled binary
I am having a problem running UML(user mode Linux). I successfully compile the executable but when I try running it, I am getting the following error
./linux: cannot execute binary file: Exec format error
I already verified that the executable is correctly formatted.
file linux linux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, not stripped
So the questions are : What is missing to make this happen? If I run strace, but I get the same error. This is very simple to reproduce. 1.- Download latest Linux source code 2.- apt-get install ncurses-devel 3.- Run make ARCH=um menuconfig 4.- Select exit and save configuration 5.- Run make ARCH=um 6.- when compilation completes, run ./Linux
@spoiledsport - Can you please confirm what Windows build you are running? Also if you could share one of the compiled binaries that would be great so I don't have to set up the entire dev environment.
This happens in every version, but I currently running creators edition
Microsoft Windows [Version 10.0.15063]
Included zipped binary
Any idea on the issue is? Anything you may need from me?
UML does compile and "run" on WSL per some discussion in #1692. Scary quotes because well it doesn't run, but for other reasons. Can't say why you are getting the Exec format error - it does build and execute for myself and others.
@benhillis - it is probably worth taking a look at this binary, because however it was created, it does launch on Real Linux but not WSL as of 17046. Meaning it isn't #330.
I've identified an issue with the way our driver validates ELF headers. I'm working on a fix now.
Heads up #2736 is floating out there as well, if you are poking around ELF. There is a reasonable enough repro over there if you squint.
Fixed in 17093.
Running into this issue and corporate likely won't let me upgrade to that build for a while. Is there any way to fix this myself without upgrading everything?
@jmbouffa - Unfortunately, no. This fix is in WSL and WSL is built into the Windows OS. Can't think of any workarounds.