2

I wanted to give WinEdt a try, using the wine windows emulator on Ubuntu 14.04. I have texlive 2015 installed and working with no issues.

The program installed fine, and seems to work well using the wine emulator, but fails to compile. It appears that the problem is not being able to find the path to my texlive installation. There may also be some other impediments that I am not yet aware. I assume one option would be to install another texlive into the wine environment.

However, I do not really want to install texlive into the wine environment, as it is rather large, and seems wasteful of system resources. Perhaps there is a solution using some kind of hard or soft links?

Does anybody know how to give wine access to my already installed texlive 2015 installation? Is it possible at all? Are there further pitfalls to watch out for?

The document I attempted to compile:

\documentclass{article}
\begin{document}
Hello World
\end{document} 

The error:

Error Launching Console Application PDFTeXify ... Command Line: pdflatex.exe --interaction=errorstopmode -- ... File not found.

  • Well, I would assume that the environment variables like $PATH etc. are important too, but I don't know how wine reacts if it should mix Windows (emulated of course) calls with calls to Linux binaries – user31729 Jul 11 '16 at 10:11
  • Here I was thinking that a texlive installation is fundamentally the same, whether installed on Linux or Windows. I don't know much about pascal. – A Feldman Jul 11 '16 at 10:20
  • Pascal? The TeX tree should be similar, in my point of view, but apparently you have to make WinEdt aware of the locations of your binaries – user31729 Jul 11 '16 at 10:22
  • 2
    In general, environment variables from your Linux host are automatically exported to your Wine instance. In other scenarios, there's wine regedit, so you can add keys to HKEY_CURRENT_USER/Environment and set their proper values. But bear in mine the Linux executables won't run inside Wine, you'd need Windows binaries for that regardless. – Paulo Cereda Jul 11 '16 at 10:29
  • @PauloCereda if the environment variables from Linux host are automatically exported to my Wine instance, I don't understand why WinEdt isn't finding my tex installation, as I believe I have texlive installed system wide. The WinEdt binary seems to work fine. – A Feldman Jul 11 '16 at 10:35
5

I am afraid the only way to properly (if possible) run TL inside Wine is to install the Windows binaries alongside with your Linux ones.

In summary, Linux binaries are not seen by Wine as executable files, nor Wine has the ability to run them through the host system, as it isolates the execution. A possible workaround is to have Cygwin installed inside Wine, but this would be quite a heavy workflow.

