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.
thanks………………….got success :))))
Yes, it’s working, it’s really easy. Thanks
it works for me … thanks
Thanks, worked for me too. Easy.
Thnx And Love u <3
Your filesystem might prevent PlayOnLinux from running correctly.
Please open PlayOnLinux in a terminal to get more details
I have done this and got the same eoors. PLease to help
thank you it worked well :-)
thank you priend..
Its not working for me… Help plz.
Looking for python… 2.7.14+ – wxversion(s): 3.0-gtk2
selected
File “mainwindow.py”, line 1221
try:
^
IndentationError: unindent does not match any outer indentation level
Same :(
root@kali:~# playonlinux
Looking for python… 2.7.14+ – wxversion(s): 3.0-gtk2
selected
File “mainwindow.py”, line 5
SyntaxError: Non-ASCII character ‘\xc3’ in file mainwindow.py on line 5, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
WHY? Help me!
change with 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)
it will work :)
thx bro
Thank you
Thank you. it’s working very easy.
#indonesia
Your filesystem might prevent PlayOnLinux from running correctly.
Please open PlayOnLinux in a terminal to get more details
For kali 2019.1 release ” apt-get install wine:i386″ results “E: Unable to locate package wine:i386” despite of the up-to-date package manager. I have installed wine32 with “dpkg –add-architecture i386 && apt-get update && apt-get install wine32”. Now it is working.
Thank you for providing the commands to get it working. This article was written a few years ago, so the packages have probably changed. I’ll update the article.
error :
[root:~]# playonlinux
Looking for python… 2.7.16 – wxversion(s): 3.0-gtk3
selected
File “mainwindow.py”, line 1254
_(“Error”))
^
SyntaxError: invalid syntax
Help please !!
Hi,
command Line #1254 which is “_(“Error”))” to resolve issue.
i had this error too
use this to open mainwindow.py in your terminal —> leafpad /usr/share/playonlinux/python/mainwindow.py
then find the lines and click backspace on your keyboard to see the text 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)
then save it and close it and try to open playonlinux
you will get success :DDD
i mean clear the spaces using backspace behind _(“Error”))
when you see #wx.MessageBox………[“APPLICATION_TITLE”]), _(“Error”))
as one line then save it
make your leafpad like
# 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)
then it will be fixed.Error cauz of there is none in beggining of
“Sorry”).format(os.environ[“APPLICATION_TITLE”]),_(“Error”))”
root@kali:~# playonlinux
Looking for python… 2.7.16 – wxversion(s): 3.0-gtk3
selected
File “mainwindow.py”, line 1244
def singleCheck(self, executable, package=None):
^
IndentationError: expected an indented block
please help me
It doesn’t work for me
Sorry! Help me please
I tried
I ready did
Thanks… Got success
TIP if not work try to add # front _(“Error”)) like this #_(“Error”))