0

Question: What can I do now to get this 32-bit file to run on my 64 bit ubuntu installation?

Main error: Exec format error. Binary file not executable.

I'm trying to run a file that was compiled over 10 years ago. The configurations of this file are:

ELF 32-bit LSB executable, 
Intel 80386, version 1 (SYSV), 
statically linked, 
for GNU/Linux 2.2.5, stripped

My Ubuntu subsystem configurations are:

x86_64 x86_64 x86_64 GNU/Linux
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

Therefore, I've been following this guide to get the 32 bit file to work on my 64 bit ubuntu installation: How to run 32-bit app in Ubuntu 64-bit?.

Essentially, I've performed the following steps:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo apt-get install multiarch-support

Afterwards, I run the following command to run the file:

sudo ./executeFile inputFile

This does not work for me as I'm still receiving a Exec format error. Binary file not executable. error.

I've followed various other guides on AskUbuntu and installed various packages. A similar to the above guide I followed, another example is Running a 32bit executable, with the commands:

sudo apt-get install --reinstall libc6-i386
sudo apt-get install libgl1-mesa-glx:i386 lsb-core
3
  • Have you see this? Also, it might help to tell us which specific executable you're trying to execute - and maybe link to it.
    – KGIII
    Aug 19, 2020 at 1:49
  • Thanks for that KGIII. I've actually had a look at that link before, hence how I got the x84_64 number. Re: the executable, it's actually quite annoying but given it's a privately developed execute, I can't actually link to it. Very sorry.
    – user1116158
    Aug 19, 2020 at 2:00
  • Are you using WSL1 (Windows Subsystem for Linux?) It has no 32-bit support, like a Linux kernel compiled without CONFIG_IA32_EMULATION. See Does WSL 2 really support 32 bit program? Jun 14, 2022 at 14:02

1 Answer 1

-1

This answered helped me solve my issue: https://stackoverflow.com/questions/36665669/trying-and-failing-to-run-hello-world-32-bit-c-program-on-64-bit-ubuntu-on-w/36896713#36896713

Main points were using these commands:

sudo apt install qemu-user-static
sudo update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff'

sudo service binfmt-support start

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install g++:i386
1
  • Those instruction de-installed most of my 64 bit packages. #%^##^*!!!!
    – WallyZ
    Feb 13 at 5:14

You must log in to answer this question.