Run PlayOnLinux as root on Kali Linux

Share This:

PlayOnLinux is a Linux application that is based on Wine, which let’s you install Microsoft Windows programs on Linux. It runs on Bash and Python and is free to download and install. The initial install of PlayOnLinux is easy since it can be found in the repository, but you’ll have to do some tweaking if you want to run it as a root user, like on Kali Linux as example.

Installing PlayOnLinux

To get PlayOnLinux installed on an Ubuntu-based distro like Kali, you can try installing it using the default repositories by running:

apt-get install playonlinux

To avoid some errors later on, I would also suggest running the following commands to get the 32-bit version of Wine installed:

apt-get install wine:i386
wine --version
apt-get install wine32

If you get an error running the command above in recent versions of Kali, you can try running the command below (thank you to the reader that commented with this solution):

dpkg –add-architecture i386 && apt-get update && apt-get install wine32

Run PlayOnLinux as root

If you’re running Kali Linux (or any other distro) as root, you’ll run into a message saying “PlayOnLinux is not supposed to be run as root. Sorry”. To get around that, you’ll need to edit two files:

leafpad /usr/share/playonlinux/python/mainwindow.py

When the file opens, you’ll want to look for the following lines and comment them out by adding a # in front of the line:

if(os.popen("id -u").read() == "0\n" or os.popen("id -u").read() == "0"):
wx.MessageBox(_("{0} is not supposed to be run as root. Sorry").format(os.environ["APPLICATION_TITLE"]),_("Error"))
os._exit(1)

So that it looks like this:

# if(os.popen(“id -u”).read() == “0\n” or os.popen(“id -u”).read() == “0”):
# wx.MessageBox(_(“{0} is not supposed to be run as root. Sorry”).format(os.environ[“APPLICATION_TITLE”]),_(“Error”))
# os._exit(0)

leafpad /usr/share/playonlinux/lib/sources

You’ll want to find the 5 lines below and comment them out by adding a # in front of the line:

if [ "$(id -u)" = "0" ]
then
echo "PlayOnLinux is not supposed to be run as root. Sorry"
exit
fi

After making the changes above to the files, you should be able to run PlayOnLinux as root in Kali Linux (or any other Linux distro). If you’ve tried the steps above, let us know how it worked for you by leaving us a comment below.


Share This:

Related Content

27 Comments

  1. parthJune 26, 2017
  2. SzabiAugust 29, 2017
  3. ShadMaNSeptember 27, 2017
  4. 2h SystemsSeptember 28, 2017
  5. AhsanKhanOctober 13, 2017
  6. david bozenskiOctober 31, 2017
  7. dJanuary 4, 2018
  8. who iam149January 14, 2018
  9. ahrmaneeJanuary 28, 2018
    • Bk201June 1, 2019
  10. NONAMEFebruary 20, 2018
  11. YeanMarch 23, 2018
  12. sametApril 8, 2018
  13. mindfrost82September 4, 2018
  14. garryFebruary 24, 2019
  15. denis the menaceFebruary 27, 2019
  16. mb-wApril 19, 2019
    • Robert RussellApril 19, 2019
  17. Bk201June 1, 2019
    • NavaneethJuly 1, 2019
    • Mt80August 11, 2019
      • Mt80August 11, 2019
  18. gearscopJune 26, 2019
  19. AneesJuly 15, 2019
  20. ephraimJuly 17, 2019
  21. RASELAugust 5, 2019
  22. anounymDecember 6, 2019

Leave a Comment