Guide: Getting iraf, xgterm to work on Ubuntu on Windows 10 (WSL)
cejohnston wrote on Apr 06, 2018
I jumped through some hoops to figure out how to do this, and thought it'd be useful to organize the steps I took so that others can go about it much more easily.
Firstly, you'll need Windows 10 to be updated to at least the Fall Creators update (Build 1709).
Next, you'll want to install an Xserver on the Windows OS. I'm using VcXsrv, but there are others out there that you can find with a google search that will provide you with the same results.
Install C-shell:
sudo apt-get update
sudo apt-get install cshNow WSL doesn't currently natively support 32-bit programs, so we'll need to workaround that.
I found a solution here: https://github.com/microsoft/wsl/issues/2468#issuecomment-374904520
This basically adds an emulator that'll let you run 32-bit software.
sudo apt update
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 dpkg --add-architecture i386Some dependencies that apparently have to be installed in this particular order on WSL:
sudo apt-get update
sudo apt-get install cpp-5:i386
sudo apt-get install cpp:i386
sudo apt-get install binutils:i386
sudo apt-get install gcc-5:i386
sudo apt-get install gcc:i386
And finally, two commands you'll need to execute every time you restart the Bash terminal on Windows 10.
The first one will send any graphical applications to your Xserver (once you've started that on Windows), and the second one is the service that'll run 32-bit software.
export DISPLAY=127.0.0.1:0.0
sudo service binfmt-support startHopefully this helps someone.
Karl Glazebook wrote on Apr 14, 2018
I tried this out of interest, but unfortunately it does not work.
The 32 bit emulation part works fine, ingenious!, and I was able to run ordinary 32 bit ELF binaries (e.g. helloworld.c).
IRAF installs OK and you can launch xgterm, ds9, and pyraf and you get the prompt.
However none of the actual IRAF tasks will launch from pyraf. Typical error is ‘task terminated abnormally. Running a task xxx.e file directly from bash (little known, you can do this) gives a ‘PANIC…’ error message.
(This was all with the Astroconda distribution.)
cejohnston did you actually get IRAF to run science tasks?
Karl
Karl Glazebook wrote on Apr 18, 2018
Answering my own question (somewhat):
I did get this to work by ignoring astroconda and downloading IRAF from iraf.noao.edu which has been 64 bit since 2012!
IRAF, the CL, ecl and ds9 all work fine (64 bit binaries) in WSL. No need for any of the 32 bit emulation mentioned above. [But I can not find a 64 bit version of xgterm].
The question is, why six years later, is STSCI distributing a 32 bit IRAF as the 'go to version of IRAF' under the astroconda banner?
I suppose the answer is they never made STSDAS 64 bit....
Karl
Last post on Apr 18, 2018