Wine and sudo

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
atohom
Level 1
Level 1
Posts: 5
Joined: Sun Jan 23, 2011 2:32 pm

Wine and sudo

Post by atohom »

FAQ is strongly not recommending to run wine as a root, but why is that? What should I do if I want to use FAR Manager for system administration?
Kelytha
Level 2
Level 2
Posts: 22
Joined: Fri Dec 17, 2010 4:46 am

Post by Kelytha »

Well, one of the reasons for that recommendations is that with root privileges a misbehaving application can damage your system. Also, Wine is at some points has "bug by bug" compatibility with Windows, which also raises security concerns.

It is more recommended to use a Unix equivalent of FAR in this scenario. There are quite a few really good orthodox file managers out there, like Midnight Commander or Krusader.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Wine and sudo

Post by vitamin »

atohom wrote:What should I do if I want to use FAR Manager for system administration?
Many options:
  • Use MC (midnight commander)
    Use shell
    Use GUI system tools
In all cases you really do not want to use windows program for system administration. They will newer know specifics of the environment (file permissions, ownerships, unix paths, special files like symlinks and char devices) and will constantly break text files with windows line terminations.
atohom
Level 1
Level 1
Posts: 5
Joined: Sun Jan 23, 2011 2:32 pm

Post by atohom »

After many years of use I grew accustomed to FAR, changing file manager now will break all my habits. And, as I see, wine runs FAR good enough to use, all that I am missing now is unrestricted file system access, is it possible to achieve with wine? I tried to launch it with sudo, but get this error message:
wine: /home/atohom/.wine is not owned by you
atohom
Level 1
Level 1
Posts: 5
Joined: Sun Jan 23, 2011 2:32 pm

Re: Wine and sudo

Post by atohom »

vitamin wrote:In all cases you really do not want to use windows program for system administration. They will newer know specifics of the environment (file permissions, ownerships, unix paths, special files like symlinks and char devices) and will constantly break text files with windows line terminations.
I think it is possible to make FAR understand unix specifics (it is distributed under BSD license and support plugins), but for now I just need basic operations - copy/edit/delete. As for line terminations - in FAR you can chose which one to use.
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

As already said by vitamin e.g. Midnight Commander is great. It is very similar to the good old Norton Commander which started it all. No need for FAR on Wine, just good old.
perryh

Wine and sudo

Post by perryh »

"atohom" <[email protected]> wrote:
I think it is possible to make FAR understand unix specifics
(it is distributed under BSD license and support plugins) ...
^^^^^^^^^^^

That sounds as if it is open source. Maybe a Linux version already
exists? If not, you could still try building it natively for Linux
-- much better than exposing your system to the dangers of running
something as complex (and buggy*) as wine with root permissions.

* Not complaining _at all_ -- the developers are doing a terrific
job -- but we all know that there is a long way yet to go.
atohom
Level 1
Level 1
Posts: 5
Joined: Sun Jan 23, 2011 2:32 pm

Re: Wine and sudo

Post by atohom »

perryh wrote: That sounds as if it is open source. Maybe a Linux version already
exists? If not, you could still try building it natively for Linux
Yes, FAR is open source, but developers don't have plans porting it, and you can't simply compile FAR for another system, as it is heavily relying on native Windows API.
I still hope there is a way to run wine with sudo, why it is requiring specifics owner for /home/atohom/.wine directory?
snejjj
Level 3
Level 3
Posts: 63
Joined: Sun Jul 25, 2010 5:25 am

Post by snejjj »

I still hope there is a way to run wine with sudo, why it is requiring specifics owner for /home/atohom/.wine directory?
I suppose, that's to prevent someone from running wine as root because it's very dangerous[/code]
Kelytha
Level 2
Level 2
Posts: 22
Joined: Fri Dec 17, 2010 4:46 am

Post by Kelytha »

Well, if it is open source and runs well on Wine... maybe it would worth a try to compile it with Winelib?
Martin Gregorie

Wine and sudo

Post by Martin Gregorie »

On Mon, 2011-01-24 at 07:25 -0600, atohom wrote:
perryh wrote:
That sounds as if it is open source. Maybe a Linux version already
exists? If not, you could still try building it natively for Linux
Yes, FAR is open source, but developers don't have plans porting it,
and you can't simply compile FAR for another system, as it is heavily
relying on native Windows API.
No reason why you shouldn't port it to Linux and contribute the changes
back to the project. If they aren't interested you can always fork the
project and create a Linux version.
I still hope there is a way to run wine with sudo,
A thoroughly bad idea. NEVER run Wine as root, even via sudo, unless you
want your system to be trashed or powned.
why it is requiring specifics owner for /home/atohom/.wine directory?
Almost certainly because it doesn't understand file ownership and the
relationship between ownership and access permissions. It would be
surprising if it did, since Windows access control is primitive at best.


Martin
User avatar
dimesio
Moderator
Moderator
Posts: 13370
Joined: Tue Mar 25, 2008 10:30 pm

Re: Wine and sudo

Post by dimesio »

atohom wrote:why it is requiring specifics owner for /home/atohom/.wine directory?
To prevent multiple users from sharing a wineprefix, because that will cause registry corruption.
http://wiki.winehq.org/FAQ#head-f54d469 ... 0167919859
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Wine and sudo

Post by vitamin »

atohom wrote:I just need basic operations - copy/edit/delete.
Then MC will work perfectly for you. That functionality is really close to FAR, with exception of *NIX and Windows specifics. Just try it.
atohom
Level 1
Level 1
Posts: 5
Joined: Sun Jan 23, 2011 2:32 pm

Post by atohom »

Porting FAR will also not solve all problems, as most of its value for me is in plugins, and not all of them have source code available.
Plugins is also part of why I don't want to switch to another file manager, on Windows now I have 59 plugins installed, not all of them will be needed on Linux, but there is some which I will be missing and have to find replacements for.
For now I just created .wine_r directory as a root with symlinks to original files from .wine directory and launching wine as:

sudo WINEPREFIX=$HOME/.wine_r/ wineconsole --backend=user "c:\program files\far2\far.exe"

Seems to work fine, hope there will be more convenient way for this in the future.
Locked