LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Wine Windows Emulation Trouble (https://www.linuxquestions.org/questions/slackware-14/wine-windows-emulation-trouble-566167/)

alkos333 07-02-2007 09:24 PM

Wine Windows Emulation Trouble
 
I'm trying to associate all .exe files with Wine, so I followed the following tutorial: http://tinyurl.com/325grl

I added binfmt_misc to /etc/rc.d/rc.modules and also added the following mount line to /etc/fstab:

Code:

none /proc/sys/fs/binfmt_misc binfmt_misc 0 0
Finally, the most important two lines that needed to be added to /etc/rc.d/rc.local are:

Code:

echo ':windows:M::MZ::/path/to/wine:' >  /proc/sys/fs/binfmt_misc/register
echo ':windowsPE:M::PE::/path/to/wine:' > /proc/sys/fs/binfmt_misc/register

However, when I run either one of the echo statements, I get the following:

Code:

root@alkos333:~# echo -n ':windows:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
-su: echo: write error: Invalid argument

I decided to check the permissions against all other files that I echo things out to from within rc.local, so I ran the following command:

Code:

me@alkos333:~$ for file in $(grep 'echo' /etc/rc.d/rc.local | cut -d '>' -f 2);
do
ls -l $file;
done

Output from the command above:

Code:

-rw-r--r-- 1 root root 0 2007-07-02 21:22 /proc/acpi/ibm/hotkey
-rw-r--r-- 1 root root 0 2007-07-02 20:50 /sys/devices/platform/i8042/serio1/serio2/speed
-rw-r--r-- 1 root root 0 2007-07-02 20:50 /sys/devices/platform/i8042/serio1/serio2/sensitivity
-rw-r--r-- 1 root root 0 2007-07-02 20:50 /sys/devices/platform/smapi/BAT0/stop_charge_thresh
-rw-r--r-- 1 root root 0 2007-07-02 20:50 /sys/module/processor/parameters/max_cstate
--w------- 1 root root 0 2007-07-02 21:20 /proc/sys/fs/binfmt_misc/register
--w------- 1 root root 0 2007-07-02 21:20 /proc/sys/fs/binfmt_misc/register
-rw-r--r-- 1 root root 0 2007-07-02 21:22 /proc/sys/dev/rtc/max-user-freq

What's weird about the register file, which I'm interested in, is that it's listed twice for some reason and it only has a write permission for the owner.

dive 07-03-2007 01:46 PM

Quote:

Originally Posted by alkos333
What's weird about the register file, which I'm interested in, is that it's listed twice for some reason and it only has a write permission for the owner.

That's because you have 2 'echo..' lines in rc.local. Seems there's a problem with the format of the echo arguments. That how-to is 5 years old by the way.

Road_map 07-03-2007 02:29 PM

Quote:

Originally Posted by alkos333
However, when I run either one of the echo statements, I get the following:
Code:

root@alkos333:~# echo -n ':windows:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
-su: echo: write error: Invalid argument


You don't need to run the echo statements. Just reboot and run *.exe files. By the way, you run a 2.6 kernel, right?

alkos333 07-03-2007 11:11 PM

Yeah, I'm running 2.6.20. What do you mean by reboot and run *.exe files? If I try to execute *.exe in bash, it tries to execute them as shell scripts and I need it to use wine to execute the files.

acummings 07-03-2007 11:44 PM

FWIW, why not make up your wine style command lines

then in your ~/.bashrc just make a bunch of aliases

each (short) alias launches a longer wine style startup

This is Linux. Rather than to make Linux adopt to like DOS

(where, in DOS, app.exe launches the app)

--
Alan.

dugan 07-04-2007 09:51 AM

Quote:

Originally Posted by Road_map
You don't need to run the echo statements. Just reboot and run *.exe files. By the way, you run a 2.6 kernel, right?

Do you mean that Slackware (or the 2.6 kernel) has this set up out of the box---that after modprobing binfmt_misc, you can type "/path/to/file.exe" and the file will automatically execute with Wine? No further setup is necessary?

I'd love to do some investigation myself, but my Linux box currently has Ubuntu on it so I can't.

And to answer acumming's question, one advantage of doing this is that it works in a graphical run dialog box as well as from the console. You'd be able to press ALT-F2 and type "minesweeper.exe" instead of "wine minesweeper.exe", which saves some work.

Road_map 07-04-2007 11:02 AM

Quote:

Originally Posted by dugan
Do you mean that Slackware (or the 2.6 kernel) has this set up out of the box---that after modprobing binfmt_misc, you can type "/path/to/file.exe" and the file will automatically execute with Wine? No further setup is necessary?

Yes, for all *.exe files from ~/.wine/drive_c. Example

acummings 07-04-2007 02:03 PM

Quote:

one advantage of doing this is that it works in a graphical run dialog box as well as from the console.
I was unaware that alias doesn't work in a run box. I just now tried one of my commonly used alias that works in Konsole, tried it in a run box. And, such alias does not work from a run box. (I learn something new every so often).

Now I'm wondering if alias can work in a .desktop (or launcher) file. I can't recall if I've tried this or not.

--
Alan.

dugan 07-04-2007 03:09 PM

Thanks, Road Map. As soon as I find time time to install Slackware 12 and verify this myself, I'll remove the obsolete information from my guide.

I would like some clarification, though, on the purpose of the two echo statements in the rc.local file in your screenshot. If I understand you correctly, you seemed to be saying that they weren't needed.

Road_map 07-04-2007 05:44 PM

Quote:

Originally Posted by dugan
...two echo statements in the rc.local file in your screenshot. If I understand you correctly, you seemed to be saying that they weren't needed.

The initial alkos333 post is correct, but
Quote:

Originally Posted by alkos333
However, when I run either one of the echo statements, I get the following:
Code:

root@alkos333:~# echo -n ':windows:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
-su: echo: write error: Invalid argument


At this point - as I said - it is't correct to run echo that way. It must run ./rc.local.

I tested today these informations in Slackware 12.0 (kernel 2.6.21.5-nosmp) with wine-0.9.40-i486-1kjz.tgz. It works.

eoinrua 07-04-2007 05:57 PM

Note to Dugan
 
Hi Dugan,

I was flicking through new threads and I discovered your post, with the video-editing link.

I'm looking for decent video editing software in Linux and I wonder if you'd be prepared to follow through if I posted a new thread (I know video-editing doesn't belong in this one and I apologise to everyone for butting in).

I've recently moved over to Linux, using ubuntu, and I've found replacements for most of my Windows software. Statistics is a big thing for me and after a long thread with a lot of helpful posters I've found software I'm comfortable with.

This is a Slackware forum, so I'm well outta place, but I'll post a new thread on the software forum and hope to catch you there.

Best wishes,

eoinrua

alkos333 07-04-2007 08:22 PM

Quote:

Originally Posted by Road_map
The initial alkos333 post is correct, but

At this point - as I said - it is't correct to run echo that way. It must run ./rc.local.

I tested today these informations in Slackware 12.0 (kernel 2.6.21.5-nosmp) with wine-0.9.40-i486-1kjz.tgz. It works.


So what you are saying is that as long as I run those echo statements by executing rc.local, I will be fine and can run *.exe files from anywhere on the system, not just ~/.wine/drive_c ?

Road_map 07-05-2007 08:28 AM

Quote:

Originally Posted by alkos333
So what you are saying is that as long as I run those echo statements by executing rc.local, I will be fine and can run *.exe files from anywhere on the system, not just ~/.wine/drive_c ?

Yes, you can run *.exe files from anywhere on the system. Usually, for files from ~/.wine/drive_c just cd to path and type <program>.exe. Also, some *.exe files (ex: setup programs) can be run directly from Desktop by clicking on that icon. I tested last night flashget190en.exe: the setup program ran perfectly, then it added a "shortcut" (link) on Desktop. Now I can run flashget by clicking an icon (I don't need flashget, it was only a test :)). But another *.exe files run only by typing wine <path/to/file/program.exe>.


All times are GMT -5. The time now is 09:24 AM.