As I mentioned in my comments, Wine seems to get environment variables from your underlying Linux session, except some of them are omitted, specially PATH (which makes sense, for two reasons: (a) Wine doesn't bother about non-Windows executables, and (b) it would break the isolation/sandbox feature).

Let us see it in practice:

[paulo@nineveh ~] $ wine cmd
Microsoft Windows 5.2.3790 (1.9.12)

Z:\home\paulo>set
_=/usr/bin/wine
ALLUSERSPROFILE=C:\users\Public
APPDATA=C:\users\paulo\Application Data
BASH_FUNC_module()=() {  eval `/usr/bin/modulecmd bash $*`
}
BASH_FUNC_scl()=() {  local CMD=$1;
 if [ "$CMD" = "load" -o "$CMD" = "unload" ]; then
 eval "module $@";
 else
 /usr/bin/scl "$@";
 fi
}
CLIENTNAME=Console
COLORTERM=truecolor
CommonProgramFiles=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=nineveh
ComSpec=C:\windows\system32\cmd.exe
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DESKTOP_SESSION=gnome
DISPLAY=:0
GDM_LANG=pt_BR.UTF-8
GDMSESSION=gnome
GJS_DEBUG_OUTPUT=stderr
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
HISTCONTROL=ignoredups
HISTSIZE=1000
HOMEDRIVE=C:
HOMEPATH=\users\paulo
HOSTNAME=nineveh
KDEDIRS=/usr
LANG=pt_BR.UTF-8
LESSOPEN=||/usr/bin/lesspipe.sh %s
LOADEDMODULES=
LOCALAPPDATA=C:\users\paulo\Local Settings\Application Data
LOGNAME=paulo
LOGONSERVER=\\nineveh
LS_COLORS=rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
MAIL=/var/spool/mail/paulo
MODULEPATH=/etc/scl/modulefiles:/etc/scl/modulefiles:/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles
MODULESHOME=/usr/share/Modules
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
PATH=C:\windows\system32;C:\windows;C:\windows\system32\wbem
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_ARCHITEW6432=AMD64
PROCESSOR_IDENTIFIER=AMD64 Family 6 Model 23 Stepping 10, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=170a
ProgramFiles=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/1279,unix/unix:/tmp/.ICE-unix/1279
SESSIONNAME=Console
SHELL=/bin/bash
SHLVL=2
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
SystemDrive=c:
SYSTEMROOT=C:\windows
TEMP=C:\users\paulo\Temp
TERM=xterm-256color
TMP=C:\users\paulo\Temp
USER=paulo
USERDOMAIN=nineveh
USERNAME=paulo
USERPROFILE=C:\users\paulo
VTE_VERSION=4402
windir=C:\windows
WINDOWID=27262982
WINDOWPATH=2
WINELOADERNOEXEC=1
winsysdir=C:\windows\system32
XAUTHORITY=/run/user/1000/gdm/Xauthority
XDG_CURRENT_DESKTOP=GNOME
XDG_MENU_PREFIX=gnome-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=gnome
XDG_SESSION_ID=1
XDG_SESSION_TYPE=x11
XDG_VTNR=2
XMODIFIERS=@im=ibus

Z:\home\paulo>

Note that PATH only refers to Wine's system directories. If I try to export a random variable, say ZZZ:

[paulo@nineveh ~] $ ZZZ=quack wine cmd
Microsoft Windows 5.2.3790 (1.9.12)

Z:\home\paulo>set
_=/usr/bin/wine
ALLUSERSPROFILE=C:\users\Public
APPDATA=C:\users\paulo\Application Data
...
XDG_VTNR=2
XMODIFIERS=@im=ibus
ZZZ=quack

Z:\home\paulo>

Note that ZZZ was exported to Wine. Now let us check binaries and whatnot:

// quack.c
#include <stdio.h>

int main(void) {
  printf("quack!\n");
  return 0;
}

I will generate two binaries, quack1 (for Linux) and quack2.exe (for Windows):

[paulo@nineveh ~] $ gcc -Wall quack.c -o quack1
[paulo@nineveh ~] $ i686-w64-mingw32-gcc -Wall quack.c -o quack2.exe
[paulo@nineveh ~] $ ls -lha quack*
-rwxrwxr-x. 1 paulo paulo 8,5K Jul 11 08:57 quack1
-rwxrwxr-x. 1 paulo paulo  78K Jul 11 08:57 quack2.exe
-rw-rw-r--. 1 paulo paulo   84 Jul 11 08:56 quack.c

Now, let us inspect the generated executables:

[paulo@nineveh ~] $ file quack1
quack1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=98adf48a7a9d9c2f0bdf5c96e62270e76e5c45a3, not stripped
[paulo@nineveh ~] $ file quack2.exe 
quack2.exe: PE32 executable (console) Intel 80386, for MS Windows

Running both files:

[paulo@nineveh ~] $ ./quack1
quack!
[paulo@nineveh ~] $ ./quack2.exe 
fixme:winediag:start_process Wine Staging 1.9.12 is a testing version containing experimental patches.
fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org.
quack!

Note that the second file (quack2.exe) was executed by Wine under the hood, as it is not a native binary. Now, let us go to Wine:

[paulo@nineveh ~] $ wine cmd
Microsoft Windows 5.2.3790 (1.9.12)

Z:\home\paulo>dir quack*
O volume na unidade Z não tem rótulo.
Número de Série do Volume é 0000-0000

Directory of Z:\home\paulo

 11/7/2016     08:56            84  quack.c
 11/7/2016     08:57         8,624  quack1
 11/7/2016     08:57        79,150  quack2.exe
       3 files                   87,858 bytes
       0 directories    437,039,472,640 bytes free


Z:\home\paulo>

Now, let us run both files:

Z:\home\paulo>quack1 
Não é possível reconhecer 'quack1' como um comando interno, externo ou arquivo de lotes.

Z:\home\paulo>quack2 
quack!

(Sorry for the messages in Portuguese)

Observe that the Linux executable was not recognized, while the Windows one was correctly executed. Now, let us inspect the PATHEXT variable:

Z:\home\paulo>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

These are the file extensions recognized by Wine/Windows as executable files.

Out of curiosity, I decided to copy quack1 to quack3.exe and see what happens inside Wine. First things first:

[paulo@nineveh ~] $ file quack3.exe 
quack3.exe: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=98adf48a7a9d9c2f0bdf5c96e62270e76e5c45a3, not stripped

Then:

[paulo@nineveh ~] $ wine cmd
Microsoft Windows 5.2.3790 (1.9.12)

Z:\home\paulo>quack3  
quack!

The file was executed! Since Wine is an emulation layer, it looks like it also understands Linux binaries if faked as Windows ones, but this is of course a dirty maneuver and should never be used.

I have the following suggestions: (a) Try to install TL inside Wine (not sure if it works), (b) set up a virtual machine with a normal Windows install (Windows XP, perhaps) and install TL inside it, or (c) install Cygwin inside Wine and see what happens next. :)

Also, note that the executable example used above is very simple and does not use a lot of shared libraries, so what worked above might fail miserably with a real world executable. My tests were very naïve, as ducks are. :)

Hope this answer gives you some pointers on how to fix this issue. Personally, I wouldn't use Wine for this, as it's just an emulation layer. I'd rather prefer a robust solution, using a proper Windows install inside a VM. :)

Addendum: David mentioned in the chatroom that formats and configurations are cross-platform in TeX Live, so in theory you would only need the Windows binaries and share everything else, but it is probably not worth.

  • Great answer! Looks like its not really practical to set it up using Wine. – A Feldman Jul 11 '16 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.