4

I'm running Ubuntu 14.04 and I want to run wine under a different account for security reasons. I also want to access it from different accounts. So I made an account called wine and now I want a way to make it easy to run Wine or Playonlinux w/o having to run special commands each time. (I'm setting this up for my family who each have different accounts.)

Jason
  • 583
  • You've got the record for the slowest acceptance of any of my answers now! :D (Favour returned: answer upvoted!) – Fabby Sep 07 '18 at 08:29

1 Answers1

4

This is a 4-step process:

  1. Install gksu by apt-get install gksu
  2. Create a bash script that uses gksu - wine to change to the user wine and then execute the commands needed. (as that script is used by all users, it should probably go in /usr/local/bin.
    (For the cautious types: try it in ~/bin first)
  3. Turn X11 forwarding on by adding the following line as last line: export $(dbus-launch) to your /etc/bash.bashrc
  4. Create a link (or a desktop file) to that script and put it on the individual user's desktop.

Pro Tip: If you want to run that link without a password, have a look here

Fabby
  • 34,259
  • 1
    gksu or gksudo might be better since OP probably wants to run GUI applications. sudo doesn't work so well for application starters. ;-] – David Foerster Feb 09 '15 at 21:11
  • 1
    You might want to mention that gksu is not installed by default; the script will not do anything noticeble then :)). – Jacob Vlijm Feb 10 '15 at 07:57
  • Danke @DavidFoerster! I'm running with X11 forwarding, so I tend to forget... :( – Fabby Feb 10 '15 at 07:58
  • Dank je @JacobVlijm. Adapted! – Fabby Feb 10 '15 at 08:02
  • I made this file [/usr/local/bin/playonlinux.sh] #!/bin/bash gksu -u wine /usr/bin/playonlinux

    It fails silently. What did I do wrong?

    – Jason Feb 11 '15 at 02:27
  • Turn X11 forwarding on: In your /etc/bash.bashrc add the following line as last line: export $(dbus-launch) and try again. – Fabby Feb 11 '15 at 05:43
  • Is there any way to do the sudo without entering a password? @DavidFoerster – Jason Feb 17 '15 at 09:18