Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WLinux] support for 32bit apps (proposal included) #273

Closed
n3rd4i opened this issue Dec 22, 2018 · 7 comments
Closed

[WLinux] support for 32bit apps (proposal included) #273

n3rd4i opened this issue Dec 22, 2018 · 7 comments
Labels
For Discussion We should talk about this.

Comments

@n3rd4i
Copy link

n3rd4i commented Dec 22, 2018

Is your feature request related to a problem? Please describe.
It will be beneficial for users which want 32bit [ELF] support to have this in WLinux setup.

Describe the solution you'd like
There is an workaround using qemu to allow 32bit support.
Link for workaround

This could be included in wlinux-setup.

Describe alternatives you've considered
Microsoft implements native x86 support. Probably not the case.

Additional context

@sirredbeard sirredbeard added the For Discussion We should talk about this. label Dec 22, 2018
@ghost
Copy link

ghost commented Dec 31, 2018

Just a heads up for anyone who tries the workaround in wlinux. You will get an errors while trying to follow the guide but I found if you ignore them and continue anyway it seems to still work. Even though when running sudo service binfmt-support start it will say [....] Enabling additional executable binary formats: binfmt-supportupdate-binfmts: warning: unable to close /proc/sys/fs/binfmt_misc/register: Invalid argument update-binfmts: exiting due to previous errors failed!

It will still allow you to execute i386 format elf files afterwards.

@WSLUser
Copy link

WSLUser commented Jan 2, 2019

I would also add ARM support from here after establishing 32 bit support. Seeing as some steps are redundant, just get the 32 bit functionality started first, then the other steps for getting ARM working.

@ghost
Copy link

ghost commented Jan 3, 2019

Just a small update. I was able to get the above workaround to work in wlinux by doing the following.

git clone git://git.qemu-project.org/qemu.git
mkdir qemu/build && cd qemu/build
sudo apt install libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev libaio-dev libbluetooth-dev libbrlapi-dev libbz2-dev  libcap-dev libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev libibverbs-dev libjpeg-dev libncurses5-dev libnuma-dev librbd-dev librdmacm-dev libsasl2-dev libsdl2-dev libseccomp-dev libsnappy-dev libssh2-1-dev libvde-dev libvdeplug-dev libvte-dev libxen-dev liblzo2-dev valgrind xfslibs-dev
../configure --target-list=i386-linux-user,i386-softmmu
make -j$(nproc)
sudo make -j$(nproc) install

If it was a success you can now
cd ../.. && rm -rf qemu

then run

sudo apt install binfmt-support
sudo update-binfmts --install i386 /usr/local/bin/qemu-i386 --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 gcc-multilib g++-multilib

You should now be able to execute both 32-bit and 64 bit code. The best part is it appears to stay running. I only had to run the binfmt-support start command once.

@n3rd4i
Copy link
Author

n3rd4i commented Jan 4, 2019

Small improvement in file /etc/apt/sources.list to avoid warning:

N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://apt.patrickwu.space stable InRelease' doesn't support architecture 'i386'

line replace:

deb https://apt.patrickwu.space/ stable main

with

deb [ arch=amd64 ] https://apt.patrickwu.space/ stable main

@crramirez
Copy link
Collaborator

Hello,

Could someone explain or put examples about the use cases for supporting 32bit packages? I have one, install wine 32bits on WSL but I think this is not so much useful.

You use cases?

Regards

@WSLUser
Copy link

WSLUser commented Jan 23, 2019

@crramirez Here you go:
microsoft/WSL#2468 (comment)

@n3rd4i
Copy link
Author

n3rd4i commented Nov 23, 2019

will close this since no update

@n3rd4i n3rd4i closed this as completed Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Discussion We should talk about this.
Projects
None yet
Development

No branches or pull requests

4 participants