6

I'm trying to run a program in Wine with administrator privileges.

However, I have read that this is dangerous, but I don't understand the reason.

Can anybody please explain to me why I should not run Wine with sudo?

Byte Commander
  • 105,631
  • 46
  • 284
  • 425
Tech2025
  • 95
  • 1
  • 5
  • 4
    Can you **[edit]** this say where you read this (including a link) and to include a full description of what you are trying to do and why you think it might be helpful to run Wine with `sudo`? Running Wine with `sudo` is neither necessary nor useful, even to run or install Windows programs that would need you to be an administrator on Windows. – Eliah Kagan Aug 19 '17 at 11:06

3 Answers3

7

Here is the explanation from the official Wine FAQ:

6.2 Should I run Wine as root?

NEVER run Wine as root! Doing so gives Windows programs (and viruses) full access to your computer and every piece of media attached to it. Running with sudo also has these same risks but with the added bonus of breaking the permissions on your ~/.wine folder in the process. If you have run Wine with sudo you need to fix the permission errors as described in the next question, and then run winecfg to set Wine up again. You should always run Wine as the normal user you use to login.

For Linux systems, all ideas that Wine needs root can be solved through Posix Capabilities or Posix File Capabilities or correcting other security settings.

As far as Windows programs are concerned, you are running with administrator privileges. If an application complains about a lack of administrator privileges, file a bug; running Wine as root probably won't help.

Byte Commander
  • 105,631
  • 46
  • 284
  • 425
  • Thank you, I thought it might have been something like that but Im new to linux so really have no idea P: – Tech2025 Aug 19 '17 at 11:18
  • I mean, isn't that just the same advice that applies when running any binary as root? Sure, there's tons more malware for Windows than there is for Linux, but as the Windows program you're running is trustworthy, is it really any more dangerous than running an equally-trustworthy native Linux binary as root? – flarn2006 Jun 01 '19 at 23:44
  • Just for evaluation purposes, the Jan 14, 2022 copy of PBIDesktopSetup_x64.exe won't even start unless I run wine via the root account. It just complains with ole:CoGetClassObject errors unless I'm root. wine-5.0.3 (Debian 5.0.3-3) – Shawn Eary Jan 14 '22 at 20:46
4

Because if you run WINE as root, Windows malware would be able to wipe your hard drive, or any other detrimental task that requires administrator privileges.

You'reAGitForNotUsingGit
  • 14,669
  • 9
  • 48
  • 83
3

You could become victim to Wanna Cry Ransomware when running as sudo. This was confirmed in two separate answers.

You could become victim to the Petya Ransomware when running as root as per the accepted answer.

To summarize as a Linux user you too can fall victim to the most famous $300 bitcoin in payment Ransomwares of 2017 only if you run wine with sudo and get infected.

WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401